lkml.org 
[lkml]   [2018]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v4 2/2] pwm: imx: Configure output to GPIO in disabled state
Hello,

On Wed, Dec 12, 2018 at 12:04:51PM +0000, Vokáč Michal wrote:
> Normally the PWM output is held LOW when PWM is disabled. This can cause
> problems when inverted PWM signal polarity is needed. With this behavior
> the connected circuit is fed by 100% duty cycle instead of being shut-off.
>
> Allow users to define a "pwm" and a "gpio" pinctrl states. The pwm pinctrl
> state is selected when PWM is enabled and the gpio pinctrl state is
> selected when PWM is disabled. In the gpio state the new pwm-gpios GPIO is
> configured as input and the internal pull-up resistor is used to pull the
> output level high.
>
> If all the pinctrl states and the pwm-gpios GPIO are not correctly
> specified in DT the PWM work as usual.
>
> As an example, with this patch a PWM controlled backlight with inversed
> signal polarity can be used in full brightness range. Without this patch
> the backlight can not be turned off as brightness = 0 disables the PWM
> and that in turn set PWM output LOW, that is full brightness.
>
> Inverted output of the PWM with "default" and with "pwm"+"gpio" pinctrl:
>
> +--------------+------------+---------------+----------- +-------------+
> | After reset | Bootloader | PWM probe | PWM | PWM |
> | 100k pull-up | | | enable 30% | disable |
> +--------------+------------+---------------+------------+-------------+
> | pinctrl | none | default | default | default |
> | out H __________________ __ __ |
> | out L \_________________/ \_/ \_/\____________ |
> | ^ ^ ^ |
> +--------------+------------+---------------+------------+-------------+
> | pinctrl | none | gpio | pwm | gpio |
> | out H __________________________________ __ __ _____________ |
> | out L \_/ \_/ \_/ |
> | ^ ^ ^ |
> +----------------------------------------------------------------------+

Just for the record: My last concern against this patch set (that I sent
for v3) and v4 of the series criss-crossed. So the problem with the
peaks that could happen is still unaddressed.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |

\
 
 \ /
  Last update: 2018-12-13 09:57    [W:0.061 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site