010-v6.8-thermal-drivers-sun8i-Add-D1-T113s-THS-controller-support.patch 1.9 KB

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