All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: mxs-mmc: enable regulator for mmc slot
@ 2012-06-26  8:38 ` Shawn Guo
  0 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2012-06-26  8:38 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, linux-arm-kernel, Shawn Guo

If bootloader or platform initialization code does not enable the
power supply to mmc slot, we need to do it in mmc driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/mmc/host/mxs-mmc.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 34a9026..1a29668 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -707,6 +707,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	struct pinctrl *pinctrl;
 	int ret = 0, irq_err, irq_dma;
 	dma_cap_mask_t mask;
+	struct regulator *reg_vmmc;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
@@ -747,6 +748,16 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	host->mmc = mmc;
 	host->sdio_irq_en = 0;
 
+	reg_vmmc = devm_regulator_get(&pdev->dev, "vmmc");
+	if (!IS_ERR(reg_vmmc)) {
+		ret = regulator_enable(reg_vmmc);
+		if (ret) {
+			dev_err(&pdev->dev,
+				"Failed to enable vmmc regulator: %d\n", ret);
+			goto out_mmc_free;
+		}
+	}
+
 	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
 	if (IS_ERR(pinctrl)) {
 		ret = PTR_ERR(pinctrl);
-- 
1.7.5.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] mmc: mxs-mmc: enable regulator for mmc slot
@ 2012-06-26  8:38 ` Shawn Guo
  0 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2012-06-26  8:38 UTC (permalink / raw)
  To: linux-arm-kernel

If bootloader or platform initialization code does not enable the
power supply to mmc slot, we need to do it in mmc driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/mmc/host/mxs-mmc.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 34a9026..1a29668 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -707,6 +707,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	struct pinctrl *pinctrl;
 	int ret = 0, irq_err, irq_dma;
 	dma_cap_mask_t mask;
+	struct regulator *reg_vmmc;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
@@ -747,6 +748,16 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	host->mmc = mmc;
 	host->sdio_irq_en = 0;
 
