From: Dong Aisheng <aisheng.dong@freescale.com>
To: Stephen Warren <swarren@nvidia.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: Thu, 1 Mar 2012 11:09:32 +0800 [thread overview]
Message-ID: <20120301030931.GA27020@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF17BDDF207C@HQMAIL01.nvidia.com>
On Wed, Feb 29, 2012 at 09:22:42AM -0800, Stephen Warren wrote:
> Dong Aisheng wrote at Tuesday, February 28, 2012 11:47 PM:
.....
> > > + 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.
>
I thought before that the mux function for GROUP X in OLD state may be set
in register A while mux function in NEW state may be set in register B.
So before setting new state function, user should disable old state function
(clear register A)first. (Maybe i thought too far)
But now i realize that you're correct, this can be handled in individual driver
for different HW requirement.
> 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.
>
Thanks for the detailed clarification.
Regards
Dong Aisheng
next prev parent reply other threads:[~2012-03-01 3:04 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
2012-03-01 3:09 ` Dong Aisheng [this message]
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=20120301030931.GA27020@shlinux2.ap.freescale.net \
--to=aisheng.dong@freescale.com \
--cc=B29396@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=swarren@nvidia.com \
--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®