All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Support for optional MMC PM capabilities
@ 2012-11-19  4:56 Abhilash Kesavan
  2012-11-19  4:56 ` [PATCH 1/4] mmc: dt: Fix typo in filename Abhilash Kesavan
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Abhilash Kesavan @ 2012-11-19  4:56 UTC (permalink / raw)
  To: cjb, linux-mmc

This patchset adds optional PM properties to the core MMC bindings. It also
makes the appropriate changes in the sdhci platform and dw_mmc driver files.
Based on git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git : for-next.
Note: Patch 3 has only been compile tested.

Abhilash Kesavan (4):
  mmc: dt: Fix typo in filename
  mmc: dt: Add optional pm properties to core binding
  mmc: sdhci-pltfm: Support optional pm properties
  mmc: dw_mmc: Add sdio power bindings

 Documentation/devicetree/bindings/mmc/mmc.txt      |    4 ++++
 .../{synposis-dw-mshc.txt => synopsis-dw-mshc.txt} |    0
 drivers/mmc/host/dw_mmc.c                          |   20 +++++++++++++++++---
 drivers/mmc/host/sdhci-pltfm.c                     |    6 ++++++
 include/linux/mmc/dw_mmc.h                         |    1 +
 5 files changed, 28 insertions(+), 3 deletions(-)
 rename Documentation/devicetree/bindings/mmc/{synposis-dw-mshc.txt => synopsis-dw-mshc.txt} (100%)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] mmc: dt: Fix typo in filename
  2012-11-19  4:56 [PATCH 0/4] Support for optional MMC PM capabilities Abhilash Kesavan
@ 2012-11-19  4:56 ` Abhilash Kesavan
  2012-11-19  4:56 ` [PATCH 2/4] mmc: dt: Add optional pm properties to core binding Abhilash Kesavan
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Abhilash Kesavan @ 2012-11-19  4:56 UTC (permalink / raw)
  To: cjb, linux-mmc

Fix typo in the synopsis dwmmc controller dt binding filename.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
---
 .../{synposis-dw-mshc.txt => synopsis-dw-mshc.txt} |    0
 1 files changed, 0 insertions(+), 0 deletions(-)
 rename Documentation/devicetree/bindings/mmc/{synposis-dw-mshc.txt => synopsis-dw-mshc.txt} (100%)

diff --git a/Documentation/devicetree/bindings/mmc/synposis-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synopsis-dw-mshc.txt
similarity index 100%
rename from Documentation/devicetree/bindings/mmc/synposis-dw-mshc.txt
rename to Documentation/devicetree/bindings/mmc/synopsis-dw-mshc.txt
-- 
1.6.6.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/4] mmc: dt: Add optional pm properties to core binding
  2012-11-19  4:56 [PATCH 0/4] Support for optional MMC PM capabilities Abhilash Kesavan
  2012-11-19  4:56 ` [PATCH 1/4] mmc: dt: Fix typo in filename Abhilash Kesavan
@ 2012-11-19  4:56 ` Abhilash Kesavan
  2012-11-19  4:56 ` [PATCH 3/4] mmc: sdhci-pltfm: Support optional pm properties Abhilash Kesavan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Abhilash Kesavan @ 2012-11-19  4:56 UTC (permalink / raw)
  To: cjb, linux-mmc

Add documentation for pm capabilties such as MMC_PM_KEEP_POWER
and MMC_PM_WAKE_SDIO_IRQ.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
---
 Documentation/devicetree/bindings/mmc/mmc.txt |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
index 8e2e0ba..1b6a1f8 100644
--- a/Documentation/devicetree/bindings/mmc/mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc.txt
@@ -21,6 +21,8 @@ Optional properties:
 - cd-inverted: when present, polarity on the cd gpio line is inverted
 - wp-inverted: when present, polarity on the wp gpio line is inverted
 - max-frequency: maximum operating clock frequency
+- keep-power-in-suspend: Preserves card power during a suspend/resume cycle
+- enable-sdio-wakeup: Enables wake up of host system on SDIO IRQ assertion
 
 Example:
 
@@ -33,4 +35,6 @@ sdhci@ab000000 {
 	cd-inverted;
 	wp-gpios = <&gpio 70 0>;
 	max-frequency = <50000000>;
+	keep-power-in-suspend;
+	enable-sdio-wakeup;
 }
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] mmc: sdhci-pltfm: Support optional pm properties
  2012-11-19  4:56 [PATCH 0/4] Support for optional MMC PM capabilities Abhilash Kesavan
  2012-11-19  4:56 ` [PATCH 1/4] mmc: dt: Fix typo in filename Abhilash Kesavan
  2012-11-19  4:56 ` [PATCH 2/4] mmc: dt: Add optional pm properties to core binding Abhilash Kesavan
