devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V4 0/2] pwm: Add GPIO PWM driver
@ 2024-02-04 22:08 Stefan Wahren
  2024-02-04 22:08 ` [PATCH V4 1/2] dt-bindings: pwm: Add pwm-gpio Stefan Wahren
                   ` (4 more replies)
  0 siblings, 5 replies; 28+ messages in thread
From: Stefan Wahren @ 2024-02-04 22:08 UTC (permalink / raw)
  To: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: andy.shevchenko, Angelo Compagnucci, Philip Howard, Sean Young,
	Linus Walleij, linux-pwm, devicetree, linux-gpio, Stefan Wahren

Add a software PWM which toggles a GPIO from a high-resolution timer.

Recent discussions in the Raspberry Pi community revealt that a lot
of users still use MMIO userspace tools for GPIO access. One argument
for this approach is the lack of a GPIO PWM kernel driver. So this
series tries to fill this gap.

This continues the work of Vincent Whitchurch [1], which is easier
to read and more consequent by rejecting sleeping GPIOs than Nicola's
approach [2].

The work has been tested on a Raspberry Pi 3 B+ and a cheap logic
analyzer.

V4:
 - address DT bindings comments from Conor Dooley
 - drop unnecessary MODULE_ALIAS() as suggested by Krzysztof Kozlowski
 - add range checks to apply which consider the hrtimer resolution
   (idea comes from Sean Young)
 - mark driver as atomic as suggested by Sean Young

V3:
 - rebase on top of v6.8-pwm-next
 - cherry-pick improvements from Nicola's series
 - try to address Uwe's, Linus' and Andy's comments
 - try to avoid GPIO glitches during probe
 - fix pwm_gpio_remove()
 - some code clean up's and comments

V2:
 - Rename gpio to gpios in binding
 - Calculate next expiry from expected current expiry rather than "now"
 - Only change configuration after current period ends
 - Implement get_state()
 - Add error message for probe failures
 - Stop PWM before unregister

[1] - https://lore.kernel.org/all/20200915135445.al75xmjxudj2rgcp@axis.com/T/
[2] - https://lore.kernel.org/all/20201205214353.xapax46tt5snzd2v@einstein.dilieto.eu/

Nicola Di Lieto (1):
  dt-bindings: pwm: Add pwm-gpio

Vincent Whitchurch (1):
  pwm: Add GPIO PWM driver

 .../devicetree/bindings/pwm/pwm-gpio.yaml     |  42 ++++
 drivers/pwm/Kconfig                           |  11 +
 drivers/pwm/Makefile                          |   1 +
 drivers/pwm/pwm-gpio.c                        | 228 ++++++++++++++++++
 4 files changed, 282 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/pwm-gpio.yaml
 create mode 100644 drivers/pwm/pwm-gpio.c

--
2.34.1


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

end of thread, other threads:[~2024-05-27  9:56 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04 22:08 [PATCH V4 0/2] pwm: Add GPIO PWM driver Stefan Wahren
2024-02-04 22:08 ` [PATCH V4 1/2] dt-bindings: pwm: Add pwm-gpio Stefan Wahren
2024-02-04 22:47   ` Linus Walleij
2024-02-05  5:58   ` Dhruva Gole
2024-02-05  7:44   ` Krzysztof Kozlowski
2024-02-05  9:15   ` Uwe Kleine-König
2024-02-05 11:58     ` Stefan Wahren
2024-02-04 22:08 ` [PATCH V4 2/2] pwm: Add GPIO PWM driver Stefan Wahren
2024-02-04 22:50   ` Linus Walleij
2024-02-05  6:11   ` Dhruva Gole
2024-02-05  7:16     ` Stefan Wahren
2024-02-05 10:09   ` Uwe Kleine-König
2024-02-05 12:21     ` Stefan Wahren
2024-02-27 15:32   ` Chris Morgan
2024-02-27 16:59     ` Stefan Wahren
2024-02-28 12:43       ` Phil Howard
2024-02-29  8:45       ` Sean Young
2024-02-29  8:57         ` Sean Young
2024-02-27 16:41   ` Andy Shevchenko
2024-02-27 20:24     ` Stefan Wahren
2024-02-27 20:47       ` Andy Shevchenko
2024-02-28 18:06         ` Stefan Wahren
2024-02-05  5:55 ` [PATCH V4 0/2] " Dhruva Gole
2024-02-05  7:08   ` Stefan Wahren
2024-02-05 13:06 ` Phil Howard
2024-05-27  8:22 ` Linus Walleij
2024-05-27  8:44   ` Stefan Wahren
2024-05-27  9:56     ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).