* [PATCH resend 0/1] mmc: pwrseq-simple: Add an optional post-power-on-delay
@ 2016-08-07 19:02 Hans de Goede
2016-08-07 19:02 ` [PATCH resend] " Hans de Goede
0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2016-08-07 19:02 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring
Cc: devicetree, linux-mmc, Chen-Yu Tsai, Icenowy Zheng, Maxime Ripard,
linux-arm-kernel
Hi Ulf, Rob,
Here is a resend of a patch from me from a couple of weeks ago.
There was some discussion about this back then, but if I understood
correctly, the end-conclusion was that Rob was ok with this change
(with the caveat that we should not add 6 more confgurable delays
at other points to the -simple binding later).
Rob have I understood that correctly, if so can we please have your
ack for the dt bits of this ?
Ulf can you review and if ok merge this once we've Rob's ack ?
Thanks & Regards,
Hans
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH resend] mmc: pwrseq-simple: Add an optional post-power-on-delay
2016-08-07 19:02 [PATCH resend 0/1] mmc: pwrseq-simple: Add an optional post-power-on-delay Hans de Goede
@ 2016-08-07 19:02 ` Hans de Goede
2016-08-10 18:58 ` Rob Herring
2016-08-22 13:38 ` Ulf Hansson
0 siblings, 2 replies; 4+ messages in thread
From: Hans de Goede @ 2016-08-07 19:02 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring
Cc: devicetree, linux-mmc, Hans de Goede, Chen-Yu Tsai, Icenowy Zheng,
Maxime Ripard, linux-arm-kernel
Some devices need a while to boot their firmware after providing clks /
de-asserting resets before they are ready to receive sdio commands.
This commits adds a post-power-on-delay-ms devicetree property to
mmc-pwrseq-simple for use with such devices.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt | 2 ++
drivers/mmc/core/pwrseq_simple.c | 9 +++++++++
2 files changed, 11 insertions(+)
diff --git a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt
index ce0e767..e254368 100644
--- a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt
@@ -16,6 +16,8 @@ Optional properties:
See ../clocks/clock-bindings.txt for details.
- clock-names : Must include the following entry:
"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)
Example:
diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c
index 450d907..1304160 100644
--- a/drivers/mmc/core/pwrseq_simple.c
+++ b/drivers/mmc/core/pwrseq_simple.c
@@ -16,6 +16,8 @@
#include <linux/device.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
+#include <linux/delay.h>
+#include <linux/property.h>
#include <linux/mmc/host.h>
@@ -24,6 +26,7 @@
struct mmc_pwrseq_simple {
struct mmc_pwrseq pwrseq;
bool clk_enabled;
+ u32 post_power_on_delay_ms;
struct clk *ext_clk;
struct gpio_descs *reset_gpios;
};
@@ -64,6 +67,9 @@ static void mmc_pwrseq_simple_post_power_on(struct mmc_host *host)
struct mmc_pwrseq_simple *pwrseq = to_pwrseq_simple(host->pwrseq);
mmc_pwrseq_simple_set_gpios_value(pwrseq, 0);
+
+ if (pwrseq->post_power_on_delay_ms)
+ msleep(pwrseq->post_power_on_delay_ms);
}
static void mmc_pwrseq_simple_power_off(struct mmc_host *host)
@@ -111,6 +117,9 @@ static int mmc_pwrseq_simple_probe(struct platform_device *pdev)
return PTR_ERR(pwrseq->reset_gpios);
}
+ device_property_read_u32(dev, "post-power-on-delay-ms",
+ &pwrseq->post_power_on_delay_ms);
+
pwrseq->pwrseq.dev = dev;
pwrseq->pwrseq.ops = &mmc_pwrseq_simple_ops;
pwrseq->pwrseq.owner = THIS_MODULE;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH resend] mmc: pwrseq-simple: Add an optional post-power-on-delay
2016-08-07 19:02 ` [PATCH resend] " Hans de Goede
@ 2016-08-10 18:58 ` Rob Herring
2016-08-22 13:38 ` Ulf Hansson
1 sibling, 0 replies; 4+ messages in thread
From: Rob Herring @ 2016-08-10 18:58 UTC (permalink / raw)
To: Hans de Goede
Cc: devicetree, Ulf Hansson, linux-mmc, Chen-Yu Tsai, Icenowy Zheng,
Maxime Ripard, linux-arm-kernel
On Sun, Aug 07, 2016 at 09:02:38PM +0200, Hans de Goede wrote:
> Some devices need a while to boot their firmware after providing clks /
> de-asserting resets before they are ready to receive sdio commands.
>
> This commits adds a post-power-on-delay-ms devicetree property to
> mmc-pwrseq-simple for use with such devices.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt | 2 ++
> drivers/mmc/core/pwrseq_simple.c | 9 +++++++++
> 2 files changed, 11 insertions(+)
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH resend] mmc: pwrseq-simple: Add an optional post-power-on-delay
2016-08-07 19:02 ` [PATCH resend] " Hans de Goede
2016-08-10 18:58 ` Rob Herring
@ 2016-08-22 13:38 ` Ulf Hansson
1 sibling, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2016-08-22 13:38 UTC (permalink / raw)
To: Hans de Goede
Cc: devicetree, linux-mmc, Chen-Yu Tsai, Rob Herring, Icenowy Zheng,
Maxime Ripard, linux-arm-kernel@lists.infradead.org
On 7 August 2016 at 21:02, Hans de Goede <hdegoede@redhat.com> wrote:
> Some devices need a while to boot their firmware after providing clks /
> de-asserting resets before they are ready to receive sdio commands.
>
> This commits adds a post-power-on-delay-ms devicetree property to
> mmc-pwrseq-simple for use with such devices.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Thanks, applied for next!
Kind regards
Uffe
> ---
> Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt | 2 ++
> drivers/mmc/core/pwrseq_simple.c | 9 +++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt
> index ce0e767..e254368 100644
> --- a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt
> +++ b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt
> @@ -16,6 +16,8 @@ Optional properties:
> See ../clocks/clock-bindings.txt for details.
> - clock-names : Must include the following entry:
> "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)
>
> Example:
>
> diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c
> index 450d907..1304160 100644
> --- a/drivers/mmc/core/pwrseq_simple.c
> +++ b/drivers/mmc/core/pwrseq_simple.c
> @@ -16,6 +16,8 @@
> #include <linux/device.h>
> #include <linux/err.h>
> #include <linux/gpio/consumer.h>
> +#include <linux/delay.h>
> +#include <linux/property.h>
>
> #include <linux/mmc/host.h>
>
> @@ -24,6 +26,7 @@
> struct mmc_pwrseq_simple {
> struct mmc_pwrseq pwrseq;
> bool clk_enabled;
> + u32 post_power_on_delay_ms;
> struct clk *ext_clk;
> struct gpio_descs *reset_gpios;
> };
> @@ -64,6 +67,9 @@ static void mmc_pwrseq_simple_post_power_on(struct mmc_host *host)
> struct mmc_pwrseq_simple *pwrseq = to_pwrseq_simple(host->pwrseq);
>
> mmc_pwrseq_simple_set_gpios_value(pwrseq, 0);
> +
> + if (pwrseq->post_power_on_delay_ms)
> + msleep(pwrseq->post_power_on_delay_ms);
> }
>
> static void mmc_pwrseq_simple_power_off(struct mmc_host *host)
> @@ -111,6 +117,9 @@ static int mmc_pwrseq_simple_probe(struct platform_device *pdev)
> return PTR_ERR(pwrseq->reset_gpios);
> }
>
> + device_property_read_u32(dev, "post-power-on-delay-ms",
> + &pwrseq->post_power_on_delay_ms);
> +
> pwrseq->pwrseq.dev = dev;
> pwrseq->pwrseq.ops = &mmc_pwrseq_simple_ops;
> pwrseq->pwrseq.owner = THIS_MODULE;
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-08-22 13:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-07 19:02 [PATCH resend 0/1] mmc: pwrseq-simple: Add an optional post-power-on-delay Hans de Goede
2016-08-07 19:02 ` [PATCH resend] " Hans de Goede
2016-08-10 18:58 ` Rob Herring
2016-08-22 13:38 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).