mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 16:31:13 +00:00
29515862ac
Backport H616 thermal sensor support from linux-next. Tested on the Orange Pi Zero 3 (H618 SoC). Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
51 lines
2.0 KiB
Diff
51 lines
2.0 KiB
Diff
From e7dbfa19572a1440a2e67ef70f94ff204849a0a8 Mon Sep 17 00:00:00 2001
|
|
From: Martin Botka <martin.botka@somainline.org>
|
|
Date: Mon, 19 Feb 2024 15:36:38 +0000
|
|
Subject: [PATCH] thermal/drivers/sun8i: Add support for H616 THS controller
|
|
|
|
Add support for the thermal sensor found in H616 SoCs, is the same as
|
|
the H6 thermal sensor controller, but with four sensors.
|
|
Also the registers readings are wrong, unless a bit in the first SYS_CFG
|
|
register cleared, so set exercise the SRAM regmap to take care of that.
|
|
|
|
Signed-off-by: Martin Botka <martin.botka@somainline.org>
|
|
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
|
|
Acked-by: Vasily Khoruzhick <anarsoul@gmail.com>
|
|
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
|
|
Link: https://lore.kernel.org/r/20240219153639.179814-7-andre.przywara@arm.com
|
|
---
|
|
drivers/thermal/sun8i_thermal.c | 15 +++++++++++++++
|
|
1 file changed, 15 insertions(+)
|
|
|
|
--- a/drivers/thermal/sun8i_thermal.c
|
|
+++ b/drivers/thermal/sun8i_thermal.c
|
|
@@ -688,6 +688,20 @@ static const struct ths_thermal_chip sun
|
|
.calc_temp = sun8i_ths_calc_temp,
|
|
};
|
|
|
|
+static const struct ths_thermal_chip sun50i_h616_ths = {
|
|
+ .sensor_num = 4,
|
|
+ .has_bus_clk_reset = true,
|
|
+ .needs_sram = true,
|
|
+ .ft_deviation = 8000,
|
|
+ .offset = 263655,
|
|
+ .scale = 810,
|
|
+ .temp_data_base = SUN50I_H6_THS_TEMP_DATA,
|
|
+ .calibrate = sun50i_h6_ths_calibrate,
|
|
+ .init = sun50i_h6_thermal_init,
|
|
+ .irq_ack = sun50i_h6_irq_ack,
|
|
+ .calc_temp = sun8i_ths_calc_temp,
|
|
+};
|
|
+
|
|
static const struct of_device_id of_ths_match[] = {
|
|
{ .compatible = "allwinner,sun8i-a83t-ths", .data = &sun8i_a83t_ths },
|
|
{ .compatible = "allwinner,sun8i-h3-ths", .data = &sun8i_h3_ths },
|
|
@@ -697,6 +711,7 @@ static const struct of_device_id of_ths_
|
|
{ .compatible = "allwinner,sun50i-h5-ths", .data = &sun50i_h5_ths },
|
|
{ .compatible = "allwinner,sun50i-h6-ths", .data = &sun50i_h6_ths },
|
|
{ .compatible = "allwinner,sun20i-d1-ths", .data = &sun20i_d1_ths },
|
|
+ { .compatible = "allwinner,sun50i-h616-ths", .data = &sun50i_h616_ths },
|
|
{ /* sentinel */ },
|
|
};
|
|
MODULE_DEVICE_TABLE(of, of_ths_match);
|