Skip to content

Commit 83620b3

Browse files
Haxk20dlezcano
authored andcommitted
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 <[email protected]> Signed-off-by: Andre Przywara <[email protected]> Acked-by: Vasily Khoruzhick <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent bd0b451 commit 83620b3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/thermal/sun8i_thermal.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,20 @@ static const struct ths_thermal_chip sun20i_d1_ths = {
684684
.calc_temp = sun8i_ths_calc_temp,
685685
};
686686

687+
static const struct ths_thermal_chip sun50i_h616_ths = {
688+
.sensor_num = 4,
689+
.has_bus_clk_reset = true,
690+
.needs_sram = true,
691+
.ft_deviation = 8000,
692+
.offset = 263655,
693+
.scale = 810,
694+
.temp_data_base = SUN50I_H6_THS_TEMP_DATA,
695+
.calibrate = sun50i_h6_ths_calibrate,
696+
.init = sun50i_h6_thermal_init,
697+
.irq_ack = sun50i_h6_irq_ack,
698+
.calc_temp = sun8i_ths_calc_temp,
699+
};
700+
687701
static const struct of_device_id of_ths_match[] = {
688702
{ .compatible = "allwinner,sun8i-a83t-ths", .data = &sun8i_a83t_ths },
689703
{ .compatible = "allwinner,sun8i-h3-ths", .data = &sun8i_h3_ths },
@@ -693,6 +707,7 @@ static const struct of_device_id of_ths_match[] = {
693707
{ .compatible = "allwinner,sun50i-h5-ths", .data = &sun50i_h5_ths },
694708
{ .compatible = "allwinner,sun50i-h6-ths", .data = &sun50i_h6_ths },
695709
{ .compatible = "allwinner,sun20i-d1-ths", .data = &sun20i_d1_ths },
710+
{ .compatible = "allwinner,sun50i-h616-ths", .data = &sun50i_h616_ths },
696711
{ /* sentinel */ },
697712
};
698713
MODULE_DEVICE_TABLE(of, of_ths_match);

0 commit comments

Comments
 (0)