[PATCH] pwm: meson: Explicitly set .polarity in .get_state()

Jerome Brunet jbrunet at baylibre.com
Mon Mar 13 02:07:48 PDT 2023


On Sat 11 Mar 2023 at 22:00, Martin Blumenstingl <martin.blumenstingl at googlemail.com> wrote:

> Hi Uwe,
>
> On Fri, Mar 10, 2023 at 8:14 PM Uwe Kleine-König
> <u.kleine-koenig at pengutronix.de> wrote:
> [...]
>> There is a complicating fact, that the .apply() callback fakes support
>> for inversed polarity. This is not (and cannot) be matched by
>> .get_state(). As fixing this isn't easy, only point it out in a comment
>> to prevent authors of other drivers from copying that approach.
> If you have any suggestions on how to fix this then please let us know.
> I don't recall any board needing support for inverted PWM - but they
> may be out there somewhere...

AFAIK, PWM are essentially used for the SDIO 32k clock and voltage
regulators. I don't recall seeing anything else.

It should be safe to change polarity if necessary, except for the DVFS
PWM regulators maybe ? I fear that if we change the PWM setting it might
trigger a glitch on the supply and possibly stall the CPU.

That being said, I don't think there is any particular care regarding
that right now, so maybe it is fine.

>
>> Fixes: c375bcbaabdb ("pwm: meson: Read the full hardware state in meson_pwm_get_state()")
>> Reported-by: Munehisa Kamata <kamatam at amazon.com>
>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> Acked-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
>
>
> Best regards,
> Martin




More information about the linux-arm-kernel mailing list