@@ -227,6 +227,8 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
goto err_clk;
}
+ thermal_zone_device_toggle(tz, true);
+
/*
* right now the FW does set up the HW-block, so we are not
* touching the configuration registers.
@@ -336,6 +336,8 @@ static int brcmstb_thermal_probe(struct platform_device *pdev)
return ret;
}
+ thermal_zone_device_toggle(thermal, true);
+
priv->thermal = thermal;
irq = platform_get_irq(pdev, 0);
@@ -71,6 +71,8 @@ static int ns_thermal_probe(struct platform_device *pdev)
return PTR_ERR(ns_thermal->tz);
}
+ thermal_zone_device_toggle(ns_thermal->tz, true);
+
platform_set_drvdata(pdev, ns_thermal);
return 0;
@@ -490,6 +490,8 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev,
return ret;
}
+ thermal_zone_device_toggle(sensor->tzd, true);
+
trip = of_thermal_get_trip_points(sensor->tzd);
for (i = 0; i < of_thermal_get_ntrips(sensor->tzd); i++) {
@@ -126,6 +126,8 @@ static int max77620_thermal_probe(struct platform_device *pdev)
return ret;
}
+ thermal_zone_device_toggle(mtherm->tz_device, true);
+
ret = devm_request_threaded_irq(&pdev->dev, mtherm->irq_tjalarm1, NULL,
max77620_thermal_irq,
IRQF_ONESHOT | IRQF_SHARED,
@@ -769,6 +769,8 @@ static int mtk_thermal_probe(struct platform_device *pdev)
goto err_disable_clk_peri_therm;
}
+ thermal_zone_device_toggle(tzdev, true);
+
return 0;
err_disable_clk_peri_therm:
@@ -509,9 +509,6 @@ struct thermal_zone_device *
if (sensor_specs.np == sensor_np && id == sensor_id) {
tzd = thermal_zone_of_add_sensor(child, sensor_np,
data, ops);
- if (!IS_ERR(tzd))
- thermal_zone_device_toggle(tzd, true);
-
of_node_put(sensor_specs.np);
of_node_put(child);
goto exit;
@@ -270,6 +270,8 @@ static int qpnp_tm_probe(struct platform_device *pdev)
return PTR_ERR(chip->tz_dev);
}
+ thermal_zone_device_toggle(chip->tz_dev, true);
+
return 0;
}
@@ -95,12 +95,17 @@ static int tsens_register(struct tsens_device *tmdev)
for (i = 0; i < tmdev->num_sensors; i++) {
tmdev->sensor[i].tmdev = tmdev;
tmdev->sensor[i].id = i;
+
tzd = devm_thermal_zone_of_sensor_register(tmdev->dev, i,
&tmdev->sensor[i],
&tsens_of_ops);
if (IS_ERR(tzd))
continue;
+
+ thermal_zone_device_toggle(tzd, true);
+
tmdev->sensor[i].tzd = tzd;
+
if (tmdev->ops->enable)
tmdev->ops->enable(tmdev, i);
}
@@ -242,6 +242,8 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
goto err_tmu;
}
+ thermal_zone_device_toggle(data->tz, true);
+
/* Enable monitoring */
site |= 0x1 << (15 - data->sensor_id);
tmu_write(data, site | TMR_ME | TMR_ALPF, &data->regs->tmr);
@@ -429,6 +429,9 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
ret = PTR_ERR(zone);
goto error_unregister;
}
+
+ thermal_zone_device_toggle(zone, true);
+
tsc->zone = zone;
ret = of_thermal_get_ntrips(tsc->zone);
@@ -515,6 +515,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
goto error_unregister;
}
+ if (rcar_use_of_thermal(dev))
+ thermal_zone_device_toggle(priv->zone, true);
+
if (rcar_use_of_thermal(dev)) {
/*
* thermal_zone doesn't enable hwmon as default,
@@ -1162,6 +1162,8 @@ static int rockchip_configure_from_dt(struct device *dev,
return error;
}
+ thermal_zone_device_toggle(sensor->tzd, true);
+
return 0;
}
@@ -1403,6 +1403,8 @@ static int exynos_tmu_probe(struct platform_device *pdev)
goto err_sclk;
}
+ thermal_zone_device_toggle(data->tzd, true);
+
ret = exynos_tmu_initialize(pdev);
if (ret) {
dev_err(&pdev->dev, "Failed to initialize TMU\n");
@@ -90,6 +90,9 @@ static int tango_thermal_probe(struct platform_device *pdev)
tango_thermal_init(priv);
tzdev = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, priv, &ops);
+ if (!IS_ERR(tzdev))
+ thermal_zone_device_toggle(tzdev, true);
+
return PTR_ERR_OR_ZERO(tzdev);
}
@@ -1400,6 +1400,8 @@ static int tegra_soctherm_probe(struct platform_device *pdev)
goto disable_clocks;
}
+ thermal_zone_device_toggle(z, true);
+
zone->tz = z;
tegra->thermctl_tzs[soc->ttgs[i]->id] = z;
@@ -213,6 +213,8 @@ static int tegra_bpmp_thermal_probe(struct platform_device *pdev)
continue;
}
+ thermal_zone_device_toggle(tzd, true);
+
zone->tzd = tzd;
INIT_WORK(&zone->tz_device_update_work,
tz_device_update_work_fn);
@@ -142,6 +142,8 @@ static int gadc_thermal_probe(struct platform_device *pdev)
return ret;
}
+ thermal_zone_device_toggle(gti->tz_dev, true);
+
return 0;
}
@@ -197,6 +197,8 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
return PTR_ERR(data->ti_thermal);
}
+ thermal_zone_device_toggle(data->ti_thermal, true);
+
ti_bandgap_set_sensor_data(bgp, id, data);
ti_bandgap_write_update_interval(bgp, data->sensor_id,
data->ti_thermal->polling_delay);
@@ -307,6 +307,8 @@ static int uniphier_tm_probe(struct platform_device *pdev)
return PTR_ERR(tdev->tz_dev);
}
+ thermal_zone_device_toggle(tdev->tz_dev, true);
+
/* get trip points */
trips = of_thermal_get_trip_points(tdev->tz_dev);
ntrips = of_thermal_get_ntrips(tdev->tz_dev);
@@ -168,6 +168,8 @@ static int zx2967_thermal_probe(struct platform_device *pdev)
goto disable_clk_all;
}
+ thermal_zone_device_toggle(priv->tzd, true);
+
if (priv->tzd->tzp->slope == 0) {
thermal_zone_of_sensor_unregister(&pdev->dev, priv->tzd);
dev_err(&pdev->dev, "coefficients of sensor is invalid\n");
Move thermal_zone_device_toggle() call to the users of [devm]_thermal_zone_of_sensor_register(). Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> --- drivers/thermal/broadcom/bcm2835_thermal.c | 2 ++ drivers/thermal/broadcom/brcmstb_thermal.c | 2 ++ drivers/thermal/broadcom/ns-thermal.c | 2 ++ drivers/thermal/hisi_thermal.c | 2 ++ drivers/thermal/max77620_thermal.c | 2 ++ drivers/thermal/mtk_thermal.c | 2 ++ drivers/thermal/of-thermal.c | 3 --- drivers/thermal/qcom-spmi-temp-alarm.c | 2 ++ drivers/thermal/qcom/tsens.c | 5 +++++ drivers/thermal/qoriq_thermal.c | 2 ++ drivers/thermal/rcar_gen3_thermal.c | 3 +++ drivers/thermal/rcar_thermal.c | 3 +++ drivers/thermal/rockchip_thermal.c | 2 ++ drivers/thermal/samsung/exynos_tmu.c | 2 ++ drivers/thermal/tango_thermal.c | 3 +++ drivers/thermal/tegra/soctherm.c | 2 ++ drivers/thermal/tegra/tegra-bpmp-thermal.c | 2 ++ drivers/thermal/thermal-generic-adc.c | 2 ++ drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 ++ drivers/thermal/uniphier_thermal.c | 2 ++ drivers/thermal/zx2967_thermal.c | 2 ++ 21 files changed, 46 insertions(+), 3 deletions(-)