>From 14846672ff47a07df0c8ddfdae528ca3ea943e42 Mon Sep 17 00:00:00 2001
From: Ohad Ben-Cohen <[email protected]>
Date: Wed, 11 Aug 2010 11:22:16 +0300
Subject: [PATCH 20/26] sdio: enable runtime PM for SDIO cards

Enable runtime PM for new SDIO cards.

As soon as the card will be added to the device tree, runtime PM core
will release its power, since it doesn't have any users yet.

Signed-off-by: Ohad Ben-Cohen <[email protected]>
Signed-off-by: Claude Brouat <[email protected]>
---
 drivers/mmc/core/sdio.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 3a6c743..241d140 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -10,6 +10,7 @@
  */

 #include <linux/err.h>
+#include <linux/pm_runtime.h>

 #include <linux/mmc/host.h>
 #include <linux/mmc/card.h>
@@ -581,6 +582,18 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
     card = host->card;

     /*
+    * Let runtime PM core know our card is active
+    */
+    err = pm_runtime_set_active(&card->dev);
+    if (err)
+          goto remove;
+
+    /*
+    * Enable runtime PM for this card
+    */
+    pm_runtime_enable(&card->dev);
+
+    /*
      * The number of functions on the card is encoded inside
      * the ocr.
      */
--
1.6.3.3




Claude BROUAT
UMG/MIPE/WSIV  System Integrator
Office:    +33 (0)1 72 21 04 54
mailto: mailto:[email protected]

Intel Corp. SAS
134, av du Général Eisenhower
BP 73586
31100 TOULOUSE
France



---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Attachment: 0020-sdio-enable-runtime-PM-for-SDIO-cards.patch
Description: 0020-sdio-enable-runtime-PM-for-SDIO-cards.patch

_______________________________________________
Meego-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to