Thread (156 messages) 156 messages, 11 authors, 2017-07-31

Re: [PATCH v3 04/14] GPIO: Add gpio-ingenic driver

From: Linus Walleij <hidden>
Date: 2017-02-12 20:49:05
Also in: linux-fbdev, linux-gpio, linux-mips, linux-mmc, linux-pwm, lkml

On Thu, Feb 9, 2017 at 6:14 PM, Paul Cercueil [off-list ref] wrote:
quoted
If you're not just replacing these with GPIO_GENERIC, please also
include a .get_direction() callback.
My .direction_input() and .direction_output() callbacks just call into
the pinctrl driver, using pinctrl_gpio_direction_[in,out]put().
I didn't find a way to get the direction info from the pinctrl driver,
is that something that the core should provide?
Hm OK you have a clear point there, there is no such callback.

OK I do not require you to fix that at this time.

I am hesitant about providing ever more callbacks from GPIO
to pin control, I might need some help for consolidation here.

With Mika's patches we have a .set_config() call to
pinctrl_gpio_set_config() so essentially
we *could* actually refactor all pin control drivers providing
a GPIO back-end to use:

pinctrl_gpio_set_config(gpio, PIN_CONF_PACKED(PIN_CONFIG_INPUT_ENABLE, 0));
pinctrl_gpio_set_config(gpio, PIN_CONF_PACKED(PIN_CONFIG_OUTPUT, val));

And replace the calls to pinctrl_gpio_direction_input()
and pinctrl_gpio_direction_output() with this throughout.

It makes things a bit simpler. If we need to figure things
out the reverse direction then pinctrl_gpio_get_config()
should be implemented and used as back-end for
figuring out direction.

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help