mmc: dw_mmc: add the vqmmc regulator
Subsystems (2)
Jaehoon Chung
maintainerPATCH 1/1 mmc: dw_mmc: add the vqmmc regulator
Add the "vqmmc" regulator into dw_mmc.c
This patch depend on below patches. ([PATCH v4 1/7] mmc: dw_mmc: use the mmc_of_parse() instead of local parser ~)
https://patchwork.kernel.org/patch/3750681/
https://patchwork.kernel.org/patch/3750691/
https://patchwork.kernel.org/patch/3750711/
https://patchwork.kernel.org/patch/3750701/
https://patchwork.kernel.org/patch/3750721/
https://patchwork.kernel.org/patch/3750731/
https://patchwork.kernel.org/patch/3750741/
--- drivers/mmc/host/dw_mmc.c | 34 ++++++++++++++++++++++++++++++++++ include/linux/mmc/dw_mmc.h | 1 + 2 files changed, 35 insertions(+)
drivers/mmc/host/dw_mmc.c +34 -0
@@ -2393,6 +2393,24 @@ int dw_mci_probe(struct dw_mci *host) } } + host->vqmmc =devm_regulator_get_optional (host->dev,"vqmmc" ); +if (IS_ERR (host->vqmmc)) { + ret =PTR_ERR (host->vqmmc); +if (ret == -EPROBE_DEFER ) + goto err_vqmmc; + +dev_info (host->dev,"no vqmmc regulator found: %d\n" , ret); + host->vqmmc =NULL ; + }else { + ret =regulator_enable (host->vqmmc); +if (ret) { +if (ret != -EPROBE_DEFER ) +dev_err (host->dev, +"regulator_enable fail: %d\n" , ret); + goto err_vqmmc; + } + } + host->quirks = host->pdata->quirks;spin_lock_init (&host->lock);
@@ -2536,6 +2554,9 @@ err_workqueue: err_dmaunmap:if (host->use_dma && host->dma_ops->exit) host->dma_ops->exit (host); +if (host->vqmmc) +regulator_disable (host->vqmmc); +err_vqmmc:if (host->vmmc)regulator_disable (host->vmmc);
@@ -2575,6 +2596,8 @@ void dw_mci_remove(struct dw_mci *host)if (host->vmmc)regulator_disable (host->vmmc); +if (host->vqmmc) +regulator_disable (host->vqmmc);if (!IS_ERR (host->ciu_clk))clk_disable_unprepare (host->ciu_clk);
@@ -2594,6 +2617,8 @@ int dw_mci_suspend(struct dw_mci *host) {if (host->vmmc)regulator_disable (host->vmmc); +if (host->vqmmc) +regulator_disable (host->vqmmc);return 0 ; }
@@ -2612,6 +2637,15 @@ int dw_mci_resume(struct dw_mci *host) } } +if (host->vqmmc) { + ret =regulator_enable (host->vqmmc); +if (ret) { +dev_err (host->dev, +"failed to enable regulator: %d\n" , ret); +return ret; + } + } +if (!dw_mci_ctrl_all_reset (host)) { ret = -ENODEV ;return ret;
include/linux/mmc/dw_mmc.h +1 -0
@@ -189,6 +189,7 @@ struct dw_mci {u32 quirks;struct regulator *vmmc;/* Power regulator */ +struct regulator *vqmmc;/* Signalling regulator */ unsigned long irq_flags;/* IRQ flags */ int irq; };
Signature · 1 line
1.7.9.5
Quoted 23 lines · Jaehoon Chung
Add the "vqmmc" regulator into
dw_mmc.cThis patch depend on below patches. ([PATCH v4 1/7] mmc:
dw_mmc: use themmc_of_parse()instead of local parser ~)https://patchwork.kernel.org/patch/3750681/
https://patchwork.kernel.org/patch/3750691/
https://patchwork.kernel.org/patch/3750711/
https://patchwork.kernel.org/patch/3750701/
https://patchwork.kernel.org/patch/3750721/
https://patchwork.kernel.org/patch/3750731/
https://patchwork.kernel.org/patch/3750741/Signed-off-by Jaehoon Chung <[email protected]>--- drivers/mmc/host/dw_mmc.c | 34 ++++++++++++++++++++++++++++++++++ include/linux/mmc/dw_mmc.h | 1 + 2 files changed, 35 insertions(+)drivers/mmc/host/dw_mmc.c +0
-0
drivers/mmc/host/dw_mmc.c int dw_mci_probe(struct dw_mci *host) · line 2396
Quoted 4 lines
drivers/mmc/host/dw_mmc.c +1
-0@@ -2393,6 +2393,24 @@ int dw_mci_probe(struct dw_mci *host) } } + host->vqmmc =devm_regulator_get_optional (host->dev,"vqmmc" );
I recommend you to convert to use mmc_regulator_get_supply() API instead.
Quoted 7 lines
drivers/mmc/host/dw_mmc.c +7
-0+if (IS_ERR (host->vqmmc)) { + ret =PTR_ERR (host->vqmmc); +if (ret == -EPROBE_DEFER ) + goto err_vqmmc; + +dev_info (host->dev,"no vqmmc regulator found: %d\n" , ret); + host->vqmmc =NULL ;
drivers/mmc/host/dw_mmc.c int dw_mci_probe(struct dw_mci *host) · line 2413
Quoted 10 lines
drivers/mmc/host/dw_mmc.c +10
-0+ }else { + ret =regulator_enable (host->vqmmc); +if (ret) { +if (ret != -EPROBE_DEFER ) +dev_err (host->dev, +"regulator_enable fail: %d\n" , ret); + goto err_vqmmc; + } + } +
Are there any specific reasons to why you don't want use the .set_ios callback to control this regulator?
Is seems wrong to do it from the probe(). I also realize that the same applies for the already existing vmmc regulator.
Quoted 60 lines
drivers/mmc/host/dw_mmc.c +16
-0host->quirks = host->pdata->quirks;spin_lock_init (&host->lock);@@ -2536,6 +2554,9 @@ err_workqueue: err_dmaunmap:if (host->use_dma && host->dma_ops->exit) host->dma_ops->exit (host); +if (host->vqmmc) +regulator_disable (host->vqmmc); +err_vqmmc:if (host->vmmc)regulator_disable (host->vmmc);@@ -2575,6 +2596,8 @@ void dw_mci_remove(struct dw_mci *host)if (host->vmmc)regulator_disable (host->vmmc); +if (host->vqmmc) +regulator_disable (host->vqmmc);if (!IS_ERR (host->ciu_clk))clk_disable_unprepare (host->ciu_clk);@@ -2594,6 +2617,8 @@ int dw_mci_suspend(struct dw_mci *host) {if (host->vmmc)regulator_disable (host->vmmc); +if (host->vqmmc) +regulator_disable (host->vqmmc);return 0 ; }@@ -2612,6 +2637,15 @@ int dw_mci_resume(struct dw_mci *host) } } +if (host->vqmmc) { + ret =regulator_enable (host->vqmmc); +if (ret) { +dev_err (host->dev, +"failed to enable regulator: %d\n" , ret); +return ret; + } + } +if (!dw_mci_ctrl_all_reset (host)) { ret = -ENODEV ;return ret;include/linux/mmc/dw_mmc.h +1
-1@@ -189,6 +189,7 @@ struct dw_mci {u32 quirks;struct regulator *vmmc;/* Power regulator */ +struct regulator *vqmmc;/* Signalling regulator */ unsigned long irq_flags;/* IRQ flags */ int irq; }; --
Quoted 1 line
1.7.9.5
Kind regards
Ulf Hansson
Jaehoon Chung
maintainerHi, Ulf.
Quoted 43 lines · Ulf Hansson
Quoted 23 lines · Jaehoon Chung
Add the "vqmmc" regulator into
dw_mmc.cThis patch depend on below patches. ([PATCH v4 1/7] mmc:
dw_mmc: use themmc_of_parse()instead of local parser ~)https://patchwork.kernel.org/patch/3750681/
https://patchwork.kernel.org/patch/3750691/
https://patchwork.kernel.org/patch/3750711/
https://patchwork.kernel.org/patch/3750701/
https://patchwork.kernel.org/patch/3750721/
https://patchwork.kernel.org/patch/3750731/
https://patchwork.kernel.org/patch/3750741/Signed-off-by Jaehoon Chung <[email protected]>--- drivers/mmc/host/dw_mmc.c | 34 ++++++++++++++++++++++++++++++++++ include/linux/mmc/dw_mmc.h | 1 + 2 files changed, 35 insertions(+)drivers/mmc/host/dw_mmc.c +0
-0drivers/mmc/host/dw_mmc.c int dw_mci_probe(struct dw_mci *host) · line 2396
Quoted 4 lines
drivers/mmc/host/dw_mmc.c +1
-0@@ -2393,6 +2393,24 @@ int dw_mci_probe(struct dw_mci *host) } } + host->vqmmc =devm_regulator_get_optional (host->dev,"vqmmc" );I recommend you to convert to use
mmc_regulator_get_supply()API instead.Quoted 12 lines
drivers/mmc/host/dw_mmc.c +12
-0+if (IS_ERR (host->vqmmc)) { + ret =PTR_ERR (host->vqmmc); +if (ret == -EPROBE_DEFER ) + goto err_vqmmc; + +dev_info (host->dev,"no vqmmc regulator found: %d\n" , ret); + host->vqmmc =NULL ; + }else { + ret =regulator_enable (host->vqmmc); +if (ret) { +if (ret != -EPROBE_DEFER ) + dev_err(host->dev,
Quoted 8 lines
drivers/mmc/host/dw_mmc.c int dw_mci_probe(struct dw_mci *host) · line 2413
Quoted 5 lines
drivers/mmc/host/dw_mmc.c +5
-0+ "regulator_enable fail: %d\n", ret); + goto err_vqmmc; + } + } +Are there any specific reasons to why you don't want use the .set_ios callback to control this regulator?
There is no reason that don't use it. I will resend the patch after changing. (We can use the mmc regulator framework.)
Quoted 3 lines
Is seems wrong to do it from the
probe(). I also realize that the same applies for the already existing vmmc regulator.
You're right. Thanks for point out.
This patch cab be discarded.
Best Regards,
Jaehoon Chung
Quoted 70 lines
Quoted 61 lines
drivers/mmc/host/dw_mmc.c +16
-0host->quirks = host->pdata->quirks;spin_lock_init (&host->lock);@@ -2536,6 +2554,9 @@ err_workqueue: err_dmaunmap:if (host->use_dma && host->dma_ops->exit) host->dma_ops->exit (host); +if (host->vqmmc) +regulator_disable (host->vqmmc); +err_vqmmc:if (host->vmmc)regulator_disable (host->vmmc);@@ -2575,6 +2596,8 @@ void dw_mci_remove(struct dw_mci *host)if (host->vmmc)regulator_disable (host->vmmc); +if (host->vqmmc) +regulator_disable (host->vqmmc);if (!IS_ERR (host->ciu_clk))clk_disable_unprepare (host->ciu_clk);@@ -2594,6 +2617,8 @@ int dw_mci_suspend(struct dw_mci *host) {if (host->vmmc)regulator_disable (host->vmmc); +if (host->vqmmc) +regulator_disable (host->vqmmc);return 0 ; }@@ -2612,6 +2637,15 @@ int dw_mci_resume(struct dw_mci *host) } } +if (host->vqmmc) { + ret =regulator_enable (host->vqmmc); +if (ret) { +dev_err (host->dev, +"failed to enable regulator: %d\n" , ret); +return ret; + } + } +if (!dw_mci_ctrl_all_reset (host)) { ret = -ENODEV ;return ret;include/linux/mmc/dw_mmc.h +1
-1@@ -189,6 +189,7 @@ struct dw_mci {u32 quirks;struct regulator *vmmc;/* Power regulator */ +struct regulator *vqmmc;/* Signalling regulator */ unsigned long irq_flags;/* IRQ flags */ int irq; }; --Quoted 1 line
1.7.9.5
Kind regards
Ulf Hansson
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html