From: Tony Lindgren <tony@atomide.com>
To: linus.walleij@linaro.org
Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 0/4] improved support for runtime muxing for pinctrl
Date: Tue, 16 Jul 2013 02:14:14 -0700 [thread overview]
Message-ID: <20130716091413.GT7656@atomide.com> (raw)
In-Reply-To: <20130716090310.5541.36777.stgit@localhost>
* Tony Lindgren <tony@atomide.com> [130716 02:12]:
>
> As discussed earlier, the pinctrl support for changing some of the
> consumer device pins during runtime needs some improvment.
>
> Here are the patches to do that, I'll also post a minimal sample
> patch as a reply to this thread on how to do the muxing for
> runtime PM.
Here's a patch showing the suggested usage remuxing SDIO IRQ
to GPIO mode for runtime PM. Note that this patch depends on
three other patches for the hsmmc driver, I'll post that series
separately.
Regards,
Tony
From: Tony Lindgren <tony@atomide.com>
Date: Mon, 15 Jul 2013 07:39:39 -0700
Subject: [PATCH] mmc: omap_hsmmc: Remux pins to support SDIO interrupt and PM runtime
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>.
Cc: Andreas Fenkart <afenkart@gmail.com>
Cc: Balaji T K <balajitk@ti.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1869,7 +1869,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
const struct of_device_id *match;
dma_cap_mask_t mask;
unsigned tx_req, rx_req;
- struct pinctrl *pinctrl;
match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
if (match) {
@@ -2114,21 +2113,19 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
omap_hsmmc_disable_irq(host);
- pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
- if (IS_ERR(pinctrl))
- dev_warn(&pdev->dev,
- "pins are not configured from the driver\n");
-
/*
- * For now, only support SDIO interrupt if we are doing
- * muxing of dat1 when booted with DT. This is because the
+ * For now, only support SDIO interrupt if we are doing dynamic
+ * remuxing of dat1 when booted with DT. This is because the
* supposedly the wake-up events for CTPL don't work from deeper
* idle states. And we don't want to add new legacy mux platform
* init code callbacks any longer as we are moving to DT based
* booting anyways.
*/
if (match) {
- if (!IS_ERR(pinctrl) && mmc_slot(host).sdio_irq)
+ struct device *dev = &pdev->dev;
+
+ if (!pinctrl_pm_check_idle_state(dev) &&
+ mmc_slot(host).sdio_irq)
mmc->caps |= MMC_CAP_SDIO_IRQ;
}
@@ -2348,6 +2345,10 @@ static int omap_hsmmc_runtime_suspend(struct device *dev)
OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
spin_unlock_irqrestore(&host->irq_lock, flags);
+ ret = pinctrl_pm_select_idle_state(dev);
+ if (ret < 0)
+ dev_err(dev, "Unable to select idle pinmux\n");
+
if (mmc_slot(host).sdio_irq)
enable_irq(mmc_slot(host).sdio_irq);
}
@@ -2371,6 +2372,10 @@ static int omap_hsmmc_runtime_resume(struct device *dev)
if (mmc_slot(host).sdio_irq)
disable_irq(mmc_slot(host).sdio_irq);
+ ret = pinctrl_pm_select_active_state(dev);
+ if (ret < 0)
+ dev_err(dev, "Unable to select active pinmux\n");
+
spin_lock_irqsave(&host->irq_lock, flags);
host->active_pinmux = true;
next prev parent reply other threads:[~2013-07-16 9:14 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-16 9:05 [PATCH 0/4] improved support for runtime muxing for pinctrl Tony Lindgren
2013-07-16 9:05 ` [PATCH 1/4] pinctrl: Remove duplicate code in pinctrl_pm_select_state functions Tony Lindgren
2013-07-16 13:15 ` Grygorii Strashko
2013-07-16 13:41 ` Tony Lindgren
2013-07-16 14:25 ` Grygorii Strashko
2013-07-17 6:31 ` Tony Lindgren
2013-07-16 9:05 ` [PATCH 2/4] pinctrl: Allow pinctrl to have multiple active states Tony Lindgren
2013-07-17 20:55 ` Stephen Warren
2013-07-16 9:05 ` [PATCH 3/4] pinctrl: Add support for additional dynamic states Tony Lindgren
2013-07-16 9:35 ` Felipe Balbi
2013-07-16 12:06 ` Tony Lindgren
2013-07-17 21:14 ` Stephen Warren
2013-07-18 7:25 ` Tony Lindgren
2013-07-18 10:53 ` Tony Lindgren
2013-07-18 19:21 ` Stephen Warren
2013-07-19 7:29 ` Tony Lindgren
2013-07-19 18:52 ` Stephen Warren
2013-07-29 9:05 ` Tony Lindgren
2013-07-29 22:01 ` Stephen Warren
2013-08-14 16:41 ` Linus Walleij
2013-07-17 21:23 ` Stephen Warren
2013-07-18 7:36 ` Tony Lindgren
2013-07-18 19:26 ` Stephen Warren
2013-07-19 7:39 ` Tony Lindgren
2013-07-19 10:29 ` Grygorii Strashko
2013-07-19 19:03 ` Stephen Warren
2013-07-22 23:15 ` Linus Walleij
2013-07-29 9:08 ` Tony Lindgren
2013-07-19 18:58 ` Stephen Warren
2013-07-29 9:21 ` Tony Lindgren
2013-07-29 22:08 ` Stephen Warren
2013-07-22 23:07 ` Linus Walleij
2013-07-29 9:31 ` Tony Lindgren
2013-07-16 9:05 ` [PATCH 4/4] drivers: Add pinctrl handling for dynamic pin states Tony Lindgren
2013-07-17 21:21 ` Stephen Warren
2013-07-18 7:50 ` Tony Lindgren
2013-07-18 13:48 ` Tony Lindgren
2013-07-16 9:14 ` Tony Lindgren [this message]
2013-07-17 11:49 ` [PATCH 0/4] improved support for runtime muxing for pinctrl Grygorii Strashko
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=20130716091413.GT7656@atomide.com \
--to=tony@atomide.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@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 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).