Re: [hwmon-next PATCH v4 3/4] hwmon: (adt7470) Expose fan control via PWM framework

From: Guenter Roeck

Date: Wed Jul 29 2026 - 16:23:53 EST


On 7/29/26 12:05, Luiz Angelo Daros de Luca wrote:
Hi Guenter, Uwe,

Thank you both for the detailed reviews. I hope I'll address all the
points discussed in the next version.

No, I won't accept this. It has to be either or. A pwm channel modeled as pwm
subsystem channel must not be visible via hwmon attributes.

I didn't look in detail, but maybe my red line is a bit more lax. IMHO
it's not OK to be able to modify a setting that results from pushing
hwmon knobs using PWM operations or vice-versa. Switching between
exclusive use at runtime is IMHO ok.

It is my call to make, and my call is either-or to avoid confusion.

Guenter, I agree and followed your strict "either-or" directive. If
the device is bound via the PWM framework (i.e., #pwm-cells is present
in the DT), the driver completely hides all legacy hwmon PWM
attributes.


Yes, that is what I am looking for, assuming it is per channel.
We do not want to unconditionally disable automatic fan control support
by the chip just because a single channel is used as generic PWM controller.

One implementation detail: currently, the driver hides the hwmon
attributes only if #pwm-cells is present and IS_REACHABLE(CONFIG_PWM)
is true. If the DTS has #pwm-cells but the PWM framework is disabled
in the kernel, it emits a dev_warn and falls back to exposing the
hwmon attributes. Please let me know if you would prefer to
unconditionally hide the hwmon attributes merely based on the presence
of the DT property, regardless of the CONFIG_PWM state.

No, that would be overkill.

Thanks,
Guenter