linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Timur Tabi <timur@codeaurora.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>,
	linux-gpio@vger.kernel.org, Andy Gross <andy.gross@linaro.org>
Subject: Re: Sparse GPIO maps with pinctrl-msm.c?
Date: Fri, 16 Jun 2017 09:35:51 -0700	[thread overview]
Message-ID: <20170616163551.GB17640@tuxbook> (raw)
In-Reply-To: <4d56b425-10c3-9568-e88c-4ac22ca0c50d@codeaurora.org>

On Fri 16 Jun 09:07 PDT 2017, Timur Tabi wrote:

> On 6/16/17 10:55 AM, Bjorn Andersson wrote:
> > npins are the number of "pins" handles by the TLMM, while ngpios are the
> > number of GPIO lines. I.e. npins >= ngpios and non platforms where we
> > control e.g. sdc properties you can see that npins > ngpios.
> 
> I'm talking about the 'npins' in struct msm_pingroup:
> 
> struct msm_pingroup {
> 	const char *name;
> 	const unsigned *pins;
> 	unsigned npins;
> 
> Every client driver of pinctrl-msm sets this value to 1 for every group.
> 

The npins here would allow us to properly name the multiple pins in e.g.
sdcX_data. But we're not doing this and I would be surprised if anyone
found it useful to get this in.

So it make sense to hardcode this value in msm_get_group_pins() and drop
it from the struct.

> > It's not an awesome solution for mobile either. But to solve this we
> > have two problems to solve;
> > 
> > 1) as the XPU configuration isn't fixed we need to be dynamic or
> > configurable in some sensible way
> 
> I was planning on updating the TLMM ACPI node to include a property that
> lists the acceptable GPIOs.
> 

But this list is related to your XPU configuration and not the TLMM
block, so the list of enabled/disabled pins should not go in the driver.

> > 2) the pinctrl framework does have some support for sparse pin spaces,
> > but this would need to be extended to allow us to (easily) register a
> > sparse list of pins
> 
> I was hoping there would be a way in pinctrl-msm to tell the framework, "Oh,
> you want to export this pin? Sorry, I forgot to tell you that it doesn't
> exist."
> 

There are quite a few functions in pinctrl-msm that would need to be
augmented with such checks, so I don't like this approach.

Regards,
Bjorn

  reply	other threads:[~2017-06-16 16:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 23:35 Sparse GPIO maps with pinctrl-msm.c? Timur Tabi
2017-06-14 18:59 ` Timur Tabi
2017-06-16 15:07 ` Stephen Boyd
2017-06-16 15:15   ` Timur Tabi
2017-06-16 15:41     ` Stephen Boyd
2017-06-16 15:49       ` Timur Tabi
2017-06-16 16:06         ` Bjorn Andersson
2017-06-16 16:17           ` Timur Tabi
2017-06-16 16:21             ` Andy Gross
2017-06-16 16:26               ` Timur Tabi
2017-06-16 17:44                 ` Bjorn Andersson
2017-06-16 18:10                   ` Timur Tabi
2017-06-16 18:50                     ` Bjorn Andersson
2017-06-16 19:07                       ` Timur Tabi
2017-06-29  4:59                         ` Bjorn Andersson
2017-06-20 23:10                   ` Timur Tabi
2017-06-16 15:55     ` Bjorn Andersson
2017-06-16 16:07       ` Timur Tabi
2017-06-16 16:35         ` Bjorn Andersson [this message]
2017-06-16 18:42           ` 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=20170616163551.GB17640@tuxbook \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=timur@codeaurora.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).