[hwmon-next PATCH v5 0/4] hwmon: (adt7470) Add PWM provider and thermal sensor support
Luiz Angelo Daros de Luca <[email protected]> Thu, 30 Jul 2026 18:29:55 -0300
| Newsgroups | org.kernel.vger.linux-pwm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-hwmon,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
The ADT7470 is a temperature monitor and PWM fan controller capable of monitoring up to ten external temperature sensors and controlling up to four PWM outputs. Currently, the driver exposes these sensors and PWM controls only through the hwmon sysfs interface. This patch series integrates the ADT7470 driver with the kernel's thermal and PWM subsystems. This allows temperature sensors to participate in Device Tree thermal zones while exposing the PWM outputs as generic PWM providers for consumers such as pwm-fan. Patch 1 adds the YAML device tree binding documentation. Patch 2 introduces the ADT7470_PWM_MAX macro. Patch 3 registers the four PWM channels as a generic PWM provider. Patch 4 registers the external temperature sensors with the thermal framework. Signed-off-by: Luiz Angelo Daros de Luca <[email protected]> --- Changes in v5: - Hide hwmon PWM sysfs attributes if "#pwm-cells" is present in DT. - Register PWM chip before hwmon in probe() to correctly initialize sysfs visibility. - Fix waveform rounding math to strictly satisfying CONFIG_PWM_DEBUG expectations. - Return 1 in round_waveform_tohw when the requested period is too short for the hardware. - Link to v4: https://patch.msgid.link/[email protected] Changes in v4: - dt-bindings: Dropped redundant descriptions for standard properties (#pwm-cells and #thermal-sensor-cells). - dt-bindings: Conditionally referenced thermal-sensor.yaml to preserve ABI compatibility. - dt-bindings: Switched to unevaluatedProperties due to the imported $ref. - Link to v3: https://patch.msgid.link/[email protected] Changes in v3: - Migrated from the `.apply` callback to the PWM Waveform API. - Moved fixes to another patch series: [email protected] - Use guard(mutex) for simpler locking. - Link to v2: https://patch.msgid.link/[email protected] Changes in v2: - Fixed 2 previous bugs uncovered by Sashiko-bot during review. - Dropped the thermal cooling device registration for the PWM channels. - Implemented generic PWM provider support using the PWM subsystem. - Updated Kconfig to safely handle the PWM subsystem dependency (depends on PWM || PWM=n). - Updated Device Tree bindings to require #pwm-cells instead of #cooling-cells. - Link to v1: https://patch.msgid.link/[email protected] To: Guenter Roeck <[email protected]> To: Rob Herring <[email protected]> To: Krzysztof Kozlowski <[email protected]> To: Conor Dooley <[email protected]> To: Luiz Angelo Daros de Luca <[email protected]> To: Chris Packham <[email protected]> To: Andrew Morton <[email protected]> To: "Darrick J. Wong" <[email protected]> To: Uwe Kleine-König <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] --- Luiz Angelo Daros de Luca (4): dt-bindings: hwmon: add adi,adt7470 hwmon: (adt7470) Add ADT7470_PWM_MAX macro hwmon: (adt7470) Expose fan control via PWM framework hwmon: (adt7470) Add thermal zone sensor support .../devicetree/bindings/hwmon/adi,adt7470.yaml | 58 ++++++ drivers/hwmon/Kconfig | 1 + drivers/hwmon/adt7470.c | 203 ++++++++++++++++++++- 3 files changed, 258 insertions(+), 4 deletions(-) --- base-commit: 4c2e8c377915496fbe9cc1c9d91a7297aaa01783 change-id: 20260716-adt7470_thermalzone-59a102278d72 Best regards, -- Luiz Angelo Daros de Luca <[email protected]>