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:	Thu, 15 Jan 2015 17:12:20 +0100
From:	Tomeu Vizoso <tomeu.vizoso@...labora.com>
To:	linux-tegra@...r.kernel.org
Cc:	Javier Martinez Canillas <javier.martinez@...labora.co.uk>,
	Dylan Reid <dgreid@...omium.org>,
	Simon Glass <sjg@...omium.org>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Tomeu Vizoso <tomeu.vizoso@...labora.com>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Chris Ball <chris@...ntf.net>, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-mmc@...r.kernel.org
Subject: [PATCH v2 08/11] mmc: pwrseq_simple: Add support for a delay

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@...labora.com>
---
 Documentation/devicetree/bindings/mmc/mmc,pwrseq-simple.txt | 2 ++
 drivers/mmc/core/pwrseq_simple.c                            | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/mmc/mmc,pwrseq-simple.txt b/Documentation/devicetree/bindings/mmc/mmc,pwrseq-simple.txt
index 6fe0cd6..b353381 100644
--- a/Documentation/devicetree/bindings/mmc/mmc,pwrseq-simple.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc,pwrseq-simple.txt
@@ -14,10 +14,12 @@ Required properties:
 Optional properties:
 - reset-gpios : contains a list of GPIO specifiers, though currently only one
 		specifier is supported.
+- delay : delay to wait after driving the reset gpio active [ms].
 
 Example:
 
 	sdhci0_pwrseq {
 		compatible = "mmc,pwrseq-simple";
 		reset-gpios = <&gpio1 12 0>;
+		delay = <20>;
 	}
diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c
index 42d9836..3e521cc 100644
--- a/drivers/mmc/core/pwrseq_simple.c
+++ b/drivers/mmc/core/pwrseq_simple.c
@@ -12,14 +12,17 @@
 #include <linux/device.h>
 #include <linux/err.h>
 #include <linux/gpio/consumer.h>
+#include <linux/of_platform.h>
 
 #include <linux/mmc/host.h>
 
+#include "core.h"
 #include "pwrseq.h"
 
 struct mmc_pwrseq_simple {
 	struct mmc_pwrseq pwrseq;
 	struct gpio_desc *reset_gpio;
+	unsigned int delay_ms;
 };
 
 static void mmc_pwrseq_simple_pre_power_on(struct mmc_host *host)
@@ -29,6 +32,9 @@ static void mmc_pwrseq_simple_pre_power_on(struct mmc_host *host)
 
 	if (!IS_ERR(pwrseq->reset_gpio))
 		gpiod_set_value_cansleep(pwrseq->reset_gpio, 1);
+
+	if (pwrseq->delay_ms)
+		mmc_delay(pwrseq->delay_ms);
 }
 
 static void mmc_pwrseq_simple_post_power_on(struct mmc_host *host)
@@ -76,6 +82,8 @@ int mmc_pwrseq_simple_alloc(struct mmc_host *host, struct device *dev)
 		goto free;
 	}
 
+	of_property_read_u32(dev->of_node, "delay", &pwrseq->delay_ms);
+
 	pwrseq->pwrseq.ops = &mmc_pwrseq_simple_ops;
 	host->pwrseq = &pwrseq->pwrseq;
 
-- 
1.9.3

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