lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1369244832-23868-3-git-send-email-eu@felipetonello.com>
Date:	Wed, 22 May 2013 10:47:12 -0700
From:	"Felipe F. Tonello" <eu@...ipetonello.com>
To:	linux-mmc@...r.kernel.org
Cc:	ben-linux@...ff.org, cjb@...top.org, arnd@...db.de,
	linux-kernel@...r.kernel.org,
	"Felipe F. Tonello" <eu@...ipetonello.com>
Subject: [PATCH 2/2] mmc: sdhci-s3c: Added set_power handler to platdata

From: "Felipe F. Tonello" <eu@...ipetonello.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@...ipetonello.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