pwm: pwm-gpio: Generic GPIO bit-banged PWM driver
Subsystems (2)
PATCH 1/1 pwm: pwm-gpio: Generic GPIO bit-banged PWM driver
This patch adds a driver to generate a PWM signal on a generic GPIO pin. Driver can use hrtimers when available to allow nano-second resolution, the precision of the resulting signal depends on the switching speed of the gpio pins, timers and the system load.
--- .../devicetree/bindings/pwm/pwm-gpio.txt | 14 + drivers/pwm/Kconfig | 10 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-gpio.c | 244 ++++++++++++++++++ 4 files changed, 269 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/pwm-gpio.txt create mode 100644 drivers/pwm/pwm-gpio.c
Documentation/devicetree/bindings/pwm/pwm-gpio.txt new file +14 -0
@@ -0,0 +1,14 @@ +Generic GPIO bit-banged PWM driver + +Required properties: + - compatible: should be "pwm-gpio" + - pwm-gpio: gpio describing the used gpio, see the gpio + bindings for the used gpio driver. + +Example: +#include <dt-bindings/gpio/gpio.h> + + pwm: pwm@0 { + compatible = "pwm-gpio"; + pwm-gpio = <&pio 7 1 GPIO_ACTIVE_LOW>; + };
drivers/pwm/Kconfig +10 -0
@@ -195,6 +195,16 @@ config PWM_FSL_FTM To compile this driver as a module, choose M here: the module will be called pwm-fsl-ftm. +config PWM_GPIO + tristate "Generic GPIO bit-banged PWM support" + depends on GPIOLIB + depends on PWM + help + Driver to generate soft PWM on GPIO pin. + + To compile this driver as a module, choose M here: the module + will be called pwm-gpio. + config PWM_HIBVT tristate "HiSilicon BVT PWM support" depends on ARCH_HISI || COMPILE_TEST
drivers/pwm/Makefile +1 -0
@@ -16,6 +16,7 @@ obj-$(CONFIG_PWM_CROS_EC) += pwm-cros-ec.o obj-$(CONFIG_PWM_DWC) += pwm-dwc.o obj-$(CONFIG_PWM_EP93XX) += pwm-ep93xx.o obj-$(CONFIG_PWM_FSL_FTM) += pwm-fsl-ftm.o +obj-$(CONFIG_PWM_GPIO) += pwm-gpio.o obj-$(CONFIG_PWM_HIBVT) += pwm-hibvt.o obj-$(CONFIG_PWM_IMG) += pwm-img.o obj-$(CONFIG_PWM_IMX1) += pwm-imx1.o
drivers/pwm/pwm-gpio.c new file +244 -0
244 lines not on this page · raw message
Signature · 1 line
2.25.1
Hello,
there are currently two patches with the same goal ready for review on the linux-pwm list:
- https://lore.kernel.org/r/[email protected]
- https://lore.kernel.org/r/[email protected]
(i.e. this one)
In my eyes the former is the better one, so @Angelo: Maybe you can join forces with Nicola and work on his patch set.
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Rob Herring
maintainerQuoted 6 lines · Uwe Kleine-König
Hello,
there are currently two patches with the same goal ready for review on the linux-pwm list:
Quoted 6 lines
- https://lore.kernel.org/r/[email protected]
- https://lore.kernel.org/r/[email protected](i.e. this one)In my eyes the former is the better one, so @Angelo: Maybe you can join forces with Nicola and work on his patch set.
Neither one went to DT list, so they're not in my queue. Though v1 of Nicola's did go to the list.
Rob
Rob Herring
maintainerQuoted 13 lines · Rob Herring
Quoted 10 lines · Uwe Kleine-König
Hello,
there are currently two patches with the same goal ready for review on the linux-pwm list:
- https://lore.kernel.org/r/[email protected]
- https://lore.kernel.org/r/[email protected](i.e. this one)
Quoted 5 lines
Quoted 2 lines
In my eyes the former is the better one, so @Angelo: Maybe you can join forces with Nicola and work on his patch set.
Neither one went to DT list, so they're not in my queue. Though v1 of Nicola's did go to the list.
And there's a 3rd one from Vincent that I already reviewed:
https://lore.kernel.org/linux-devicetree/[email protected]/
And one from 5 years ago...:
Quoted 7 lines · Rob Herring
And there's a 3rd one from Vincent that I already reviewed:
https://lore.kernel.org/linux-devicetree/[email protected]/
And one from 5 years ago...:
These 4 patches are in my opinion a clear indication that such a driver is needed and useful. I hope it won't take that long to have at least one merged upstream. You guys just have to choose which one...
Regards,
Nicola