+	reg_vmmc = devm_regulator_get(&pdev->dev, "vmmc");
+	if (!IS_ERR(reg_vmmc)) {
+		ret = regulator_enable(reg_vmmc);
+		if (ret) {
+			dev_err(&pdev->dev,
+				"Failed to enable vmmc regulator: %d\n", ret);
+			goto out_mmc_free;
+		}
+	}
+
 	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
 	if (IS_ERR(pinctrl)) {
 		ret = PTR_ERR(pinctrl);
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: mxs-mmc: enable regulator for mmc slot
  2012-06-26  8:38 ` Shawn Guo
@ 2012-07-03  7:45   ` Shawn Guo
  -1 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2012-07-03  7:45 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, linux-arm-kernel

Hi Chris,

Ping.

Regards,
Shawn

On Tue, Jun 26, 2012 at 04:38:57PM +0800, Shawn Guo wrote:
> If bootloader or platform initialization code does not enable the
> power supply to mmc slot, we need to do it in mmc driver.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  drivers/mmc/host/mxs-mmc.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 34a9026..1a29668 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -707,6 +707,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>  	struct pinctrl *pinctrl;
>  	int ret = 0, irq_err, irq_dma;
>  	dma_cap_mask_t mask;
> +	struct regulator *reg_vmmc;
>  
>  	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
> @@ -747,6 +748,16 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>  	host->mmc = mmc;
>  	host->sdio_irq_en = 0;
>  
> +	reg_vmmc = devm_regulator_get(&pdev->dev, "vmmc");
> +	if (!IS_ERR(reg_vmmc)) {
> +		ret = regulator_enable(reg_vmmc);
> +		if (ret) {
> +			dev_err(&pdev->dev,
> +				"Failed to enable vmmc regulator: %d\n", ret);
> +			goto out_mmc_free;
> +		}
> +	}
> +
>  	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
>  	if (IS_ERR(pinctrl)) {
>  		ret = PTR_ERR(pinctrl);
> -- 
> 1.7.5.4
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] mmc: mxs-mmc: enable regulator for mmc slot
@ 2012-07-03  7:45   ` Shawn Guo
  0 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2012-07-03  7:45 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Chris,

Ping.

Regards,
Shawn

On Tue, Jun 26, 2012 at 04:38:57PM +0800, Shawn Guo wrote:
> If bootloader or platform initialization code does not enable the
> power supply to mmc slot, we need to do it in mmc driver.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  drivers/mmc/host/mxs-mmc.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 34a9026..1a29668 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -707,6 +707,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>  	struct pinctrl *pinctrl;
>  	int ret = 0, irq_err, irq_dma;
>  	dma_cap_mask_t mask;
> +	struct regulator *reg_vmmc;
>  
>  	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
> @@ -747,6 +748,16 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>  	host->mmc = mmc;
>  	host->sdio_irq_en = 0;
>  
> +	reg_vmmc = devm_regulator_get(&pdev->dev, "vmmc");
> +	if (!IS_ERR(reg_vmmc)) {
> +		ret = regulator_enable(reg_vmmc);
> +		if (ret) {
> +			dev_err(&pdev->dev,
> +				"Failed to enable vmmc regulator: %d\n", ret);
> +			goto out_mmc_free;
> +		}
> +	}
> +
>  	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
>  	if (IS_ERR(pinctrl)) {
>  		ret = PTR_ERR(pinctrl);
> -- 
> 1.7.5.4
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: mxs-mmc: enable regulator for mmc slot
  2012-06-26  8:38 ` Shawn Guo
@ 2012-07-03 22:56   ` Chris Ball
  -1 siblings, 0 replies; 6+ messages in thread
From: Chris Ball @ 2012-07-03 22:56 UTC (permalink / raw)
  To: Shawn Guo; +Cc: linux-mmc, linux-arm-kernel

Hi,

On Tue, Jun 26 2012, Shawn Guo wrote:
> If bootloader or platform initialization code does not enable the
> power supply to mmc slot, we need to do it in mmc driver.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  drivers/mmc/host/mxs-mmc.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 34a9026..1a29668 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -707,6 +707,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>  	struct pinctrl *pinctrl;
>  	int ret = 0, irq_err, irq_dma;
>  	dma_cap_mask_t mask;
> +	struct regulator *reg_vmmc;
>  
>  	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
> @@ -747,6 +748,16 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>  	host->mmc = mmc;
>  	host->sdio_irq_en = 0;
>  
> +	reg_vmmc = devm_regulator_get(&pdev->dev, "vmmc");
> +	if (!IS_ERR(reg_vmmc)) {
> +		ret = regulator_enable(reg_vmmc);
> +		if (ret) {
> +			dev_err(&pdev->dev,
> +				"Failed to enable vmmc regulator: %d\n", ret);
> +			goto out_mmc_free;
> +		}
> +	}
> +
>  	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
>  	if (IS_ERR(pinctrl)) {
>  		ret = PTR_ERR(pinctrl);

Thanks, pushed to mmc-next for 3.6.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] mmc: mxs-mmc: enable regulator for mmc slot
@ 2012-07-03 22:56   ` Chris Ball
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Ball @ 2012-07-03 22:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Tue, Jun 26 2012, Shawn Guo wrote:
> If bootloader or platform initialization code does not enable the
> power supply to mmc slot, we need to do it in mmc driver.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  drivers/mmc/host/mxs-mmc.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 34a9026..1a29668 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -707,6 +707,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>  	struct pinctrl *pinctrl;
>  	int ret = 0, irq_err, irq_dma;
>  	dma_cap_mask_t mask;
> +	struct regulator *reg_vmmc;
>  
>  	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
> @@ -747,6 +748,16 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>  	host->mmc = mmc;
>  	host->sdio_irq_en = 0;
>  
> +	reg_vmmc = devm_regulator_get(&pdev->dev, "vmmc");
> +	if (!IS_ERR(reg_vmmc)) {
> +		ret = regulator_enable(reg_vmmc);
> +		if (ret) {
> +			dev_err(&pdev->dev,
> +				"Failed to enable vmmc regulator: %d\n", ret);
> +			goto out_mmc_free;
> +		}
> +	}
> +
>  	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
>  	if (IS_ERR(pinctrl)) {
>  		ret = PTR_ERR(pinctrl);

Thanks, pushed to mmc-next for 3.6.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-07-03 22:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-26  8:38 [PATCH] mmc: mxs-mmc: enable regulator for mmc slot Shawn Guo
2012-06-26  8:38 ` Shawn Guo
2012-07-03  7:45 ` Shawn Guo
2012-07-03  7:45   ` Shawn Guo
2012-07-03 22:56 ` Chris Ball
2012-07-03 22:56   ` Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.