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-next>] [day] [month] [year] [list]
Message-Id: <1381961999-8187-1-git-send-email-alexandre.belloni@free-electrons.com>
Date:	Thu, 17 Oct 2013 00:19:59 +0200
From:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>
To:	Ludovic Desroches <ludovic.desroches@...el.com>
Cc:	Chris Ball <cjb@...top.org>, linux-mmc@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Alexandre Belloni <alexandre.belloni@...e-electrons.com>
Subject: [PATCHv2] mmc: atmel-mci: add vmmc-supply support

Other MMC hosts handle a regulator named vmmc-supply that allows to power the
MMC card or SDIO device before communicating on the bus.

Signed-off-by: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
---

Changes in v2:
 - use mmc_regulator_get_supply instead of devm_regulator_get

 drivers/mmc/host/atmel-mci.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 69e438e..4ea5333 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -23,6 +23,7 @@
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
 #include <linux/platform_device.h>
+#include <linux/regulator/consumer.h>
 #include <linux/scatterlist.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
@@ -2198,6 +2199,14 @@ static int __init atmci_init_slot(struct atmel_mci *host,
 	host->slot[id] = slot;
 	mmc_add_host(mmc);
 
+	mmc_regulator_get_supply(mmc);
+	if (!IS_ERR(mmc->supply.vmmc)) {
+		int ret = regulator_enable(mmc->supply.vmmc);
+		if (ret)
+			dev_err(&mmc->class_dev,
+				"failed to enable regulator: %d\n", ret);
+	}
+
 	if (gpio_is_valid(slot->detect_pin)) {
 		int ret;
 
-- 
1.8.1.2

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