[PATCH 3/7] gpio: separate gpio driver from pinctrl-rockchip driver
Linus Walleij
linus.walleij at linaro.org
Mon May 24 17:06:43 PDT 2021
On Mon, May 10, 2021 at 8:36 AM Jianqun Xu <jay.xu at rock-chips.com> wrote:
> Separate the gpio driver from the pinctrl driver.
>
> Signed-off-by: Jianqun Xu <jay.xu at rock-chips.com>
Overall this is very good and should be applied.
> +#include "../pinctrl/core.h"
> +#include "../pinctrl/pinctrl-rockchip.h"
Please explain in a comment exactly why you need to include
these files. I think it should be the goal to get rid of this dependency.
It seems that the driver can be further simplified using GPIO_GENERIC
but we can deal with this later, once it is separate.
> +static int rockchip_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
> + unsigned long config)
> +{
> + enum pin_config_param param = pinconf_to_config_param(config);
> +
> + switch (param) {
> + case PIN_CONFIG_INPUT_DEBOUNCE:
> + rockchip_gpio_set_debounce(gc, offset, true);
(...)
> + .set_config = rockchip_gpio_set_config,
Can't you just use gpiochip_generic_config() and rely on the pinctrl
back-end to deal with this?
> + .to_irq = rockchip_gpio_to_irq,
Normally this should not be needed with GPIOLIB_IRQCHIP but
since you are refactoring an existing driver it is acceptable to
keep for now.
Yours,
Linus Walleij
More information about the Linux-rockchip
mailing list