018-v6.5-arm64-dts-mt7986-add-pwm-fan-and-cooling-maps-to-BPI.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From 5d90603b09e5814ffc38c47e79ccf9bc564f9296 Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <[email protected]>
  3. Date: Tue, 30 May 2023 22:12:35 +0200
  4. Subject: [PATCH 18/19] arm64: dts: mt7986: add pwm-fan and cooling-maps to
  5. BPI-R3 dts
  6. Add pwm-fan and cooling-maps to BananaPi-R3 devicetree.
  7. Signed-off-by: Daniel Golle <[email protected]>
  8. Signed-off-by: Frank Wunderlich <[email protected]>
  9. Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
  10. Link: https://lore.kernel.org/r/[email protected]
  11. Signed-off-by: Matthias Brugger <[email protected]>
  12. ---
  13. .../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 31 +++++++++++++++++++
  14. 1 file changed, 31 insertions(+)
  15. --- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
  16. +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
  17. @@ -38,6 +38,15 @@
  18. regulator-always-on;
  19. };
  20. + fan: pwm-fan {
  21. + compatible = "pwm-fan";
  22. + #cooling-cells = <2>;
  23. + /* cooling level (0, 1, 2) - pwm inverted */
  24. + cooling-levels = <255 96 0>;
  25. + pwms = <&pwm 0 10000 0>;
  26. + status = "okay";
  27. + };
  28. +
  29. gpio-keys {
  30. compatible = "gpio-keys";
  31. @@ -133,6 +142,28 @@
  32. };
  33. };
  34. +&cpu_thermal {
  35. + cooling-maps {
  36. + cpu-active-high {
  37. + /* active: set fan to cooling level 2 */
  38. + cooling-device = <&fan 2 2>;
  39. + trip = <&cpu_trip_active_high>;
  40. + };
  41. +
  42. + cpu-active-low {
  43. + /* active: set fan to cooling level 1 */
  44. + cooling-device = <&fan 1 1>;
  45. + trip = <&cpu_trip_active_low>;
  46. + };
  47. +
  48. + cpu-passive {
  49. + /* passive: set fan to cooling level 0 */
  50. + cooling-device = <&fan 0 0>;
  51. + trip = <&cpu_trip_passive>;
  52. + };
  53. + };
  54. +};
  55. +
  56. &crypto {
  57. status = "okay";
  58. };