devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: thierry.reding@gmail.com, mark.rutland@arm.com,
	linux@armlinux.org.uk, daniel@zonque.org,
	haojian.zhuang@gmail.com, robert.jarzmik@free.fr, corbet@lwn.net,
	nicolas.ferre@microchip.com,
	alexandre.belloni@free-electrons.com, linux-pwm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	linux-rpi-kernel@lists.infradead.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 11/16] pwm: add documentation for PWM modes
Date: Fri, 19 Jan 2018 16:39:08 -0600	[thread overview]
Message-ID: <20180119223908.b3dxdx53nzuhakzw@rob-hp-laptop> (raw)
In-Reply-To: <1515766983-15151-12-git-send-email-claudiu.beznea@microchip.com>

On Fri, Jan 12, 2018 at 04:22:58PM +0200, Claudiu Beznea wrote:
> Add documentation for PWM normal and complementary modes.

This and the previous patch can be combined.

> 
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
>  Documentation/devicetree/bindings/pwm/pwm.txt | 17 ++++++++++++++--
>  Documentation/pwm.txt                         | 29 +++++++++++++++++++++++++--
>  2 files changed, 42 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/pwm/pwm.txt b/Documentation/devicetree/bindings/pwm/pwm.txt
> index 8556263b8502..fdff25bad1db 100644
> --- a/Documentation/devicetree/bindings/pwm/pwm.txt
> +++ b/Documentation/devicetree/bindings/pwm/pwm.txt
> @@ -43,8 +43,8 @@ because the name "backlight" would be used as fallback anyway.
>  pwm-specifier typically encodes the chip-relative PWM number and the PWM
>  period in nanoseconds.
>  
> -Optionally, the pwm-specifier can encode a number of flags (defined in
> -<dt-bindings/pwm/pwm.h>) in a third cell:
> +Optionally, the pwm-specifier can encode:
> +1. a number of flags (defined in <dt-bindings/pwm/pwm.h>) in a third cell:

Based on the prior patches, "third cell" is probably to restrictive 
here and it should just say "in a flags cell".

