Commit 6de6868
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>1 parent 0b3c04c commit 6de6868
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
563 | 564 | | |
564 | 565 | | |
565 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
566 | 571 | | |
567 | 572 | | |
568 | 573 | | |
| |||
573 | 578 | | |
574 | 579 | | |
575 | 580 | | |
| 581 | + | |
576 | 582 | | |
577 | 583 | | |
578 | 584 | | |
| |||
586 | 592 | | |
587 | 593 | | |
588 | 594 | | |
| 595 | + | |
| 596 | + | |
589 | 597 | | |
590 | 598 | | |
591 | 599 | | |
| |||
639 | 647 | | |
640 | 648 | | |
641 | 649 | | |
642 | | - | |
643 | | - | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
644 | 656 | | |
645 | 657 | | |
646 | 658 | | |
| |||
0 commit comments