mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00
mmc: mxs-mmc: enable regulator for mmc slot
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> Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
parent
b63b5e819d
commit
4dc5a79f13
1 changed files with 11 additions and 0 deletions
|
@ -707,6 +707,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
|
||||||
struct pinctrl *pinctrl;
|
struct pinctrl *pinctrl;
|
||||||
int ret = 0, irq_err, irq_dma;
|
int ret = 0, irq_err, irq_dma;
|
||||||
dma_cap_mask_t mask;
|
dma_cap_mask_t mask;
|
||||||
|
struct regulator *reg_vmmc;
|
||||||
|
|
||||||
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
dmares = platform_get_resource(pdev, IORESOURCE_DMA, 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->mmc = mmc;
|
||||||
host->sdio_irq_en = 0;
|
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);
|
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
|
||||||
if (IS_ERR(pinctrl)) {
|
if (IS_ERR(pinctrl)) {
|
||||||
ret = PTR_ERR(pinctrl);
|
ret = PTR_ERR(pinctrl);
|
||||||
|
|
Loading…
Add table
Reference in a new issue