Re: [RFC PATCH v3 1/2] dt-bindings: pwm: imx: Allow switching PWM output between PWM and GPIO

From: Linus Walleij
Date: Fri Dec 14 2018 - 08:45:36 EST


On Thu, Dec 6, 2018 at 2:41 PM VokÃÄ Michal <Michal.Vokac@xxxxxxxxx> wrote:

> Output of the PWM block on i.MX SoCs is always low when the block is
> disabled. This can cause issues when inverted PWM polarity is needed.
> With inverted polarity a duty cycle = 0% corresponds to high level on
> the output. Now, when PWM is disabled its output instantly goes low
> which corresponds to duty cycle = 100%.
>
> To get a truly inverted PWM output two pinctrl states of the PWM pin
> can be used. Configure the pin to GPIO function when PWM is disabled
> and switch back to PWM function whenever non-zero duty cycle is needed.
>
> Signed-off-by: Michal VokÃÄ <michal.vokac@xxxxxxxxx>
> ---
> Changes in v3:
> - Slightly different description of the pinctrl and pwm-gpio.

This looks good to me.

Acked-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij