From: Linus Walleij <linus.walleij@linaro.org>
To: Tony Lindgren <tony@atomide.com>
Cc: Chris Ball <cjb@laptop.org>, Balaji T K <balajitk@ti.com>,
Andreas Fenkart <afenkart@gmail.com>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
Linux-OMAP <linux-omap@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/4] mmc: omap_hsmmc: Remux pins to support SDIO interrupt and PM runtime
Date: Mon, 10 Jun 2013 18:03:15 +0200 [thread overview]
Message-ID: <CACRpkdZ5CUvULBFpdHZ_AMotqfUdBcAQ63+8cT+r6TZ77bUWOA@mail.gmail.com> (raw)
In-Reply-To: <20130607214957.18581.90624.stgit@localhost>
On Fri, Jun 7, 2013 at 11:49 PM, Tony Lindgren <tony@atomide.com> wrote:
> On some omaps we need to remux MMC pins for PM, and for some omaps
> we need to remux the SDIO IRQ pin.
>
> Based on an earlier patch by Andreas Fenkart <afenkart@gmail.com>.
(...)
> + host->pinctrl = devm_pinctrl_get(host->dev);
> + if (IS_ERR(host->pinctrl)) {
> + dev_dbg(host->dev, "no pinctrl handle\n");
> + ret = 0;
> + goto out;
> + }
> +
> + host->fixed = pinctrl_lookup_state(host->pinctrl,
> + PINCTRL_STATE_DEFAULT);
> + if (IS_ERR(host->fixed)) {
> + dev_dbg(host->dev,
> + "pins are not configured from the driver\n");
> + host->fixed = NULL;
> + ret = 0;
> + goto out;
> + }
> +
> + ret = pinctrl_select_state(host->pinctrl, host->fixed);
> + if (ret < 0)
> + goto err;
> +
> + /* For most cases we don't have wake-ups, and exit after this */
> + host->active = pinctrl_lookup_state(host->pinctrl, "active");
> + if (IS_ERR(host->active)) {
> + ret = PTR_ERR(host->active);
> + host->active = NULL;
> + return 0;
> + }
> +
> + host->idle = pinctrl_lookup_state(host->pinctrl,
> + PINCTRL_STATE_IDLE);
> + if (IS_ERR(host->idle)) {
> + ret = PTR_ERR(host->idle);
> + host->idle = NULL;
> + goto err;
> + }
You can use the new infrastructure to make the core select:
pinctrl_pm_select_default_state(host->dev);
pinctrl_pm_select_idle_state(host->dev);
What is the semantic difference between "default" and "active"?
If this is something very generic that a lot of platforms will want
to have, why not add it to include/linux/pinctrl/pinctrl-state.h
and augment the core to cache and handle this too?
However in this case I *suspect* that what you really want
to do it to rename the state called "default" to "sleep"
(it appears the default state is sleepy) and then rename
the "active" state to "default" (as this is the defined semantic
meaning of "default" from <linux/pinctrl/pinctrl-state.h>.
But maybe I'm not quite getting the subtle difference between
"default" and "active" here so enlighten me.
Yours,
Linus Walleij
next prev parent reply other threads:[~2013-06-10 16:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 21:49 [PATCH 0/4] Updated omap_hsmmc SDIO and remuxing patches Tony Lindgren
2013-06-07 21:49 ` [PATCH 1/4] mmc: omap_hsmmc: Fix context save and restore for DT Tony Lindgren
2013-06-08 4:25 ` Felipe Balbi
2013-06-08 15:02 ` Tony Lindgren
2013-06-07 21:49 ` [PATCH 2/4] mmc: omap_hsmmc: Enable SDIO IRQ using a GPIO in idle mode Tony Lindgren
2013-06-14 7:37 ` Tony Lindgren
2013-06-14 11:50 ` Ulf Hansson
2013-06-20 7:24 ` Tony Lindgren
2013-07-08 9:02 ` Felipe Balbi
2013-06-07 21:49 ` [PATCH 3/4] mmc: omap_hsmmc: Remux pins to support SDIO interrupt and PM runtime Tony Lindgren
2013-06-10 16:03 ` Linus Walleij [this message]
2013-06-10 16:23 ` Tony Lindgren
2013-06-11 7:54 ` Linus Walleij
2013-06-12 13:21 ` Tony Lindgren
2013-06-14 7:40 ` Tony Lindgren
2013-06-07 21:50 ` [PATCH 4/4] mmc: omap_hsmmc: debugfs entries for GPIO and SDIO mode Tony Lindgren
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=CACRpkdZ5CUvULBFpdHZ_AMotqfUdBcAQ63+8cT+r6TZ77bUWOA@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=afenkart@gmail.com \
--cc=balajitk@ti.com \
--cc=cjb@laptop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).