lkml.org 
[lkml]   [2018]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 11/17] thermal: rockchip_thermal: enable/check sensor after its setup is finished
Date
* Enable/check sensor explicitly in rockchip_thermal_probe() (also
check sensor after doing chipset specific control operation).

* Remove superfluous second sensor enable/check attempt.

Cc: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
This driver may require some more fixing (probably IRQ should be
requested after ->control call).

drivers/thermal/rockchip_thermal.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 500cfc3..0b3509b 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -1161,9 +1161,6 @@ static int rockchip_configure_from_dt(struct device *dev,
return error;
}

- thermal_zone_device_toggle(sensor->tzd, true);
- thermal_zone_device_check(sensor->tzd);
-
return 0;
}

@@ -1272,6 +1269,9 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
}
}

+ for (i = 0; i < thermal->chip->chn_num; i++)
+ thermal_zone_device_toggle((&thermal->sensors[i])->tzd, true);
+
error = devm_request_threaded_irq(&pdev->dev, irq, NULL,
&rockchip_thermal_alarm_irq_thread,
IRQF_ONESHOT,
@@ -1284,10 +1284,8 @@ static int rockchip_thermal_probe(struct platform_device *pdev)

thermal->chip->control(thermal->regs, true);

- for (i = 0; i < thermal->chip->chn_num; i++) {
- thermal_zone_device_toggle((&thermal->sensors[i])->tzd, true);
+ for (i = 0; i < thermal->chip->chn_num; i++)
thermal_zone_device_check((&thermal->sensors[i])->tzd);
- }

platform_set_drvdata(pdev, thermal);

--
1.9.1
\
 
 \ /
  Last update: 2018-04-10 14:46    [W:0.122 / U:0.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site