[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220711062330.4923-1-nikita@trvn.ru>
Date: Mon, 11 Jul 2022 11:23:28 +0500
From: Nikita Travkin <nikita@...n.ru>
To: thierry.reding@...il.com, lee.jones@...aro.org
Cc: u.kleine-koenig@...gutronix.de, robh+dt@...nel.org,
sboyd@...nel.org, krzk@...nel.org, linus.walleij@...aro.org,
masneyb@...tation.org, linux-pwm@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
~postmarketos/upstreaming@...ts.sr.ht,
Nikita Travkin <nikita@...n.ru>
Subject: [PATCH v8 0/2] Clock based PWM output driver
This series introduces an "adapter" driver that allows PWM consumers
to control clock outputs with duty-cycle control.
Some platforms (e.g. some Qualcomm chipsets) have "General Purpose"
clocks that can be muxed to GPIO outputs and used as PWM outputs.
Those outputs may be connected to various peripherals such as
leds in display backlight or haptic feedback motor driver.
To avoid re-implementing every single PWM consumer driver with clk
support (like in [1]) and don't put the burden of providing the PWM
sources on the clock drivers (as was proposed in [2]), clk based
pwm controller driver is introduced.
There is an existing driver that provides the opposite function
in drivers/clk/clk-pwm.c with a compatible "pwm-clock" so the new
driver uses the opposite naming scheme: drivers/pwm/pwm-clk.c
and compatible "clk-pwm".
Changes in v2:
- Fix filename in the DT schema.
- Address Uwe's review comments.
Changes in v3:
- Fix node pattern in the core pwm schema.
- Address Uwe's review comments.
Changes in v4:
- Drop the (incorrect) pwm schema change.
- Use generic node name in the dt bindings example.
Changes in v5:
- Correct required properties.
- add missed returns.
Changes in v6:
- Add missed error cleanup
- Adjust limitations comment
Changes in v7:
- Rename some variables to be in line with common naming
Changes in v8:
- Document the glitch that happens inbetween multiple clock operations
Nikita Travkin (2):
dt-bindings: pwm: Document clk based PWM controller
pwm: Add clock based PWM output driver
.../devicetree/bindings/pwm/clk-pwm.yaml | 46 ++++++
drivers/pwm/Kconfig | 10 ++
drivers/pwm/Makefile | 1 +
drivers/pwm/pwm-clk.c | 148 ++++++++++++++++++
4 files changed, 205 insertions(+)
create mode 100644 Documentation/devicetree/bindings/pwm/clk-pwm.yaml
create mode 100644 drivers/pwm/pwm-clk.c
--
2.35.3
Powered by blists - more mailing lists