From: Jaehoon Chung <jh80.chung@samsung.com>
To: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Cc: Chris Ball <chris@printf.net>,
Seungwon Jeon <tgih.jun@samsung.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: [PATCH] mmc: dw_mmc: add the vqmmc regulator
Date: Fri, 14 Mar 2014 16:24:27 +0900 [thread overview]
Message-ID: <5322AEAB.8010602@samsung.com> (raw)
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/
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
drivers/mmc/host/dw_mmc.c | 34 ++++++++++++++++++++++++++++++++++
include/linux/mmc/dw_mmc.h | 1 +
2 files changed, 35 insertions(+)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 5e78748..9a33a6d 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -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;
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index babaea9..8912d92 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -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;
};
--
1.7.9.5
next reply other threads:[~2014-03-14 7:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 7:24 Jaehoon Chung [this message]
2014-03-14 7:53 ` [PATCH] mmc: dw_mmc: add the vqmmc regulator Ulf Hansson
2014-03-14 8:16 ` Jaehoon Chung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5322AEAB.8010602@samsung.com \
--to=jh80.chung@samsung.com \
--cc=chris@printf.net \
--cc=linux-mmc@vger.kernel.org \
--cc=tgih.jun@samsung.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox