linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Felipe F. Tonello" <eu@felipetonello.com>
To: linux-mmc@vger.kernel.org
Cc: ben-linux@fluff.org, cjb@laptop.org, arnd@arndb.de,
	linux-kernel@vger.kernel.org,
	"Felipe F. Tonello" <eu@felipetonello.com>
Subject: [PATCH 2/2] mmc: sdhci-s3c: Added set_power handler to platdata
Date: Wed, 22 May 2013 10:47:12 -0700	[thread overview]
Message-ID: <1369244832-23868-3-git-send-email-eu@felipetonello.com> (raw)
In-Reply-To: <1369244832-23868-1-git-send-email-eu@felipetonello.com>

From: "Felipe F. Tonello" <eu@felipetonello.com>

This is useful to turn off peripherals that are related to the mmc host. One
common case is when the wifi module is connected as an mmc card to the host.

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
---
 drivers/mmc/host/sdhci-s3c.c                | 8 ++++++++
 include/linux/platform_data/mmc-sdhci-s3c.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index c6f6246..f7e740c 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -360,11 +360,19 @@ static int sdhci_s3c_platform_bus_width(struct sdhci_host *host, int width)
 	return 0;
 }
 
+static void sdhci_s3c_set_power(struct sdhci_host *host, bool power)
+{
+	struct sdhci_s3c *ourhost = to_s3c(host);
+	if (ourhost->pdata->set_power)
+		ourhost->pdata->set_power(power);
+}
+
 static struct sdhci_ops sdhci_s3c_ops = {
 	.get_max_clock		= sdhci_s3c_get_max_clk,
 	.set_clock		= sdhci_s3c_set_clock,
 	.get_min_clock		= sdhci_s3c_get_min_clock,
 	.platform_bus_width	= sdhci_s3c_platform_bus_width,
+	.set_power		= sdhci_s3c_set_power,
 };
 
 static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
diff --git a/include/linux/platform_data/mmc-sdhci-s3c.h b/include/linux/platform_data/mmc-sdhci-s3c.h
index 249f023..55be925 100644
--- a/include/linux/platform_data/mmc-sdhci-s3c.h
+++ b/include/linux/platform_data/mmc-sdhci-s3c.h
@@ -50,6 +50,7 @@ struct s3c_sdhci_platdata {
 						      int state));
 
 	void	(*cfg_gpio)(struct platform_device *dev, int width);
+	void	(*set_power)(bool power);
 };
 
 
-- 
1.8.1.4

  parent reply	other threads:[~2013-05-22 17:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 17:47 [PATCH 0/2] Added set_power handler to mmc sdhci host Felipe F. Tonello
2013-05-22 17:47 ` [PATCH 1/2] mmc: sdhci: Added set_power sdhci_ops handler Felipe F. Tonello
2013-05-22 20:30   ` Guennadi Liakhovetski
2013-05-22 21:22     ` Felipe Ferreri Tonello
2013-05-23  7:25       ` Guennadi Liakhovetski
2013-05-24  4:02         ` Jaehoon Chung
2013-05-24 22:12           ` Felipe Tonello
2013-05-22 17:47 ` Felipe F. Tonello [this message]
2013-05-24  3:57   ` [PATCH 2/2] mmc: sdhci-s3c: Added set_power handler to platdata Jaehoon Chung

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=1369244832-23868-3-git-send-email-eu@felipetonello.com \
    --to=eu@felipetonello.com \
    --cc=arnd@arndb.de \
    --cc=ben-linux@fluff.org \
    --cc=cjb@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@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).