mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] pwm: loongson: Fix PWM configuration handling
@ 2026-07-15 11:05 Keguang Zhang via B4 Relay
  2026-07-15 11:05 ` [PATCH v3 1/2] pwm: loongson: Fix low pulse buffer register handling Keguang Zhang via B4 Relay
  2026-07-15 11:05 ` [PATCH v3 2/2] pwm: loongson: Reload PWM configuration through counter reset Keguang Zhang via B4 Relay
  0 siblings, 2 replies; 7+ messages in thread
From: Keguang Zhang via B4 Relay @ 2026-07-15 11:05 UTC (permalink / raw)
  To: Binbin Zhou, Uwe Kleine-König; +Cc: linux-pwm, linux-kernel, Keguang Zhang

This series fixes two issues in the Loongson PWM driver:

- Fix the handling of the Low Pulse Buffer Register, which was
  incorrectly treated as a duty-cycle register.

- Reset the PWM counter when disabling the PWM and release it when
  enabling the PWM so that updated LOW and PERIOD values are latched
  before the PWM starts running again.

The fixes were verified on LS1B, LS1C, and LS2K0300 boards.

Signed-off-by: Keguang Zhang <keguang.zhang@gmail.com>
---
Changes in v3:
- Calculate the low pulse as period - duty after rounding the duty cycle.
- Handle LOW > PERIOD in pwm_loongson_get_state().
- Add a Fixes tag to the second patch.
- Link to v2: https://lore.kernel.org/r/20260626-pwm-loongson-fix-v2-0-5492db953879@gmail.com

Changes in v2:
- Drop the -ERANGE return change and restore the original behavior.
- Use mul_u64_u64_div_u64_roundup() to calculate the low pulse width.
- Update the commit message accordingly.
- Link to v1: https://lore.kernel.org/r/20260616-pwm-loongson-fix-v1-0-491dbf260a7f@gmail.com

---
Keguang Zhang (2):
      pwm: loongson: Fix low pulse buffer register handling
      pwm: loongson: Reload PWM configuration through counter reset

 drivers/pwm/pwm-loongson.c | 40 ++++++++++++++++++++++++++--------------
 1 file changed, 26 insertions(+), 14 deletions(-)
---
base-commit: cc2b5f627e8ccbae1188ef2d8be3e451d7f933a5
change-id: 20260612-pwm-loongson-fix-183763451e93

Best regards,
-- 
Keguang Zhang <keguang.zhang@gmail.com>



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-10 13:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-15 11:05 [PATCH v3 0/2] pwm: loongson: Fix PWM configuration handling Keguang Zhang via B4 Relay
2026-07-15 11:05 ` [PATCH v3 1/2] pwm: loongson: Fix low pulse buffer register handling Keguang Zhang via B4 Relay
2026-09-07  9:18   ` Uwe Kleine-König
2026-07-15 11:05 ` [PATCH v3 2/2] pwm: loongson: Reload PWM configuration through counter reset Keguang Zhang via B4 Relay
2026-09-07  9:33   ` Uwe Kleine-König
2026-09-10 11:58     ` Keguang Zhang
2026-09-10 13:54       ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®