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

From: Paul Cercueil
Date: Thu Feb 09 2017 - 12:15:12 EST


Hi,

What some drivers do when they just get/set a bit in a register
to get/set or set the direction of a GPIO, is to select GPIO_GENERIC
and just bgpio_init() with the right iomem pointers, then the core
will register handlers for get, set, set_direcition callback and
get_direction and your driver can just focus on the remainders.

GPIO_GENERIC and bgpio_init() would work for my .set() / .get() callbacks,
not for my .direction_input() / .direction_output() callbacks which need
to set more than one register.

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?

Thanks,
-Paul