Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1256538
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Rob Herring <robh+dt@kernel.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 07/10] pwm: gpio: Add a generic gpio based PWM driver |
| Date | Tue, 27 Oct 2015 08:50:02 +0100 |
| Message-ID | <qo7b4-2rZ-11@gated-at.bofh.it> (permalink) |
| References | <qnXEJ-4YZ-3@gated-at.bofh.it> <qnXEJ-4YZ-11@gated-at.bofh.it> |
| X-Original-To | Olliver Schinagl <o.schinagl@ultimaker.com> |
| X-Received | by 10.129.53.12 with SMTP id c12mr32386074ywa.150.1445931787998; Tue, 27 Oct 2015 00:43:07 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 78 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Olliver Schinagl <oliver@schinagl.nl>, Thierry Reding <thierry.reding@gmail.com>, Pawel Moll <pawel.moll@arm.com>, Mark Rutland <mark.rutland@arm.com>, Ian Campbell <ijc+devicetree@hellion.org.uk>, Kumar Gala <galak@codeaurora.org>, Joachim Eastwood <manabian@gmail.com>, Maxime Ripard <maxime.ripard@free-electrons.com>, Alexandre Belloni <alexandre.belloni@free-electrons.com>, Olliver Schinagl <oliver+list@schinagl.nl>, Linux PWM List <linux-pwm@vger.kernel.org>, "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org> |
| X-Original-Date | Tue, 27 Oct 2015 02:42:48 -0500 |
| X-Original-Message-ID | <CAL_Jsq+98bBt5-+Of-u6jCdGBiZfMvL=P=mMpvWT26qnPFMz5A@mail.gmail.com> |
| X-Original-References | <1445895161-2317-1-git-send-email-o.schinagl@ultimaker.com> <1445895161-2317-8-git-send-email-o.schinagl@ultimaker.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1256538 |
Show key headers only | View raw
On Mon, Oct 26, 2015 at 4:32 PM, Olliver Schinagl
<o.schinagl@ultimaker.com> wrote:
> 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.
>
> Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
> ---
> Documentation/devicetree/bindings/pwm/pwm-gpio.txt | 18 ++
> MAINTAINERS | 5 +
> drivers/pwm/Kconfig | 15 ++
> drivers/pwm/Makefile | 1 +
> drivers/pwm/pwm-gpio.c | 253 +++++++++++++++++++++
> 5 files changed, 292 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/pwm/pwm-gpio.txt
> create mode 100644 drivers/pwm/pwm-gpio.c
>
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-gpio.txt b/Documentation/devicetree/bindings/pwm/pwm-gpio.txt
> new file mode 100644
> index 0000000..336f61f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pwm/pwm-gpio.txt
> @@ -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.
I'm not sure there is really much advantage to having multiple gpios
per node. It would simplify the driver a bit not to, but I don't feel
strongly either way.
> +
> +Example:
> +#include <dt-bindings/gpio/gpio.h>
> +
> + pwm: pwm@0 {
Unit address should be associated with a reg property, so drop it.
> + compatible = "pwm-gpio";
> + #pwm-cells = 3;
> + pwm-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>;
> + pwm-gpios = <&pio 7 2 GPIO_ACTIVE_LOW>;
This would not actually compile. You can't have 2 properties of the same name.
> + };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7ba7ab7..0ae7fbf 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -4555,6 +4555,11 @@ F: drivers/i2c/muxes/i2c-mux-gpio.c
> F: include/linux/i2c-mux-gpio.h
> F: Documentation/i2c/muxes/i2c-mux-gpio
>
> +GENERIC GPIO PWM DRIVER
> +M: Olliver Schinagl <oliver@schinagl.nl>
> +S: Maintained
> +F: drivers/pwm/pwm-gpio.c
Can you add the binding doc too.
Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 07/10] pwm: gpio: Add a generic gpio based PWM driver Olliver Schinagl <o.schinagl@ultimaker.com> - 2015-10-26 22:40 +0100
Re: [PATCH 07/10] pwm: gpio: Add a generic gpio based PWM driver Rob Herring <robh+dt@kernel.org> - 2015-10-27 08:50 +0100
Re: [PATCH 07/10] pwm: gpio: Add a generic gpio based PWM driver Olliver Schinagl <o.schinagl@ultimaker.com> - 2015-10-27 10:00 +0100
csiph-web