summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2018-07-25 18:11:46 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2018-07-25 18:11:46 +0200
commit3f89215e7c594352dbdaa249322ecfd0eb269a67 (patch)
tree2dc53a2d2f1c180ac4dae405222e96b7b079bdc3
parent4b4cb5e4b5fbe9612ec7b3d28dc840ed55d77019 (diff)
thermal/drivers/hisi: Hack to support different interruptshikey960-v4.18-rc5
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r--arch/arm64/boot/dts/hisilicon/hi3660.dtsi3
-rw-r--r--drivers/thermal/hisi_thermal.c28
2 files changed, 15 insertions, 16 deletions
diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
index a63bb8783c51..964e6e0003a8 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi
@@ -1183,7 +1183,8 @@
tsensor: tsensor@fff30000 {
compatible = "hisilicon,hi3660-tsensor";
reg = <0x0 0xfff30000 0x0 0x1000>;
- interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
+ interrupts = <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
#thermal-sensor-cells = <1>;
};
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c
index 07f421f0e783..3a07b72a2db6 100644
--- a/drivers/thermal/hisi_thermal.c
+++ b/drivers/thermal/hisi_thermal.c
@@ -585,10 +585,6 @@ static int hisi_thermal_probe(struct platform_device *pdev)
return PTR_ERR(data->regs);
}
- data->irq = platform_get_irq(pdev, 0);
- if (data->irq < 0)
- return data->irq;
-
ret = data->ops->probe(data);
if (ret)
return ret;
@@ -596,6 +592,19 @@ static int hisi_thermal_probe(struct platform_device *pdev)
for (i = 0; i < data->nr_sensors; i++) {
struct hisi_thermal_sensor *sensor = &data->sensor[i];
+ data->irq = platform_get_irq(pdev, i);
+ if (data->irq < 0)
+ return data->irq;
+
+ ret = devm_request_threaded_irq(dev, data->irq, NULL,
+ hisi_thermal_alarm_irq_thread,
+ IRQF_ONESHOT, "hisi_thermal",
+ data);
+ if (ret < 0) {
+ dev_err(dev, "failed to request alarm irq: %d\n", ret);
+ return ret;
+ }
+
ret = hisi_thermal_register_sensor(pdev, sensor);
if (ret) {
dev_err(dev, "failed to register thermal sensor: %d\n",
@@ -612,17 +621,6 @@ static int hisi_thermal_probe(struct platform_device *pdev)
hisi_thermal_toggle_sensor(sensor, true);
}
- if (data->irq) {
- ret = devm_request_threaded_irq(dev, data->irq, NULL,
- hisi_thermal_alarm_irq_thread,
- IRQF_ONESHOT, "hisi_thermal",
- data);
- if (ret < 0) {
- dev_err(dev, "failed to request alarm irq: %d\n", ret);
- return ret;
- }
- }
-
return 0;
}