public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Clock based PWM output driver
@ 2021-12-09 16:20 Nikita Travkin
  2021-12-09 16:20 ` [PATCH 1/2] dt-bindings: pwm: Document clk based PWM controller Nikita Travkin
  2021-12-09 16:20 ` [PATCH 2/2] pwm: Add clock based PWM output driver Nikita Travkin
  0 siblings, 2 replies; 7+ messages in thread
From: Nikita Travkin @ 2021-12-09 16:20 UTC (permalink / raw)
  To: thierry.reding, lee.jones
  Cc: u.kleine-koenig, robh+dt, sboyd, linus.walleij, masneyb,
	linux-pwm, devicetree, linux-kernel, ~postmarketos/upstreaming,
	Nikita Travkin

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". 

[1] - https://lore.kernel.org/lkml/20191205002503.13088-1-masneyb@onstation.org/
[2] - https://lore.kernel.org/lkml/CACRpkdZxu1LfK11OHEx5L_4kyjMZ7qERpvDzFj5u3Pk2kD1qRA@mail.gmail.com/

Nikita Travkin (2):
  dt-bindings: pwm: Document clk based PWM controller
  pwm: Add clock based PWM output driver

 .../devicetree/bindings/pwm/clk-pwm.yaml      |  45 +++++++
 drivers/pwm/Kconfig                           |  10 ++
 drivers/pwm/Makefile                          |   1 +
 drivers/pwm/pwm-clk.c                         | 119 ++++++++++++++++++
 4 files changed, 175 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/clk-pwm.yaml
 create mode 100644 drivers/pwm/pwm-clk.c

-- 
2.30.2


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

end of thread, other threads:[~2021-12-11 16:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-09 16:20 [PATCH 0/2] Clock based PWM output driver Nikita Travkin
2021-12-09 16:20 ` [PATCH 1/2] dt-bindings: pwm: Document clk based PWM controller Nikita Travkin
2021-12-09 20:55   ` Rob Herring
2021-12-09 16:20 ` [PATCH 2/2] pwm: Add clock based PWM output driver Nikita Travkin
2021-12-09 22:05   ` Uwe Kleine-König
2021-12-10 13:13     ` Nikita Travkin
2021-12-11 16:33       ` 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