linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Jianqun Xu <jay.xu@rock-chips.com>
Cc: "Heiko Stübner" <heiko@sntech.de>,
	"Rob Herring" <robh+dt@kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/7] gpio: separate gpio driver from pinctrl-rockchip driver
Date: Tue, 25 May 2021 02:06:43 +0200	[thread overview]
Message-ID: <CACRpkdaZ=3AsT9NiOKrwEDWXReDX0w_PsdgwC6fqSb4Yecry-g@mail.gmail.com> (raw)
In-Reply-To: <20210510063602.505829-4-jay.xu@rock-chips.com>

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

  reply	other threads:[~2021-05-25  0:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10  6:35 [PATCH v4 0/7] gpio-rockchip driver Jianqun Xu
2021-05-10  6:35 ` [PATCH 1/7] pinctrl/rockchip: separate struct rockchip_pin_bank to a head file Jianqun Xu
2021-05-24 23:55   ` Linus Walleij
2021-05-10  6:35 ` [PATCH 2/7] pinctrl/pinctrl-rockchip.h: add pinctrl device to gpio bank struct Jianqun Xu
2021-05-10  6:35 ` [PATCH 3/7] gpio: separate gpio driver from pinctrl-rockchip driver Jianqun Xu
2021-05-25  0:06   ` Linus Walleij [this message]
2021-05-10  6:35 ` [PATCH 4/7] gpio/rockchip: use struct rockchip_gpio_regs for gpio controller Jianqun Xu
2021-05-19 23:23   ` Heiko Stübner
2021-05-10  6:37 ` [PATCH 5/7] gpio/rockchip: support next version " Jianqun Xu
2021-05-10  6:37 ` [PATCH 6/7] gpio/rockchip: always enable clock for " Jianqun Xu
2021-05-13 20:48   ` Heiko Stuebner
2021-05-19 23:18     ` Linus Walleij
2021-05-19 23:27       ` Heiko Stübner
2021-05-10  6:37 ` [PATCH 7/7] gpio/rockchip: drop irq_gc_lock/irq_gc_unlock for irq set type Jianqun Xu
2021-05-19 23:26   ` Heiko Stübner
2021-05-10 22:16 ` [PATCH v4 0/7] gpio-rockchip driver Ezequiel Garcia
2021-05-12 13:29   ` Bartosz Golaszewski
  -- strict thread matches above, loose matches on Subject: below --
2021-03-24  6:45 [PATCH RESEND " Jianqun Xu
2021-03-24  6:45 ` [PATCH 3/7] gpio: separate gpio driver from pinctrl-rockchip driver Jianqun Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACRpkdaZ=3AsT9NiOKrwEDWXReDX0w_PsdgwC6fqSb4Yecry-g@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=heiko@sntech.de \
    --cc=jay.xu@rock-chips.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).