linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: bjorn.andersson@linaro.org (Bjorn Andersson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: msm: allow the gpio base to be configurable
Date: Sun, 28 Jan 2018 16:51:30 -0800	[thread overview]
Message-ID: <20180129005129.GB12728@builder> (raw)
In-Reply-To: <042b6cea-38f7-a660-0059-5f24fc7db9eb@codeaurora.org>

On Sun 28 Jan 15:29 PST 2018, Timur Tabi wrote:

> On 1/28/18 5:23 PM, Bjorn Andersson wrote:
> > What platform has multiple TLMMs?
> > 
> > [..]
> 
> An upcoming one.
> 

Cool :)

> > > diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> > > index b7b6849625ec..4dc76e15bd14 100644
> > > --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> > > +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> > > @@ -901,7 +901,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
> > >   		return -EINVAL;
> > >   	chip = &pctrl->chip;
> > > -	chip->base = 0;
> 
> > My bad, this should have been -1.
> 
> Perhaps, but it's been 0 for a very long time, so I don't want to break any
> existing platforms by suddenly relocating all GPIOs across all Qualcomm
> platforms.
> 

Yeah, I see that I got this wrong when I wrote the driver 4 years ago...

There should be no in-kernel users depending on these numbers being hard
coded, so anyone depending on these numbers starting at 0 would be user
space - doing so incorrectly.

> What do you think about my other idea?
> 

With static numbering of gpios you end up having cross-instance and
cross-driver tweaks to make things fit the number space. In particular
when you combine different gpio chips in different ways for different
devices this becomes a mess.

That's why the idea of static gpio numbering was abandoned a long long
time ago. So while it does solve an immediate problem for you it is
proven not to be the right solution in the long run...

Regards,
Bjorn

  reply	other threads:[~2018-01-29  0:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 21:20 [PATCH] pinctrl: msm: allow the gpio base to be configurable Timur Tabi
2018-01-26 13:01 ` Linus Walleij
2018-01-26 13:16   ` Timur Tabi
2018-01-26 22:13     ` Bartosz Golaszewski
2018-01-28 23:23 ` Bjorn Andersson
2018-01-28 23:29   ` Timur Tabi
2018-01-29  0:51     ` Bjorn Andersson [this message]
2018-02-07 13:19       ` Linus Walleij
2018-02-07 14:50         ` Timur Tabi

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=20180129005129.GB12728@builder \
    --to=bjorn.andersson@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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).