@ 2012-11-19  4:56 ` Abhilash Kesavan
  2012-11-19  4:56 ` [PATCH 4/4] mmc: dw_mmc: Add sdio power bindings Abhilash Kesavan
  2012-11-25 20:06 ` [PATCH 0/4] Support for optional MMC PM capabilities Chris Ball
  4 siblings, 0 replies; 6+ messages in thread
From: Abhilash Kesavan @ 2012-11-19  4:56 UTC (permalink / raw)
  To: cjb, linux-mmc

Add support for optional pm capabilities such as MMC_PM_KEEP_POWER
and MMC_PM_WAKE_SDIO_IRQ.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
---
 drivers/mmc/host/sdhci-pltfm.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 2716445..c6c3b12 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -89,6 +89,12 @@ void sdhci_get_of_property(struct platform_device *pdev)
 		clk = of_get_property(np, "clock-frequency", &size);
 		if (clk && size == sizeof(*clk) && *clk)
 			pltfm_host->clock = be32_to_cpup(clk);
+
+		if (of_find_property(np, "keep-power-in-suspend", NULL))
+			host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
+
+		if (of_find_property(np, "enable-sdio-wakeup", NULL))
+			host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
 	}
 }
 #else
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] mmc: dw_mmc: Add sdio power bindings
  2012-11-19  4:56 [PATCH 0/4] Support for optional MMC PM capabilities Abhilash Kesavan
                   ` (2 preceding siblings ...)
  2012-11-19  4:56 ` [PATCH 3/4] mmc: sdhci-pltfm: Support optional pm properties Abhilash Kesavan
@ 2012-11-19  4:56 ` Abhilash Kesavan
  2012-11-25 20:06 ` [PATCH 0/4] Support for optional MMC PM capabilities Chris Ball
  4 siblings, 0 replies; 6+ messages in thread
From: Abhilash Kesavan @ 2012-11-19  4:56 UTC (permalink / raw)
  To: cjb, linux-mmc

Add dt-based retrieval of host sdio pm capabilities. Based on
the dt based discovery do a bus init in the resume function.

Signed-off-by: Olof Johansson <olofj@chromium.org>
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
---
 drivers/mmc/host/dw_mmc.c  |   20 +++++++++++++++++---
 include/linux/mmc/dw_mmc.h |    1 +
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 5b41348..7342029 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -617,13 +617,13 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg)
 		cmd, arg, cmd_status);
 }
 
-static void dw_mci_setup_bus(struct dw_mci_slot *slot)
+static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit)
 {
 	struct dw_mci *host = slot->host;
 	u32 div;
 	u32 clk_en_a;
 
-	if (slot->clock != host->current_speed) {
+	if (slot->clock != host->current_speed || force_clkinit) {
 		div = host->bus_hz / slot->clock;
 		if (host->bus_hz % slot->clock && host->bus_hz > slot->clock)
 			/*
@@ -684,7 +684,7 @@ static void __dw_mci_start_request(struct dw_mci *host,
 		host->pdata->select_slot(slot->id);
 
 	/* Slot specific timing and width adjustment */
-	dw_mci_setup_bus(slot);
+	dw_mci_setup_bus(slot, false);
 
 	host->cur_slot = slot;
 	host->mrq = mrq;
@@ -1850,6 +1850,9 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 	if (host->pdata->caps)
 		mmc->caps = host->pdata->caps;
 
+	if (host->pdata->pm_caps)
+		mmc->pm_caps = host->pdata->pm_caps;
+
 	if (host->dev->of_node) {
 		ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");
 		if (ctrl_id < 0)
@@ -2072,6 +2075,12 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
 			return ERR_PTR(ret);
 	}
 
+	if (of_find_property(np, "keep-power-in-suspend", NULL))
+		pdata->pm_caps |= MMC_PM_KEEP_POWER;
+
+	if (of_find_property(np, "enable-sdio-wakeup", NULL))
+		pdata->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
+
 	return pdata;
 }
 
@@ -2411,6 +2420,11 @@ int dw_mci_resume(struct dw_mci *host)
 		struct dw_mci_slot *slot = host->slot[i];
 		if (!slot)
 			continue;
+		if (slot->mmc->pm_flags & MMC_PM_KEEP_POWER) {
+			dw_mci_set_ios(slot->mmc, &slot->mmc->ios);
+			dw_mci_setup_bus(slot, true);
+		}
+
 		ret = mmc_resume_host(host->slot[i]->mmc);
 		if (ret < 0)
 			return ret;
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index a5498dc..34be4f4 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -231,6 +231,7 @@ struct dw_mci_board {
 
 	u32 caps;	/* Capabilities */
 	u32 caps2;	/* More capabilities */
+	u32 pm_caps;	/* PM capabilities */
 	/*
 	 * Override fifo depth. If 0, autodetect it from the FIFOTH register,
 	 * but note that this may not be reliable after a bootloader has used
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] Support for optional MMC PM capabilities
  2012-11-19  4:56 [PATCH 0/4] Support for optional MMC PM capabilities Abhilash Kesavan
                   ` (3 preceding siblings ...)
  2012-11-19  4:56 ` [PATCH 4/4] mmc: dw_mmc: Add sdio power bindings Abhilash Kesavan
@ 2012-11-25 20:06 ` Chris Ball
  4 siblings, 0 replies; 6+ messages in thread
From: Chris Ball @ 2012-11-25 20:06 UTC (permalink / raw)
  To: Abhilash Kesavan; +Cc: linux-mmc

Hi,

On Sun, Nov 18 2012, Abhilash Kesavan wrote:
> This patchset adds optional PM properties to the core MMC bindings. It also
> makes the appropriate changes in the sdhci platform and dw_mmc driver files.
> Based on git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git : for-next.
> Note: Patch 3 has only been compile tested.

Perfect, thanks for doing that -- pushed to mmc-next for 3.8.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-25 20:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-19  4:56 [PATCH 0/4] Support for optional MMC PM capabilities Abhilash Kesavan
2012-11-19  4:56 ` [PATCH 1/4] mmc: dt: Fix typo in filename Abhilash Kesavan
2012-11-19  4:56 ` [PATCH 2/4] mmc: dt: Add optional pm properties to core binding Abhilash Kesavan
2012-11-19  4:56 ` [PATCH 3/4] mmc: sdhci-pltfm: Support optional pm properties Abhilash Kesavan
2012-11-19  4:56 ` [PATCH 4/4] mmc: dw_mmc: Add sdio power bindings Abhilash Kesavan
2012-11-25 20:06 ` [PATCH 0/4] Support for optional MMC PM capabilities Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.