Re: [RCF PATCH,v2,2/2] pwm: imx: Configure output to GPIO in disabled state

Vokáč Michal
2018-11-22T16:47:26Z

On 22.11.2018 17:23, Uwe Kleine-König wrote:
> Hello Michal,
>
> On Thu, Nov 22, 2018 at 03:42:14PM +0000, Vokáč Michal wrote:
>> On 16.11.2018 09:25, Uwe Kleine-König wrote:
>>> On Fri, Nov 16, 2018 at 08:34:30AM +0100, Lothar Waßmann wrote:
>>>> No. You can disable the output driver via pinctrl, so that only the
>>>> selected pull-up/down is relevant. The pin function and GPIO register
>>>> settings don't matter at all in this case.
>>
>> Lothar, please can you be more specific how would you do that? IFAIK the
>> pull-up/down internal resistors have effect only if the pin is configured
>> as GPIO *input* (on i.MX6 at least). See the TRM, 29.4.2.2 Output driver:
>>
>> "Internal pull-up, pull-down resistors, and pad keeper are disabled in
>> output mode."
>>
>>> Is this about DSE=HI-Z in the pad control register? I didn't know about
>>> this. I see this exists on i.MX6 but not on i.MX25. Also i.MX51 doesn't
>>> seem to have this feature.
>>
>> Uwe, I also did not find the DSE option on other SoCs in their respective
>> manuals and source code. But even if it would be available on all SoCs
>> I still think it is not enough.
>
> If I understand Lothar correctly and this is about the pad control
> register, there is no need for software support. You just specify the
> value you want to have written to the pad register in the device tree.

I agree. But the pad control register is not the one that controls if
the pad is configured as input or output. So if the pin happens to be
configured as output the pull/keeper setting simply has no effect.

> So I'd expect this to really work on i.MX6 but not the earlier SoCs
> without a gpio specifier.

Maybe you would expect it to work but I already tested and measured
that weeks ago ;) It did not work.

Michal