[PATCH v2 0/2] pwm: Add the Ingenic X1600 PWM controller
From: Olivier Louvignes
Date: Sun Oct 25 2026 - 15:17:02 EST
The Ingenic X1600 has a PWM controller of its own, separate from the TCU
timers that pwm-jz4740 drives on the earlier Ingenic SoCs. This adds its
binding and a driver built on the waveform callbacks.
Changes in v2 (both found by the Sashiko review of v1):
- A channel that is off with both counts still loaded, as one stopped
behind the driver's back leaves it, now reads back as disabled. v1 read
it as running, so asking for the same waveform again didn't switch it
on. A channel off with one count zero is how 0 and 100% are written; the
idle level gives which.
- A clock rate of 0 is refused with -EINVAL when rounding a waveform and
when writing one, instead of switching the channel off silently or
dividing by zero in the update timeout.
Tested on a HiBy R1 (X1600), whose backlight is channel 0, through
pwm-backlight: brightness 1, 25, 50, 60 and 100% give the expected high and
low counts, 0 and 100% switch the channel off at the right idle level,
and an inversed 250 us of 1 ms on channel 1 reads back as INL 0, LOW
9375 then HIGH 28125 with the clock divided by 8. PWM_DEBUG stayed
silent. For v2 also: channel 1 running 250 us of 1 ms, switched off
through ENC directly, then requested again through sysfs, reads back as
disabled, and the same waveform asked again switches it back on; v1's
driver read it as enabled and left it off.
The X1600 has no device tree upstream yet; its support is being posted
one subsystem at a time.
v1: https://lore.kernel.org/r/20261025084643.93167-1-olivier@xxxxxxxxx
Olivier Louvignes (2):
dt-bindings: pwm: Add the Ingenic X1600 PWM controller
pwm: Add a driver for the Ingenic X1600 PWM controller
.../bindings/pwm/ingenic,x1600-pwm.yaml | 47 +++
MAINTAINERS | 6 +
drivers/pwm/Kconfig | 11 +
drivers/pwm/Makefile | 1 +
drivers/pwm/pwm-ingenic-x1600.c | 280 ++++++++++++++++++
5 files changed, 345 insertions(+)
create mode 100644 Documentation/devicetree/bindings/pwm/ingenic,x1600-pwm.yaml
create mode 100644 drivers/pwm/pwm-ingenic-x1600.c
base-commit: 00e917df050d79ac26ec700717680ad6421d2808
--
2.39.5