]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hwmon: (max6639) Allow setting target RPM
authorNaresh Solanki <naresh.solanki@9elements.com>
Fri, 4 Apr 2025 11:56:45 +0000 (17:26 +0530)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 23 Apr 2025 14:18:27 +0000 (07:18 -0700)
commit6de6868df18728790eb4ffe764b49f356fea7397
tree6c0ac375e974ea9449890ab5926168fba803e640
parent0b3c04c81804197bf0025f3281e4463152f04bf1
hwmon: (max6639) Allow setting target RPM

Currently, during startup, the fan is set to its maximum RPM by default,
which may not be suitable for all use cases.
This patch introduces support for specifying a target RPM via the Device
Tree property "target-rpm".

Changes:
- Added `target_rpm` field to `max6639_data` structure to store the
  target RPM for each fan channel.
- Modified `max6639_probe_child_from_dt()` to read the `"target-rpm"`
  property from the Device Tree and set `target_rpm` accordingly.
- Updated `max6639_init_client()` to use `target_rpm` to compute the
  initial PWM duty cycle instead of defaulting to full speed (120/120).

Behavior:
- If `"target-rpm"` is specified, the fan speed is set accordingly.
- If `"target-rpm"` is not specified, the previous behavior (full speed
  at startup) is retained.

This allows better control over fan speed during system initialization.

Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
Link: https://lore.kernel.org/r/20250404115646.2000563-1-you@example.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/max6639.c