Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1593404
| From | Romain Perier <romain.perier@collabora.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 3/4] mmc: pwrseq_simple: Add an optional pre-power-on-delay |
| Date | 2017-03-06 15:20 +0100 |
| Message-ID | <ti1Ev-V3-31@gated-at.bofh.it> (permalink) |
| References | <ti1Et-V3-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Some devices need a while between the enablement of its clk and the time
where the reset line is asserted. When this time happens between the
pre_power_on and the post_power_on callbacks, there is a need to do an
msleep at the end of the pre_power_on callback.
This commit adds an optional DT property for such devices.
Signed-off-by: Romain Perier <romain.perier@collabora.com>
---
Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt | 2 ++
drivers/mmc/core/pwrseq_simple.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt
index e254368..821feaaf 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt
@@ -18,6 +18,8 @@ Optional properties:
"ext_clock" (External clock provided to the card).
- post-power-on-delay-ms : Delay in ms after powering the card and
de-asserting the reset-gpios (if any)
+- pre-power-on-delay-ms : Delay in ms before powering the card and
+ asserting the reset-gpios (if any)
Example:
diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c
index e27019f..d8d7166 100644
--- a/drivers/mmc/core/pwrseq_simple.c
+++ b/drivers/mmc/core/pwrseq_simple.c
@@ -27,6 +27,7 @@ struct mmc_pwrseq_simple {
struct mmc_pwrseq pwrseq;
bool clk_enabled;
u32 post_power_on_delay_ms;
+ u32 pre_power_on_delay_ms;
struct clk *ext_clk;
struct gpio_descs *reset_gpios;
};
@@ -60,6 +61,9 @@ static void mmc_pwrseq_simple_pre_power_on(struct mmc_host *host)
}
mmc_pwrseq_simple_set_gpios_value(pwrseq, 1);
+
+ if (pwrseq->pre_power_on_delay_ms)
+ msleep(pwrseq->pre_power_on_delay_ms);
}
static void mmc_pwrseq_simple_post_power_on(struct mmc_host *host)
@@ -130,6 +134,8 @@ static int mmc_pwrseq_simple_probe(struct platform_device *pdev)
device_property_read_u32(dev, "post-power-on-delay-ms",
&pwrseq->post_power_on_delay_ms);
+ device_property_read_u32(dev, "pre-power-on-delay-ms",
+ &pwrseq->pre_power_on_delay_ms);
pwrseq->pwrseq.dev = dev;
if (device_property_read_bool(dev, "post-ios-power-on"))
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/4] mmc: pwrseq: post_ios power sequence Romain Perier <romain.perier@collabora.com> - 2017-03-06 15:20 +0100 [PATCH v2 1/4] mmc: core: Add post_ios_power_on callback for power sequences Romain Perier <romain.perier@collabora.com> - 2017-03-06 15:20 +0100 [PATCH v2 3/4] mmc: pwrseq_simple: Add an optional pre-power-on-delay Romain Perier <romain.perier@collabora.com> - 2017-03-06 15:20 +0100 [PATCH v2 4/4] arm: dts: rockchip: Enable post_ios_power_on and pre-power-on-delay-ms Romain Perier <romain.perier@collabora.com> - 2017-03-06 15:30 +0100
csiph-web