diff options
author | Amit Daniel Kachhap <amit.daniel@samsung.com> | 2013-06-24 16:20:34 +0530 |
---|---|---|
committer | Eduardo Valentin <eduardo.valentin@ti.com> | 2013-08-13 09:52:01 -0400 |
commit | 4de0bdaa9677d11406c9becb70c60887c957e1f0 (patch) | |
tree | 62dbdd3dd3d7592dec10f64c8055c79a6d219291 /drivers/thermal/samsung/exynos_tmu.c | |
parent | a4463c4f669ac776a1f456fb51fd3c8c99ef904f (diff) | |
download | op-kernel-dev-4de0bdaa9677d11406c9becb70c60887c957e1f0.zip op-kernel-dev-4de0bdaa9677d11406c9becb70c60887c957e1f0.tar.gz |
thermal: exynos: Add support for instance based register/unregister
This code modifies the thermal driver to have multiple thermal zone
support by replacing the global thermal zone variable with device data
member of thermal_zone_device.
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Diffstat (limited to 'drivers/thermal/samsung/exynos_tmu.c')
-rw-r--r-- | drivers/thermal/samsung/exynos_tmu.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index f6f63ca..a7bba69 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -345,6 +345,12 @@ static int exynos_tmu_set_emulation(void *drv_data, unsigned long temp) { return -EINVAL; } #endif/*CONFIG_THERMAL_EMULATION*/ +static struct thermal_sensor_conf exynos_sensor_conf = { + .name = "exynos-therm", + .read_temperature = (int (*)(void *))exynos_tmu_read, + .write_emul_temp = exynos_tmu_set_emulation, +}; + static void exynos_tmu_work(struct work_struct *work) { struct exynos_tmu_data *data = container_of(work, @@ -353,7 +359,7 @@ static void exynos_tmu_work(struct work_struct *work) const struct exynos_tmu_registers *reg = pdata->registers; unsigned int val_irq; - exynos_report_trigger(); + exynos_report_trigger(&exynos_sensor_conf); mutex_lock(&data->lock); clk_enable(data->clk); @@ -377,11 +383,6 @@ static irqreturn_t exynos_tmu_irq(int irq, void *id) return IRQ_HANDLED; } -static struct thermal_sensor_conf exynos_sensor_conf = { - .name = "exynos-therm", - .read_temperature = (int (*)(void *))exynos_tmu_read, - .write_emul_temp = exynos_tmu_set_emulation, -}; #ifdef CONFIG_OF static const struct of_device_id exynos_tmu_match[] = { @@ -541,7 +542,7 @@ static int exynos_tmu_remove(struct platform_device *pdev) exynos_tmu_control(pdev, false); - exynos_unregister_thermal(); + exynos_unregister_thermal(&exynos_sensor_conf); clk_unprepare(data->clk); |