mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/3] hwmon: (amc6821) Add cooling device support
@ 2025-06-12 17:28 João Paulo Gonçalves
  2025-06-12 17:28 ` [PATCH v3 1/3] dt-bindings: hwmon: amc6821: Add cooling levels João Paulo Gonçalves
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: João Paulo Gonçalves @ 2025-06-12 17:28 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Farouk Bouabid, Quentin Schulz
  Cc: linux-hwmon, devicetree, linux-kernel, João Paulo Gonçalves

Add support for using the AMC6821 as a cooling device. The AMC6821
registers with the thermal framework only if the `cooling-levels`
property is present in the fan device tree child node. If this property
is present, the driver assumes the fan will operate in open-loop, and
the kernel will control it directly. In this case, the driver will
change the AMC6821 mode to manual (software DCY) and set the initial PWM
duty cycle to the maximum fan cooling state level as defined in the DT.
It is worth mentioning that the cooling device is registered on the
child fan node, not on the fan controller node. Existing behavior is
unchanged, so the AMC6821 can still be used without the thermal
framework (hwmon only).

Signed-off-by: João Paulo Gonçalves <joao.goncalves@toradex.com>
---
v3:
- Fix using fan node after of_node_put() with scope based free
- Add setting the pwm duty cycle to max fan cooling state level on
  initialization
v2: https://lore.kernel.org/lkml/20250603-b4-amc6821-cooling-device-support-v2-0-74943c889a2d@toradex.com/
- Remove devm_action on release and call of_node_put() manually
- Change of_pwm_polarity to store resulting pwm polarity on driver
  private data
v1: https://lore.kernel.org/lkml/20250530-b4-v1-amc6821-cooling-device-support-b4-v1-0-7bb98496c969@toradex.com/

---
João Paulo Gonçalves (3):
      dt-bindings: hwmon: amc6821: Add cooling levels
      hwmon: (amc6821) Move reading fan data from OF to a function
      hwmon: (amc6821) Add cooling device support

 .../devicetree/bindings/hwmon/ti,amc6821.yaml      |   6 +
 drivers/hwmon/amc6821.c                            | 130 +++++++++++++++++++--
 2 files changed, 127 insertions(+), 9 deletions(-)
---
base-commit: b43674a549ed17319cb08ede9e0909ff6198ea70
change-id: 20250602-b4-amc6821-cooling-device-support-c03b0a899357

Best regards,
-- 
João Paulo Gonçalves <joao.goncalves@toradex.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-13  4:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-12 17:28 [PATCH v3 0/3] hwmon: (amc6821) Add cooling device support João Paulo Gonçalves
2025-06-12 17:28 ` [PATCH v3 1/3] dt-bindings: hwmon: amc6821: Add cooling levels João Paulo Gonçalves
2025-06-12 17:28 ` [PATCH v3 2/3] hwmon: (amc6821) Move reading fan data from OF to a function João Paulo Gonçalves
2025-06-12 17:28 ` [PATCH v3 3/3] hwmon: (amc6821) Add cooling device support João Paulo Gonçalves
2025-06-13  4:39   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®