[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-gpio
Subject:    Re: [PATCH] gpio: pxa: make controllers without pinctrl work again
From:       Linus Walleij <linus.walleij () linaro ! org>
Date:       2018-06-29 12:49:12
Message-ID: CACRpkdZMu_r-bWPF7GaR-G2o3PGXpEKVDCJYv2+ppJSSMS7iEg () mail ! gmail ! com
[Download RAW message or body]

On Sun, Jun 24, 2018 at 11:27 PM Daniel Mack <daniel@zonque.org> wrote:

> To recap, the pxa3xx driver uses the pinctrl-single driver since a while
> which does not implement a .gpio_set_direction() callback. The pinmux
> core will simply return 0 in this case, and the pxa3xx gpio driver hence
> thinks the pinctrl driver did its job and returns as well.

I guess we need to discuss with Tony and Haojian if pinctrl-single should
ever implement that or if it is thought as having GPIO and pin
control orthogonally.

> This effectively makes pxa_gpio_direction_{input,output} no-ops.
> Interestingly, I only noticed that when I tried to use the w1-gpio
> driver which makes use of gpiolib's open-drain emulation. All other
> use-cases work just fine.

Hm. Is that because muxing is not getting set up or because of
some other electrical configuration not being applied?

> So the question is how this is supposed to work. I see two options:
>
> 1) Apply the patch below, so we don't use use the pinctrl driver on PXA3xx.

The patch looks good on its own terms.

Normally drivers look to see if the GPIO controller has any
gpio-ranges, and if it does, it assumes pin control is in use.

> 2) Change pinmux_gpio_direction() and make it return -ENOSYS or
> something in case there is no .gpio_set_direction() implementation. I'm
> not sure whether that's a good idea though, and what the side-effects
> would be.

It sounds dangerous. You would have to grep and read through
the consumers to present an argument that it is safe.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic