linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Jon Hunter <jonathanh@nvidia.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	linux-tegra@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH 2/3] pinctrl: tegra-xusb: Fix allocation of pins
Date: Wed, 20 May 2015 17:04:07 +0200	[thread overview]
Message-ID: <20150520150405.GA7734@ulmo.nvidia.com> (raw)
In-Reply-To: <555B5563.5060604@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]

On Tue, May 19, 2015 at 04:23:15PM +0100, Jon Hunter wrote:
> 
> On 19/05/15 15:33, Thierry Reding wrote:
> > * PGP Signed by an unknown key
> > 
> > On Tue, May 19, 2015 at 03:14:22PM +0100, Jon Hunter wrote:
> > [...]
> > 
> > One more thing:
> > 
> > [...]
> >> diff --git a/drivers/pinctrl/pinctrl-tegra-xusb.c b/drivers/pinctrl/pinctrl-tegra-xusb.c
> >> index 3e8e4a914fb4..c61594066e26 100644
> >> --- a/drivers/pinctrl/pinctrl-tegra-xusb.c
> >> +++ b/drivers/pinctrl/pinctrl-tegra-xusb.c
> >> @@ -125,6 +125,23 @@ static const char *tegra_xusb_padctl_get_group_name(struct pinctrl_dev *pinctrl,
> >>  	return padctl->soc->pins[group].name;
> >>  }
> >>  
> >> +static int tegra_xusb_padctl_get_group_pins(struct pinctrl_dev *pinctrl,
> >> +					    unsigned group,
> >> +					    const unsigned **pins,
> >> +					    unsigned *num_pins)
> >> +{
> >> +	struct tegra_xusb_padctl *padctl = pinctrl_dev_get_drvdata(pinctrl);
> >> +
> >> +	/*
> >> +	 * For the tegra-xusb pad controller groups are synonomous
> >> +	 * with lanes/pins and there is always one lane/pin per group.
> >> +	 */
> >> +	*pins = &padctl->soc->pins[group].number;
> > 
> > Shouldn't this be the same as pinctrl->desc->pins? In that case, maybe a
> > better solution would be to make .get_group_pins() mandatory again and
> > turn this into a pinctrl helper function that can be used by all group-
> > only pinctrl drivers?
> 
> Yes I believe that you are right. However, I don't think a helper
> function would work here, because this function returns a pointer to an
> array of pin numbers. In the case of xusb this is simplified a bit
> because we are only returning a single number here for the group.
> However, if you look at other pinctrl devices (such as pinctrl-tegra.c)
> there could be more than one number in the array.

I see. Oh well, guess this is as good as it gets then.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-05-20 15:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19 14:14 [PATCH 0/3] pinctrl: tegra-xusb: Clean-up and fixes Jon Hunter
     [not found] ` <1432044863-2035-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-05-19 14:14   ` [PATCH 1/3] pinctrl: tegra-xusb: Remove unused structure Jon Hunter
2015-05-19 14:20     ` Thierry Reding
2015-05-19 14:14 ` [PATCH 2/3] pinctrl: tegra-xusb: Fix allocation of pins Jon Hunter
     [not found]   ` <1432044863-2035-3-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-05-19 14:30     ` Thierry Reding
     [not found]       ` <20150519143041.GD26748-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2015-05-19 15:09         ` Jon Hunter
2015-05-19 14:33   ` Thierry Reding
     [not found]     ` <20150519143340.GE26748-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2015-05-19 15:23       ` Jon Hunter
2015-05-20 15:04         ` Thierry Reding [this message]
2015-05-19 14:14 ` [PATCH 3/3] pinctrl: tegra-xusb: Check that of_match_node returns a valid pointer Jon Hunter
2015-05-19 14:18   ` Thierry Reding
     [not found]     ` <20150519141836.GB26748-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2015-05-19 14:29       ` Jon Hunter

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=20150520150405.GA7734@ulmo.nvidia.com \
    --to=thierry.reding@gmail.com \
    --cc=gnurou@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=swarren@wwwdotorg.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).