[PW_SID:955622] Change PWM-controlled LED pin active mode and algorithm#326
[PW_SID:955622] Change PWM-controlled LED pin active mode and algorithm#326linux-riscv-bot wants to merge 5 commits into
Conversation
…active-low properties This removes the active-low properties of the PWM-controlled LEDs in the HiFive Unmatched device tree. The reference is hifive-unleashed-a00.pdf[0] and hifive-unmatched-schematics-v3.pdf[1]. Link: https://sifive.cdn.prismic.io/sifive/c52a8e32-05ce-4aaf-95c8-7bf8453f8698_hifive-unleashed-a00-schematics-1.pdf [0] Link: https://sifive.cdn.prismic.io/sifive/6a06d6c0-6e66-49b5-8e9e-e68ce76f4192_hifive-unmatched-schematics-v3.pdf [1] Acked-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Vincent Chen <vincent.chen@sifive.com> Signed-off-by: Nylon Chen <nylon.chen@sifive.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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. 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 <zong.li@sifive.com> Signed-off-by: Zong Li <zong.li@sifive.com> Co-developed-by: Vincent Chen <vincent.chen@sifive.com> Signed-off-by: Vincent Chen <vincent.chen@sifive.com> Signed-off-by: Nylon Chen <nylon.chen@sifive.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…y_state_debug function Round the result to the nearest whole number. This ensures that real_period is always a reasonable integer that is not lower than the actual value. e.g. $ echo 110 > /sys/devices/platform/led-controller-1/leds/d12/brightness $ .apply is not idempotent (ena=1 pol=0 1739692/4032985) -> (ena=1 pol=0 1739630/4032985) Co-developed-by: Zong Li <zong.li@sifive.com> Signed-off-by: Zong Li <zong.li@sifive.com> Signed-off-by: Nylon Chen <nylon.chen@sifive.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Fix PWM apply and get_state rounding to ensure consistency between setting and reading values This fixes the reported errors: pwm-sifive 10021000.pwm: .apply is supposed to round down duty_cycle (requested: 360/504000, applied: 361/504124) pwm-sifive 10021000.pwm: .apply is supposed to round down period (requested: 504000, applied: 504124) Co-developed-by: Zong Li <zong.li@sifive.com> Signed-off-by: Zong Li <zong.li@sifive.com> Signed-off-by: Nylon Chen <nylon.chen@sifive.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The reference manual says "pwms >= pwmcmpX -> HIGH", but in Figure 29 pwmcmpXcenter is forced to 0 via an XOR, so hardware actually outputs HIGH when pwms < pwmcmpX. Thus pwmcmp holds the off-period count, and the driver must invert it to expose a normal active-high interface. Co-developed-by: Zong Li <zong.li@sifive.com> Signed-off-by: Zong Li <zong.li@sifive.com> Signed-off-by: Nylon Chen <nylon.chen@sifive.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 1: "[v12,1/5] riscv: dts: sifive: unleashed/unmatched: Remove PWM controlled LED's active-low properties" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 2: "[v12,2/5] pwm: sifive: change the PWM algorithm" |
|
Patch 3: "[v12,3/5] pwm: sifive: Fix the error in the idempotent test within the pwm_apply_state_debug function" |
|
Patch 3: "[v12,3/5] pwm: sifive: Fix the error in the idempotent test within the pwm_apply_state_debug function" |
|
Patch 3: "[v12,3/5] pwm: sifive: Fix the error in the idempotent test within the pwm_apply_state_debug function" |
|
Patch 3: "[v12,3/5] pwm: sifive: Fix the error in the idempotent test within the pwm_apply_state_debug function" |
|
Patch 3: "[v12,3/5] pwm: sifive: Fix the error in the idempotent test within the pwm_apply_state_debug function" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 4: "[v12,4/5] pwm: sifive: Fix rounding issues in apply and get_state functions" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
|
Patch 5: "[v12,5/5] pwm: sifive: clarify inverted compare logic in comments" |
PR for series 955622 applied to workflow__riscv__fixes
Name: Change PWM-controlled LED pin active mode and algorithm
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=955622
Version: 12