pwm: gpio: Add a generic gpio based PWM driver

From: Olliver Schinagl <oliver@schinagl.nl>

This patch adds a bit-banging gpio PWM driver. It makes use of hrtimers,
to allow nano-second resolution, though it obviously strongly depends on
the switching speed of the gpio pins, hrtimer and system load.

Each pwm node can have 1 or more "pwm-gpio" entries, which will be
treated as pwm's as part of a pwm chip.

Change-Id: Idd42bf6d79f8ce52275a15965b02af470f28da7c
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
This commit is contained in:
Kevin Kim
2019-01-16 14:45:10 +09:00
committed by Dongjin Kim
parent 9a732e55bc
commit 620bc954fc
5 changed files with 293 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
Generic GPIO bit-banged PWM driver
Required properties:
- compatible: should be "pwm-gpio"
- #pwm-cells: should be 3, see pwm.txt in this directory for a general
description of the cells format.
- pwm-gpios: one or more gpios 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-cells = 3;
pwm-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>;
pwm-gpios = <&pio 7 2 GPIO_ACTIVE_LOW>;
};