All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ohad Ben-Cohen <ohad@wizery.com>
To: <linux-wireless@vger.kernel.org>, <linux-mmc@vger.kernel.org>
Cc: Luciano Coelho <luciano.coelho@nokia.com>,
	<akpm@linux-foundation.org>, San Mehat <san@google.com>,
	Roger Quadros <roger.quadros@nokia.com>,
	Nicolas Pitre <nico@fluxnic.net>,
	Gao Yunpeng <yunpeng.gao@intel.com>,
	Ohad Ben-Cohen <ohad@wizery.com>
Subject: [PATCH v1 6/8] sdio: enable Runtime PM for SDIO cards
Date: Tue,  7 Sep 2010 14:29:07 +0300	[thread overview]
Message-ID: <1283858949-11073-7-git-send-email-ohad@wizery.com> (raw)
In-Reply-To: <1283858949-11073-1-git-send-email-ohad@wizery.com>

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 <ohad@wizery.com>
---
 drivers/mmc/core/sdio.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index c118cc2..a5a76a8 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>
@@ -709,6 +710,15 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
 	card = host->card;
 
 	/*
+	 * Enable Runtime PM for this card
+	 */
+	err = pm_runtime_set_active(&card->dev);
+	if (err)
+		goto remove;
+
+	pm_runtime_enable(&card->dev);
+
+	/*
 	 * The number of functions on the card is encoded inside
 	 * the ocr.
 	 */
-- 
1.7.0.4


WARNING: multiple messages have this Message-ID (diff)
From: Ohad Ben-Cohen <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
To: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Luciano Coelho
	<luciano.coelho-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	San Mehat <san-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Roger Quadros
	<roger.quadros-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>,
	Nicolas Pitre <nico-vtqb6HGKxmzR7s880joybQ@public.gmane.org>,
	Gao Yunpeng <yunpeng.gao-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Ohad Ben-Cohen <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
Subject: [PATCH v1 6/8] sdio: enable Runtime PM for SDIO cards
Date: Tue,  7 Sep 2010 14:29:07 +0300	[thread overview]
Message-ID: <1283858949-11073-7-git-send-email-ohad@wizery.com> (raw)
In-Reply-To: <1283858949-11073-1-git-send-email-ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>

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 <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>
---
 drivers/mmc/core/sdio.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index c118cc2..a5a76a8 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>
@@ -709,6 +710,15 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
 	card = host->card;
 
 	/*
+	 * Enable Runtime PM for this card
+	 */
+	err = pm_runtime_set_active(&card->dev);
+	if (err)
+		goto remove;
+
+	pm_runtime_enable(&card->dev);
+
+	/*
 	 * The number of functions on the card is encoded inside
 	 * the ocr.
 	 */
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-09-07 11:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07 11:29 [PATCH v1 0/8] SDIO Runtime PM Support Ohad Ben-Cohen
2010-09-07 11:29 ` Ohad Ben-Cohen
2010-09-07 11:29 ` [PATCH v1 1/8] mmc: sdio: fully reconfigure oldcard on resume Ohad Ben-Cohen
2010-09-07 11:29   ` Ohad Ben-Cohen
2010-09-07 11:29 ` [PATCH v1 2/8] mmc: propagate power save/restore ops return value Ohad Ben-Cohen
2010-09-07 11:29   ` Ohad Ben-Cohen
2010-09-07 11:29 ` [PATCH v1 3/8] sdio: add power_restore support Ohad Ben-Cohen
2010-09-07 11:29   ` Ohad Ben-Cohen
2010-09-07 11:29 ` [PATCH v1 4/8] mmc: add general Runtime PM support Ohad Ben-Cohen
2010-09-07 11:29   ` Ohad Ben-Cohen
2010-09-07 11:29 ` [PATCH v1 5/8] sdio: add general runtime " Ohad Ben-Cohen
2010-09-07 11:29   ` Ohad Ben-Cohen
2010-09-07 11:29 ` Ohad Ben-Cohen [this message]
2010-09-07 11:29   ` [PATCH v1 6/8] sdio: enable Runtime PM for SDIO cards Ohad Ben-Cohen
2010-09-07 11:29 ` [PATCH v1 7/8] sdio: enable Runtime PM for SDIO functions Ohad Ben-Cohen
2010-09-07 11:29   ` Ohad Ben-Cohen
2010-09-14 19:27   ` Chris Ball
2010-09-14 19:27     ` Chris Ball
2010-09-14 19:32     ` Ohad Ben-Cohen
2010-09-14 19:32       ` Ohad Ben-Cohen
2010-09-07 11:29 ` [PATCH v1 8/8] wireless: wl1271_sdio: enable Runtime PM Ohad Ben-Cohen
2010-09-07 11:29   ` Ohad Ben-Cohen
2010-09-07 13:02   ` David Vrabel
2010-09-07 13:02     ` David Vrabel
2010-09-07 13:15     ` Ohad Ben-Cohen
2010-09-07 22:20       ` David Vrabel
2010-09-08 17:40   ` Luciano Coelho
2010-09-08 17:40     ` Luciano Coelho
2010-09-08 17:52 ` [PATCH v1 0/8] SDIO Runtime PM Support Luciano Coelho

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=1283858949-11073-7-git-send-email-ohad@wizery.com \
    --to=ohad@wizery.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@nokia.com \
    --cc=nico@fluxnic.net \
    --cc=roger.quadros@nokia.com \
    --cc=san@google.com \
    --cc=yunpeng.gao@intel.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 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.