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]
Date:	Mon, 10 Dec 2012 08:55:54 +0000
From:	Lee Jones <lee.jones@...aro.org>
To:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc:	arnd@...db.de, linus.walleij@...ricsson.com,
	ulf.hansson@...aro.org, Lee Jones <lee.jones@...aro.org>,
	Chris Ball <cjb@...top.org>,
	Russell King <rmk+kernel@....linux.org.uk>
Subject: [PATCH 05/12] mmc: mmci: Move ios_handler functionality into the driver

There are currently two instances of the ios_handler being used.
Both of which mearly toy with some regulator settings. Now there
is a GPIO regulator API, we can use that instead, and lessen the
per platform burden. By doing this, we also become more Device
Tree compatible.

Cc: Chris Ball <cjb@...top.org>
Cc: Russell King <rmk+kernel@....linux.org.uk>
Acked-by: Ulf Hansson <ulf.hansson@...ricsson.com>
Signed-off-by: Lee Jones <lee.jones@...aro.org>
---
 drivers/mmc/host/mmci.c |   22 ++++++++++++++++++++++
 drivers/mmc/host/mmci.h |    1 +
 2 files changed, 23 insertions(+)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index edc3e9b..d45c931 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1091,6 +1091,16 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	case MMC_POWER_OFF:
 		if (host->vcc)
 			ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
+
+		if (host->vqmmc) {
+			if (regulator_is_enabled(host->vqmmc)) {
+				ret = regulator_disable(host->vqmmc);
+				if (ret < 0)
+					dev_warn(mmc_dev(mmc),
+						 "unable to disable vmmc-ios\n");
+			}
+		}
+
 		break;
 	case MMC_POWER_UP:
 		if (host->vcc) {
@@ -1115,6 +1125,14 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 
 		break;
 	case MMC_POWER_ON:
+		if (host->vqmmc)
+			if (!regulator_is_enabled(host->vqmmc)) {
+				ret = regulator_enable(host->vqmmc);
+				if (ret < 0)
+					dev_warn(mmc_dev(mmc),
+						 "unable to enable vmmc-ios\n");
+			}
+
 		pwr |= MCI_PWR_ON;
 		break;
 	}
@@ -1379,6 +1397,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
 				 "(using regulator instead)\n");
 		}
 	}
+
+	host->vqmmc = regulator_get(&dev->dev, "vqmmc");
+	if (IS_ERR(host->vqmmc))
+		host->vqmmc = NULL;
 #endif
 	/* Fall back to platform data if no regulator is found */
 	if (host->vcc == NULL)
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
index d437ccf..b87d9e2 100644
--- a/drivers/mmc/host/mmci.h
+++ b/drivers/mmc/host/mmci.h
@@ -194,6 +194,7 @@ struct mmci_host {
 	struct sg_mapping_iter	sg_miter;
 	unsigned int		size;
 	struct regulator	*vcc;
+	struct regulator	*vqmmc;
 
 #ifdef CONFIG_DMA_ENGINE
 	/* DMA stuff */
-- 
1.7.9.5

--
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