diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2018-09-25 11:03:12 +0200 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2018-10-22 17:52:11 -0700 |
commit | 8c6c36846f1174784bcf90627341ede7ce9a0b36 (patch) | |
tree | 950164f404bfd4d2bb30e8e07a7a66de958bd7f5 /drivers/thermal | |
parent | ce8c0700dcf905333733f83a06cd956496e0a661 (diff) | |
download | linux-stable-8c6c36846f1174784bcf90627341ede7ce9a0b36.tar.gz linux-stable-8c6c36846f1174784bcf90627341ede7ce9a0b36.tar.bz2 linux-stable-8c6c36846f1174784bcf90627341ede7ce9a0b36.zip |
thermal/drivers/hisi: Add the dual clusters sensors for hi3660
The code is ready to support multiple sensors on the hi3660. The DT
defines a thermal zone per cluster.
Add the little cluster sensor and let it bind with the thermal zone.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/hisi_thermal.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index ba89cb9a6248..c4111a98f1a7 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -424,14 +424,20 @@ static int hi3660_thermal_probe(struct hisi_thermal_data *data) struct platform_device *pdev = data->pdev; struct device *dev = &pdev->dev; - data->sensor = devm_kzalloc(dev, sizeof(*data->sensor), GFP_KERNEL); + data->nr_sensors = 2; + + data->sensor = devm_kzalloc(dev, sizeof(*data->sensor) * + data->nr_sensors, GFP_KERNEL); if (!data->sensor) return -ENOMEM; data->sensor[0].id = HI3660_BIG_SENSOR; data->sensor[0].irq_name = "tsensor_a73"; data->sensor[0].data = data; - data->nr_sensors = 1; + + data->sensor[1].id = HI3660_LITTLE_SENSOR; + data->sensor[1].irq_name = "tsensor_a53"; + data->sensor[1].data = data; return 0; } @@ -443,8 +449,8 @@ static int hisi_thermal_get_temp(void *__data, int *temp) *temp = data->ops->get_temp(sensor); - dev_dbg(&data->pdev->dev, "id=%d, temp=%d, thres=%d\n", - sensor->id, *temp, sensor->thres_temp); + dev_dbg(&data->pdev->dev, "tzd=%p, id=%d, temp=%d, thres=%d\n", + sensor->tzd, sensor->id, *temp, sensor->thres_temp); return 0; } |