diff options
| author | Nylon Chen <[email protected]> | 2025-05-29 03:53:40 +0000 |
|---|---|---|
| committer | Uwe Kleine-König <[email protected]> | 2025-07-07 06:39:34 +0000 |
| commit | 7dbc4432ea6bf9d709391eb57f1e9fb44e99845a (patch) | |
| tree | 3deab3d9770eeb4960ea9b946ad4efbdaed28f2d /drivers/pwm/pwm-stm32.c | |
| parent | riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-l... (diff) | |
| download | kernel-7dbc4432ea6bf9d709391eb57f1e9fb44e99845a.tar.gz kernel-7dbc4432ea6bf9d709391eb57f1e9fb44e99845a.zip | |
pwm: sifive: Fix PWM algorithm and clarify inverted compare behavior
The `frac` variable represents the pulse inactive time, and the result
of this algorithm is the pulse active time. Therefore, we must reverse
the result.
Although the SiFive Reference Manual states "pwms >= pwmcmpX -> HIGH",
the hardware behavior is inverted due to a fixed XNOR with 0. As a result,
the pwmcmp register actually defines the low (inactive) portion of the pulse.
The reference is SiFive FU740-C000 Manual[0]
Link: https://sifive.cdn.prismic.io/sifive/1a82e600-1f93-4f41-b2d8-86ed8b16acba_fu740-c000-manual-v1p6.pdf [0]
Co-developed-by: Zong Li <[email protected]>
Signed-off-by: Zong Li <[email protected]>
Co-developed-by: Vincent Chen <[email protected]>
Signed-off-by: Vincent Chen <[email protected]>
Signed-off-by: Nylon Chen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-stm32.c')
0 files changed, 0 insertions, 0 deletions
