From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "Clément Leger" <cleger@kalray.eu>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Hoan Tran <hoan@os.amperecomputing.com>,
"open list, GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH 4/5] pinctrl: dw: add pinctrl support for dwapb gpio driver
Date: Wed, 4 Dec 2019 19:58:35 +0200 [thread overview]
Message-ID: <CAHp75Vc6oU2nNkKT8N+6RomSxHVXu0AvwoZVBKvTERLQ68Kz_Q@mail.gmail.com> (raw)
In-Reply-To: <1988869450.95325741.1575471003953.JavaMail.zimbra@kalray.eu>
On Wed, Dec 4, 2019 at 4:50 PM Clément Leger <cleger@kalray.eu> wrote:
> ----- On 4 Dec, 2019, at 13:43, Andy Shevchenko andy.shevchenko@gmail.com wrote:
> > On Wed, Dec 4, 2019 at 12:12 PM Clement Leger <cleger@kalray.eu> wrote:
> > Can't you split adding pin control data to a separate patch?
>
> Yes even if the first one will not be buildable.
It will. Just split it wisely.
I'm preparing Intel Lynxpoint conversion (you may see the approach
here [1]) and I stumbled over similar problem.
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel.git/commit/?h=review-andy&id=ddbf10ea98c1c96de98fb5878ca0d0042e912f6a
> > Can't we generate these lists dynamically?
>
> Indeed, these list could be dynamically generated. However, since they
> can be shared between all pinctrl instances of this driver I thought
> it was better to keep them common and simply restrict the number
> of pins at pinctrl registration. But as I said, I can generate them if
> you want.
OK, let's wait for subsys maintainers to comment on this.
> >> + ret = pinctrl_enable(port->pctl);
> >> + if (ret) {
> >> + dev_err(gpio->dev, "pinctrl enable failed\n");
> >> + return ret;
> >> + }
> >
> > Not sure why it's needed at all.
>
> I saw a comment over "pinctrl_register" in pinctrl.h saying:
>
> /* Please use pinctrl_register_and_init() and pinctrl_enable() instead */
>
> So I switched to pinctrl_register_and_init + pinctrl_enable.
I read the code and do not see any evidence you have to use above.
Do you plan to do something in between of those two calls?
> > Can you use new callback for this?
>
> Do you mean the gpiochip add_pin_ranges callback ?
> If so, I will look at it.
I meant ->add_pin_ranges() which is part of GPIO chip structure.
> >> - .name = "gpio-dwapb",
> >> + .name = "pinctrl-dwapb",
> >
> > This will break existing users.
>
> Ok, I will revert that.
You may fix users at the same time.
Either fine with me.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2019-12-04 18:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-04 10:10 [PATCH 4/5] pinctrl: dw: add pinctrl support for dwapb gpio driver Clement Leger
2019-12-04 12:43 ` Andy Shevchenko
2019-12-04 14:50 ` Clément Leger
2019-12-04 17:58 ` Andy Shevchenko [this message]
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=CAHp75Vc6oU2nNkKT8N+6RomSxHVXu0AvwoZVBKvTERLQ68Kz_Q@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=cleger@kalray.eu \
--cc=hoan@os.amperecomputing.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.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).