lkml.org 
[lkml]   [2021]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 3/7] gpio: separate gpio driver from pinctrl-rockchip driver
On Mon, May 10, 2021 at 8:36 AM Jianqun Xu <jay.xu@rock-chips.com> wrote:

> Separate the gpio driver from the pinctrl driver.
>
> Signed-off-by: Jianqun Xu <jay.xu@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

\
 
 \ /
  Last update: 2021-05-25 02:07    [W:0.106 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site