aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/thermal/hisi_thermal.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c
index 7c5d4647cb5e..0b1f56a81b9f 100644
--- a/drivers/thermal/hisi_thermal.c
+++ b/drivers/thermal/hisi_thermal.c
@@ -49,8 +49,6 @@
49struct hisi_thermal_sensor { 49struct hisi_thermal_sensor {
50 struct hisi_thermal_data *thermal; 50 struct hisi_thermal_data *thermal;
51 struct thermal_zone_device *tzd; 51 struct thermal_zone_device *tzd;
52
53 long sensor_temp;
54 uint32_t id; 52 uint32_t id;
55 uint32_t thres_temp; 53 uint32_t thres_temp;
56}; 54};
@@ -59,9 +57,9 @@ struct hisi_thermal_data {
59 struct mutex thermal_lock; /* protects register data */ 57 struct mutex thermal_lock; /* protects register data */
60 struct platform_device *pdev; 58 struct platform_device *pdev;
61 struct clk *clk; 59 struct clk *clk;
62 struct hisi_thermal_sensor sensors; 60 struct hisi_thermal_sensor sensor;
63 int irq;
64 void __iomem *regs; 61 void __iomem *regs;
62 int irq;
65}; 63};
66 64
67/* 65/*
@@ -233,7 +231,7 @@ static const struct thermal_zone_of_device_ops hisi_of_thermal_ops = {
233static irqreturn_t hisi_thermal_alarm_irq_thread(int irq, void *dev) 231static irqreturn_t hisi_thermal_alarm_irq_thread(int irq, void *dev)
234{ 232{
235 struct hisi_thermal_data *data = dev; 233 struct hisi_thermal_data *data = dev;
236 struct hisi_thermal_sensor *sensor = &data->sensors; 234 struct hisi_thermal_sensor *sensor = &data->sensor;
237 int temp; 235 int temp;
238 236
239 hisi_thermal_alarm_clear(data->regs, 1); 237 hisi_thermal_alarm_clear(data->regs, 1);
@@ -244,7 +242,7 @@ static irqreturn_t hisi_thermal_alarm_irq_thread(int irq, void *dev)
244 dev_crit(&data->pdev->dev, "THERMAL ALARM: %d > %d\n", 242 dev_crit(&data->pdev->dev, "THERMAL ALARM: %d > %d\n",
245 temp, sensor->thres_temp); 243 temp, sensor->thres_temp);
246 244
247 thermal_zone_device_update(data->sensors.tzd, 245 thermal_zone_device_update(data->sensor.tzd,
248 THERMAL_EVENT_UNSPECIFIED); 246 THERMAL_EVENT_UNSPECIFIED);
249 247
250 } else if (temp < sensor->thres_temp) { 248 } else if (temp < sensor->thres_temp) {
@@ -307,7 +305,7 @@ static int hisi_thermal_setup(struct hisi_thermal_data *data)
307{ 305{
308 struct hisi_thermal_sensor *sensor; 306 struct hisi_thermal_sensor *sensor;
309 307
310 sensor = &data->sensors; 308 sensor = &data->sensor;
311 309
312 /* disable module firstly */ 310 /* disable module firstly */
313 hisi_thermal_reset_enable(data->regs, 0); 311 hisi_thermal_reset_enable(data->regs, 0);
@@ -380,7 +378,7 @@ static int hisi_thermal_probe(struct platform_device *pdev)
380 } 378 }
381 379
382 ret = hisi_thermal_register_sensor(pdev, data, 380 ret = hisi_thermal_register_sensor(pdev, data,
383 &data->sensors, 381 &data->sensor,
384 HISI_DEFAULT_SENSOR); 382 HISI_DEFAULT_SENSOR);
385 if (ret) { 383 if (ret) {
386 dev_err(&pdev->dev, "failed to register thermal sensor: %d\n", 384 dev_err(&pdev->dev, "failed to register thermal sensor: %d\n",
@@ -402,7 +400,7 @@ static int hisi_thermal_probe(struct platform_device *pdev)
402 return ret; 400 return ret;
403 } 401 }
404 402
405 hisi_thermal_toggle_sensor(&data->sensors, true); 403 hisi_thermal_toggle_sensor(&data->sensor, true);
406 404
407 return 0; 405 return 0;
408} 406}
@@ -410,7 +408,7 @@ static int hisi_thermal_probe(struct platform_device *pdev)
410static int hisi_thermal_remove(struct platform_device *pdev) 408static int hisi_thermal_remove(struct platform_device *pdev)
411{ 409{
412 struct hisi_thermal_data *data = platform_get_drvdata(pdev); 410 struct hisi_thermal_data *data = platform_get_drvdata(pdev);
413 struct hisi_thermal_sensor *sensor = &data->sensors; 411 struct hisi_thermal_sensor *sensor = &data->sensor;
414 412
415 hisi_thermal_toggle_sensor(sensor, false); 413 hisi_thermal_toggle_sensor(sensor, false);
416 hisi_thermal_disable_sensor(data); 414 hisi_thermal_disable_sensor(data);