[PATCH 0/2] [v5] pinctrl: qcom: add support for sparse GPIOs

Linus Walleij linus.walleij at linaro.org
Wed Oct 11 00:51:08 PDT 2017


On Wed, Oct 4, 2017 at 12:03 AM, Stephen Boyd <sboyd at codeaurora.org> wrote:

> Could we remove the pin direction finding part here in
> gpiochip_add_pin_range() and lazily resolve the pin direction
> when a pin is requested? We would need a similar check in the msm
> specific debugfs code where we skip pins that aren't requested.
> This is basically a revert of commit 72d320006177 ("gpio: set up
> initial state from .get_direction()").

It seems reasonable for the gpiolib to be able to call this
function immediately after registering the new GPIO chip
with its vtable.

I think it is more up to the driver to numb the reply with
some dummy return value (i.e. input mode) or refactor the
callback so that it is acceptable for gpiolib to get an -EINVAL
or so from the driver (again it will assume input mode) if the
driver can't return the direction at this time.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list