2
0

831-thermal-drivers-mediatek-Fix-control-buffer-enablement-on-MT7896.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. From patchwork Thu Sep 7 11:20:18 2023
  2. Content-Type: text/plain; charset="utf-8"
  3. MIME-Version: 1.0
  4. Content-Transfer-Encoding: 7bit
  5. X-Patchwork-Submitter: Frank Wunderlich <[email protected]>
  6. X-Patchwork-Id: 13376356
  7. From: Frank Wunderlich <[email protected]>
  8. To: [email protected]
  9. Subject: [PATCH] thermal/drivers/mediatek: Fix control buffer enablement on
  10. MT7896
  11. Date: Thu, 7 Sep 2023 13:20:18 +0200
  12. Message-Id: <[email protected]>
  13. X-Mailer: git-send-email 2.34.1
  14. MIME-Version: 1.0
  15. X-Mail-ID: e7eeb8e1-00de-41f6-a5df-ce2e9164136e
  16. X-BeenThere: [email protected]
  17. X-Mailman-Version: 2.1.34
  18. Precedence: list
  19. List-Id: <linux-mediatek.lists.infradead.org>
  20. Cc: Daniel Lezcano <[email protected]>,
  21. "Rafael J. Wysocki" <[email protected]>, [email protected],
  22. Amit Kucheria <[email protected]>, Daniel Golle <[email protected]>,
  23. [email protected], [email protected],
  24. Matthias Brugger <[email protected]>, Zhang Rui <[email protected]>,
  25. [email protected],
  26. AngeloGioacchino Del Regno <[email protected]>
  27. Sender: "Linux-mediatek" <[email protected]>
  28. From: Frank Wunderlich <[email protected]>
  29. Reading thermal sensor on mt7986 devices returns invalid temperature:
  30. bpi-r3 ~ # cat /sys/class/thermal/thermal_zone0/temp
  31. -274000
  32. Fix this by adding missing members in mtk_thermal_data struct which were
  33. used in mtk_thermal_turn_on_buffer after commit 33140e668b10.
  34. Cc: [email protected]
  35. Fixes: 33140e668b10 ("thermal/drivers/mediatek: Control buffer enablement tweaks")
  36. Signed-off-by: Frank Wunderlich <[email protected]>
  37. Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
  38. Reviewed-by: Markus Schneider-Pargmann <[email protected]>
  39. ---
  40. drivers/thermal/mediatek/auxadc_thermal.c | 3 +++
  41. 1 file changed, 3 insertions(+)
  42. --- a/drivers/thermal/mediatek/auxadc_thermal.c
  43. +++ b/drivers/thermal/mediatek/auxadc_thermal.c
  44. @@ -690,6 +690,9 @@ static const struct mtk_thermal_data mt7
  45. .adcpnp = mt7986_adcpnp,
  46. .sensor_mux_values = mt7986_mux_values,
  47. .version = MTK_THERMAL_V3,
  48. + .apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON1,
  49. + .apmixed_buffer_ctl_mask = GENMASK(31, 6) | BIT(3),
  50. + .apmixed_buffer_ctl_set = BIT(0),
  51. };
  52. static bool mtk_thermal_temp_is_valid(int temp)