Add optional device-post-power-on parameters to disable post_power_on function from being called since this breaks some device. Cc: Tony Lindgren <tony@xxxxxxxxxxx> Cc: Ulf Hansson <ulf.hansson@xxxxxxxxxx> Signed-off-by: Matt Ranostay <matt@ranostay.consulting> --- Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt | 2 ++ drivers/mmc/core/pwrseq_simple.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt index bea306d772d1..09fa153f743e 100644 --- a/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt +++ b/Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt @@ -24,6 +24,8 @@ Optional properties: de-asserting the reset-gpios (if any) - invert-off-state: Invert the power down state for the reset-gpios (if any) and pwrdn-gpios (if any) +- disable-post-power-on : Avoid post_power_on function from being called since + this breaks some devices Example: diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c index 857dde3e0456..d34084c51f9c 100644 --- a/drivers/mmc/core/pwrseq_simple.c +++ b/drivers/mmc/core/pwrseq_simple.c @@ -26,6 +26,7 @@ struct mmc_pwrseq_simple { struct mmc_pwrseq pwrseq; bool clk_enabled; + bool disable_post_power_on; bool invert_off_state; u32 pre_power_on_delay_ms; u32 post_power_on_delay_ms; @@ -72,6 +73,9 @@ static void mmc_pwrseq_simple_post_power_on(struct mmc_host *host) { struct mmc_pwrseq_simple *pwrseq = to_pwrseq_simple(host->pwrseq); + if (pwrseq->disable_post_power_on) + return; + mmc_pwrseq_simple_set_gpios_value(pwrseq, pwrseq->reset_gpios, 0); if (pwrseq->post_power_on_delay_ms) @@ -139,6 +143,9 @@ 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); + if (device_property_read_bool(dev, "disable-post-power-on")) + pwrseq->disable_post_power_on = true; + pwrseq->pwrseq.dev = dev; pwrseq->pwrseq.ops = &mmc_pwrseq_simple_ops; pwrseq->pwrseq.owner = THIS_MODULE; -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html