All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	Bjorn Andersson <bjorn.andersson@linaro.org>
Subject: Re: [PATCH 2/3] pinctrl: msm: Mux out gpio function with gpio_request()
Date: Tue, 19 Jun 2018 22:53:04 -0700	[thread overview]
Message-ID: <152947398496.16708.16250874897441295979@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <CAD=FV=VjqvPQA5jTUyiMzmetk2br-4fiPQdM4cVzb6ivWcta9A@mail.gmail.com>

Quoting Doug Anderson (2018-06-19 14:38:57)
> On Tue, Jun 19, 2018 at 2:18 PM, Stephen Boyd <swboyd@chromium.org> wrote:
> > Quoting Doug Anderson (2018-06-18 16:54:49)
> >>
> >> Is there a reason why you'd want to return 0 instead of some sort of
> >> error code?  Wouldn't you want to know that this pin can't be a GPIO?
> >
> > On ACPI there aren't any functions and thus all pins are GPIO mode and
> > only GPIO mode if they're used as GPIOs. At least that's my
> > understanding of how the ACPI version of this driver works.
> 
> OK.  I have no understanding of how the ACPI version of this driver
> works, so your understanding is much more likely to be right than
> mine.  I guess this is just "pinctrl-qdf2xxx.c"?
> 

Yes that's the single ACPI driver.

> 
> >> Another non-ACPI example is sdc2 on sdm845 and it seems like you'd
> >> want to know if someone tried to set one of those as a GPIO.
> >>
> >> ...oh, but I guess ufs_reset also has no funcs but it still probably
> >> wants to use the GPIO framework to write something.  Hrmmm...  Maybe
> >> check if either in_bit or out_bit is not -1?
> >
> > ufs_reset and sdc2 aren't in the GPIO chip's numberspace so I don't
> > think we need to care? At least I can't convince myself that those pins
> > would eventually call into the this function. We could check if offset
> > is greater than ngpios for the chip but that seems useless if higher
> > layers are handling this already.
> 
> Ah, I see what you mean.  These pins do have numbers in the code:
> 
> PINCTRL_PIN(150, "SDC2_CLK"),
> PINCTRL_PIN(151, "SDC2_CMD"),
> PINCTRL_PIN(152, "SDC2_DATA"),
> PINCTRL_PIN(153, "UFS_RESET"),
> 
> ...but those are effectively made up numbers and they are all past the
> "ngpios" (150).  ...and the higher level code seems to be already
> checking that.

Right. Hopefully that saves us from this trouble.

> 
> 
> OK, thought I've already proven my cluelessness about this driver,
> FWIW this patch makes sense to me now so FWIW:
> 
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> 

Thanks!

  reply	other threads:[~2018-06-20  5:53 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 20:52 [PATCH 0/3] pinctrl: msm interrupt and muxing fixes Stephen Boyd
2018-06-18 20:52 ` [PATCH 1/3] pinctrl: msm: Really mask level interrupts to prevent latching Stephen Boyd
2018-06-18 22:43   ` Doug Anderson
2018-06-18 23:28     ` Stephen Boyd
2018-06-18 23:38       ` Doug Anderson
2018-06-19 21:14         ` Stephen Boyd
2018-06-20  6:45   ` Bjorn Andersson
2018-06-20 15:52     ` Doug Anderson
2018-06-21 15:14     ` Stephen Boyd
2018-06-22 17:56       ` Bjorn Andersson
2018-06-18 20:52 ` [PATCH 2/3] pinctrl: msm: Mux out gpio function with gpio_request() Stephen Boyd
2018-06-18 23:54   ` Doug Anderson
2018-06-19 21:18     ` Stephen Boyd
2018-06-19 21:38       ` Doug Anderson
2018-06-20  5:53         ` Stephen Boyd [this message]
2018-06-22 17:58   ` Bjorn Andersson
2018-06-22 18:31     ` Bjorn Andersson
2018-06-28 14:25       ` Linus Walleij
2018-06-28 17:14         ` Stephen Boyd
2018-06-28 18:45           ` Doug Anderson
2018-07-02 17:56             ` Stephen Boyd
2018-07-09 13:54               ` Linus Walleij
2018-07-09 15:37                 ` Stephen Boyd
2018-07-13  6:59                   ` Linus Walleij
2018-07-02 19:09           ` Bjorn Andersson
2018-07-06 17:23             ` Stephen Boyd
2018-06-18 20:52 ` [PATCH 3/3] pinctrl: msm: Configure interrupts as input and gpio mode Stephen Boyd
2018-06-19 15:48   ` Doug Anderson

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=152947398496.16708.16250874897441295979@swboyd.mtv.corp.google.com \
    --to=swboyd@chromium.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dianders@chromium.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.