>  - PWM_POLARITY_INVERTED: invert the PWM signal polarity
>  
>  Example with optional PWM specifier for inverse polarity
> @@ -54,6 +54,19 @@ Example with optional PWM specifier for inverse polarity
>  		pwm-names = "backlight";
>  	};
>  
> +2. PWM working modes (defined in <dt-bindings/pwm/pwm.h>) in the 4th cell:
> +- PWM_MODE_NORMAL: for all PWM controllers
> +- PWM_MODE_COMPLEMENTARY: for PWM controllers with more than one output per
> +PWM channel
> +
> +Example with PWM modes:
> +
> +	bl: blacklight {
> +		pwms = <&pwm 0 5000000 PWM_POLARITY_INVERTED
> +			PWM_DTMODE_NORMAL | PWM_DTMODE_COMPLEMENTARY>;
> +		pwm-names = "backlight";
> +	};
> +
>  2) PWM controller nodes
>  -----------------------
>  
> diff --git a/Documentation/pwm.txt b/Documentation/pwm.txt
> index 8fbf0aa3ba2d..58c9bd55f021 100644
> --- a/Documentation/pwm.txt
> +++ b/Documentation/pwm.txt
> @@ -61,8 +61,8 @@ In addition to the PWM state, the PWM API also exposes PWM arguments, which
>  are the reference PWM config one should use on this PWM.
>  PWM arguments are usually platform-specific and allows the PWM user to only
>  care about dutycycle relatively to the full period (like, duty = 50% of the
> -period). struct pwm_args contains 2 fields (period and polarity) and should
> -be used to set the initial PWM config (usually done in the probe function
> +period). struct pwm_args contains 3 fields (period, polarity and mode) and
> +should be used to set the initial PWM config (usually done in the probe function
>  of the PWM user). PWM arguments are retrieved with pwm_get_args().
>  
>  Using PWMs with the sysfs interface
> @@ -83,6 +83,9 @@ will find:
>    unexport
>     Unexports a PWM channel from sysfs (write-only).
>  
> +  mode
> +   PWM chip supported modes.
> +
>  The PWM channels are numbered using a per-chip index from 0 to npwm-1.
>  
>  When a PWM channel is exported a pwmX directory will be created in the
> @@ -110,6 +113,28 @@ channel that was exported. The following properties will then be available:
>  	- 0 - disabled
>  	- 1 - enabled
>  
> +  mode
> +    Set PWM channel working mode (normal and complementary). PWM chip with
> +    complementary mode could also work in normal mode by using only one physical
> +    output.
> +
> +    Normal mode - for PWM chips with one output per PWM channel; output
> +        waveforms looks like this:
> +             __    __    __    __
> +    PWM   __|  |__|  |__|  |__|  |__
> +            <--T-->
> +
> +    Complementary mode - for PWM chips with more than one output per PWM
> +        channel; output waveforms for a PWM controller with 2 outputs per PWM
> +        channel looks line this:
> +             __    __    __    __
> +    PWMH1 __|  |__|  |__|  |__|  |__
> +          __    __    __    __    __
> +    PWML1   |__|  |__|  |__|  |__|
> +            <--T-->
> +
> +    Where T is the signal period.
> +
>  Implementing a PWM driver
>  -------------------------
>  
> -- 
> 2.7.4
> 

  reply	other threads:[~2018-01-19 22:39 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 14:22 [PATCH v2 00/16] extend PWM framework to support PWM modes Claudiu Beznea
2018-01-12 14:22 ` [PATCH v2 01/16] drivers: pwm: core: use a single of xlate function Claudiu Beznea
     [not found]   ` <1515766983-15151-2-git-send-email-claudiu.beznea-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org>
2018-01-12 18:35     ` Brian Norris
     [not found]       ` <20180112183512.GB102880-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2018-01-15  8:41         ` Claudiu Beznea
2018-01-15 12:43           ` Claudiu Beznea
2018-01-15 20:27           ` Andy Shevchenko
     [not found]             ` <CAHp75VcaFDEQ1cBzeU2eBj_vf19ok6EWLC07SOTQLRH8BQSbzA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-16  8:24               ` Claudiu Beznea
2018-01-17 23:14                 ` Brian Norris
2018-01-18  9:11                   ` Claudiu Beznea
2018-01-16  9:07   ` Neil Armstrong
2018-01-16  9:33     ` Claudiu Beznea
2018-01-12 14:22 ` [PATCH v2 02/16] pwm: pxa: update documentation regarding pwm-cells Claudiu Beznea
2018-01-19 22:30   ` Rob Herring
2018-01-22  8:47     ` Claudiu Beznea
2018-01-12 14:22 ` [PATCH v2 04/16] pwm: clps711x: " Claudiu Beznea
2018-01-12 14:22 ` [PATCH v2 05/16] ARM: dts: clps711x: update pwm-cells Claudiu Beznea
2018-01-12 14:22 ` [PATCH v2 07/16] arm64: dts: rockchip: " Claudiu Beznea
2018-01-12 14:22 ` [PATCH v2 08/16] drivers: pwm: core: extend PWM framework with PWM modes Claudiu Beznea
2018-01-12 14:22 ` [PATCH v2 10/16] pwm: Add " Claudiu Beznea
2018-01-19 22:34   ` Rob Herring
2018-01-22  8:54     ` Claudiu Beznea
     [not found]       ` <c5aeb8df-6aa8-cde4-9305-08777cac2f45-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org>
2018-01-22 18:12         ` Rob Herring
     [not found]           ` <CAL_JsqJho2OrdnHwRPpYsbNB4RFTq5qSLA=36D2zy=Mi7B8XwQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-23 10:40             ` Claudiu Beznea
2018-01-23 15:21               ` Rob Herring
2018-01-23 16:55                 ` Claudiu Beznea
     [not found] ` <1515766983-15151-1-git-send-email-claudiu.beznea-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org>
2018-01-12 14:22   ` [PATCH v2 03/16] pwm: cros-ec: update documentation regarding pwm-cells Claudiu Beznea
2018-01-12 18:31     ` Brian Norris
2018-01-15  9:01       ` Claudiu Beznea
2018-01-17  8:29         ` Claudiu Beznea
     [not found]           ` <c2078487-8cc6-429e-6c38-092d776c33aa-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org>
2018-01-17 23:10             ` Brian Norris
2018-01-18  9:18               ` Claudiu Beznea
2018-01-12 14:22   ` [PATCH v2 06/16] ARM: dts: pxa: update pwm-cells Claudiu Beznea
2018-01-12 14:22   ` [PATCH v2 09/16] drivers: pwm: core: add PWM mode to pwm_config() Claudiu Beznea
2018-01-12 14:22   ` [PATCH v2 11/16] pwm: add documentation for PWM modes Claudiu Beznea
2018-01-19 22:39     ` Rob Herring [this message]
2018-01-22  8:55       ` Claudiu Beznea
2018-01-12 14:23   ` [PATCH v2 13/16] drivers: pwm: core: add push-pull mode support Claudiu Beznea
2018-01-12 14:22 ` [PATCH v2 12/16] pwm: atmel: add pwm capabilities Claudiu Beznea
2018-01-12 14:23 ` [PATCH v2 14/16] pwm: add push-pull mode Claudiu Beznea
2018-01-12 14:23 ` [PATCH v2 15/16] pwm: add documentation for pwm " Claudiu Beznea
     [not found]   ` <1515766983-15151-16-git-send-email-claudiu.beznea-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org>
2018-01-19 22:41     ` Rob Herring
2018-01-12 14:23 ` [PATCH v2 16/16] pwm: atmel: add push-pull mode support Claudiu Beznea

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180119223908.b3dxdx53nzuhakzw@rob-hp-laptop \
    --to=robh@kernel.org \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=corbet@lwn.net \
    --cc=daniel@zonque.org \
    --cc=devicetree@vger.kernel.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=robert.jarzmik@free.fr \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).