Skip to content

Commit 8c6c368

Browse files
dlezcanoEduardo Valentin
authored andcommitted
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>
1 parent ce8c070 commit 8c6c368

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

drivers/thermal/hisi_thermal.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,14 +424,20 @@ static int hi3660_thermal_probe(struct hisi_thermal_data *data)
424424
struct platform_device *pdev = data->pdev;
425425
struct device *dev = &pdev->dev;
426426

427-
data->sensor = devm_kzalloc(dev, sizeof(*data->sensor), GFP_KERNEL);
427+
data->nr_sensors = 2;
428+
429+
data->sensor = devm_kzalloc(dev, sizeof(*data->sensor) *
430+
data->nr_sensors, GFP_KERNEL);
428431
if (!data->sensor)
429432
return -ENOMEM;
430433

431434
data->sensor[0].id = HI3660_BIG_SENSOR;
432435
data->sensor[0].irq_name = "tsensor_a73";
433436
data->sensor[0].data = data;
434-
data->nr_sensors = 1;
437+
438+
data->sensor[1].id = HI3660_LITTLE_SENSOR;
439+
data->sensor[1].irq_name = "tsensor_a53";
440+
data->sensor[1].data = data;
435441

436442
return 0;
437443
}
@@ -443,8 +449,8 @@ static int hisi_thermal_get_temp(void *__data, int *temp)
443449

444450
*temp = data->ops->get_temp(sensor);
445451

446-
dev_dbg(&data->pdev->dev, "id=%d, temp=%d, thres=%d\n",
447-
sensor->id, *temp, sensor->thres_temp);
452+
dev_dbg(&data->pdev->dev, "tzd=%p, id=%d, temp=%d, thres=%d\n",
453+
sensor->tzd, sensor->id, *temp, sensor->thres_temp);
448454

449455
return 0;
450456
}

0 commit comments

Comments
 (0)