mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@nvidia.com>
To: Dong Aisheng <aisheng.dong@freescale.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	"B29396@freescale.com" <B29396@freescale.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"dongas86@gmail.com" <dongas86@gmail.com>,
	"shawn.guo@linaro.org" <shawn.guo@linaro.org>,
	"thomas.abraham@linaro.org" <thomas.abraham@linaro.org>,
	"tony@atomide.com" <tony@atomide.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH V2 4/6] pinctrl: API changes to support multiple states per device
Date: Wed, 29 Feb 2012 09:22:42 -0800	[thread overview]
Message-ID: <74CDBE0F657A3D45AFBB94109FB122FF17BDDF207C@HQMAIL01.nvidia.com> (raw)
In-Reply-To: <20120229064633.GA14703@shlinux2.ap.freescale.net>

Dong Aisheng wrote at Tuesday, February 28, 2012 11:47 PM:
> On Tue, Feb 28, 2012 at 01:27:30PM -0700, Stephen Warren wrote:
...
> > +static struct pinctrl *find_pinctrl(struct device *dev)
> > +{
> > +	struct pinctrl *p;
> > +
> > +	list_for_each_entry(p, &pinctrldev_list, node)
>
> s/pinctrldev_list/pinctrl_list ?

Uggh. I could have sworn I fixed that before. Perhaps I had the same
silly error somewhere else too. Thanks for catching it.
> 
> > +static int pinctrl_select_state_locked(struct pinctrl *p,
> > +				       struct pinctrl_state *state)
...
> > +	if (p->state) {
> > +		/*
> > +		 * The set of groups with a mux configuration in the old state
> > +		 * may not be identical to the set of groups with a mux setting
> > +		 * in the new state. While this might be unusual, it's entirely
> > +		 * possible for the "user"-supplied mapping table to be written
> > +		 * that way. For each group that was configured in the old state
> > +		 * but not in the new state, this code puts that group into a
> > +		 * safe/disabled state.
>
> It means the old state function of some groups may not have been disabled before
> enabling the new function mode.
> May it be a little error-prone?
> Maybe we can not depend on user to disable a function before enable another for
> a group when doing pinmux_enable_setting considering they may be different
> registers.

The idea here is that there are two cases:

1) (hopefully the typical case)

Group X HAS a mux function set in OLD state
Group X HAS a mux function set in NEW state

In this case, we simply call pinmux_enable_setting(new state).

We do this so that we can transition directly from the old state to the
new state without going through any artificial intermediate states, to
make the mux switching as glitchless as possible.

If the HW has some restriction where it has to operate like:

Old state -> idle -> new state

Rather than:

Old state -> new state

Then I think that should be taken care of within the individual driver;
given most mux selection is just a register field that feeds into a simple
signal mux in HW, such a requirement seems pretty unlikely to me, but you
never know.

2)

Group X HAS a mux function set in OLD state
Group X DOES NOT have a mux function set in NEW state

In this case, we call pinmux_disable_setting(old state) to ensure that
the pin is put into some idle state that can't interfere with any other
pin.

-- 
nvpublic


  reply	other threads:[~2012-02-29 17:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-28 20:27 [PATCH V2 0/6] pinctrl: API rework, pinconfig in mapping table, Stephen Warren
2012-02-28 20:27 ` [PATCH V2 1/6] pinctrl: Fix and simplify locking Stephen Warren
2012-02-28 20:27 ` [PATCH V2 2/6] pinctrl: Refactor struct pinctrl handling in core.c vs pinmux.c Stephen Warren
2012-02-28 20:27 ` [PATCH V2 3/6] pinctrl: Add usecount to pins for muxing Stephen Warren
2012-02-28 20:27 ` [PATCH V2 4/6] pinctrl: API changes to support multiple states per device Stephen Warren
2012-02-29  6:46   ` Dong Aisheng
2012-02-29 17:22     ` Stephen Warren [this message]
2012-03-01  3:09       ` Dong Aisheng
2012-02-28 20:27 ` [PATCH V2 5/6] pinctrl: Enhance mapping table to support pin config operations Stephen Warren
2012-03-01  8:46   ` Dong Aisheng
2012-03-01 16:52     ` Stephen Warren
2012-03-02  3:46       ` Dong Aisheng
2012-03-02 22:49         ` Stephen Warren
2012-03-05  7:58           ` Dong Aisheng
2012-02-28 20:27 ` [PATCH V2 6/6] pinctrl: fix case of Tegra30's foo_groups[] arrays Stephen Warren
2012-02-29 16:46 ` [PATCH V2 0/6] pinctrl: API rework, pinconfig in mapping table, Linus Walleij
2012-02-29 17:42   ` Stephen Warren
2012-02-29 18:09     ` Linus Walleij

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=74CDBE0F657A3D45AFBB94109FB122FF17BDDF207C@HQMAIL01.nvidia.com \
    --to=swarren@nvidia.com \
    --cc=B29396@freescale.com \
    --cc=aisheng.dong@freescale.com \
    --cc=dongas86@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    --cc=thomas.abraham@linaro.org \
    --cc=tony@atomide.com \
    /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

all inboxes | Powered by JetHome®