sunxi: 6.6: refresh patches
[openwrt/staging/pepe2k.git] / target / linux / sunxi / patches-6.6 / 010-v6.8-thermal-drivers-sun8i-Add-D1-T113s-THS-controller-support.patch
1 From ebbf19e36d021f253425344b4d4b987f3b7d9be5 Mon Sep 17 00:00:00 2001
2 From: Maxim Kiselev <bigunclemax@gmail.com>
3 Date: Mon, 18 Dec 2023 00:06:23 +0300
4 Subject: [PATCH] thermal/drivers/sun8i: Add D1/T113s THS controller support
5
6 This patch adds a thermal sensor controller support for the D1/T113s,
7 which is similar to the one on H6, but with only one sensor and
8 different scale and offset values.
9
10 Signed-off-by: Maxim Kiselev <bigunclemax@gmail.com>
11 Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
12 Reviewed-by: Andre Przywara <andre.przywara@arm.com>
13 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
14 Link: https://lore.kernel.org/r/20231217210629.131486-3-bigunclemax@gmail.com
15 ---
16 drivers/thermal/sun8i_thermal.c | 13 +++++++++++++
17 1 file changed, 13 insertions(+)
18
19 --- a/drivers/thermal/sun8i_thermal.c
20 +++ b/drivers/thermal/sun8i_thermal.c
21 @@ -606,6 +606,18 @@ static const struct ths_thermal_chip sun
22 .calc_temp = sun8i_ths_calc_temp,
23 };
24
25 +static const struct ths_thermal_chip sun20i_d1_ths = {
26 + .sensor_num = 1,
27 + .has_bus_clk_reset = true,
28 + .offset = 188552,
29 + .scale = 673,
30 + .temp_data_base = SUN50I_H6_THS_TEMP_DATA,
31 + .calibrate = sun50i_h6_ths_calibrate,
32 + .init = sun50i_h6_thermal_init,
33 + .irq_ack = sun50i_h6_irq_ack,
34 + .calc_temp = sun8i_ths_calc_temp,
35 +};
36 +
37 static const struct of_device_id of_ths_match[] = {
38 { .compatible = "allwinner,sun8i-a83t-ths", .data = &sun8i_a83t_ths },
39 { .compatible = "allwinner,sun8i-h3-ths", .data = &sun8i_h3_ths },
40 @@ -614,6 +626,7 @@ static const struct of_device_id of_ths_
41 { .compatible = "allwinner,sun50i-a100-ths", .data = &sun50i_a100_ths },
42 { .compatible = "allwinner,sun50i-h5-ths", .data = &sun50i_h5_ths },
43 { .compatible = "allwinner,sun50i-h6-ths", .data = &sun50i_h6_ths },
44 + { .compatible = "allwinner,sun20i-d1-ths", .data = &sun20i_d1_ths },
45 { /* sentinel */ },
46 };
47 MODULE_DEVICE_TABLE(of, of_ths_match);