Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1721672
| From | Jerome Brunet <jbrunet@baylibre.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 11/13] mmc: meson-gx: implement voltage switch callback |
| Date | 2017-08-28 16:40 +0200 |
| Message-ID | <ujtmN-6J9-3@gated-at.bofh.it> (permalink) |
| References | <ujtd7-6G2-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Implement voltage switch callback (shamelessly copied from sunxi mmc
driver). This allow, with the appropriate tuning function, to use
SD ultra high speed modes.
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
drivers/mmc/host/meson-gx-mmc.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index 2fa18faa7f0f..0cffc705bfe3 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1049,6 +1049,27 @@ static int meson_mmc_card_busy(struct mmc_host *mmc)
return !(FIELD_GET(STATUS_DATI, regval) & 0xf);
}
+static int meson_mmc_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
+{
+ /* vqmmc regulator is available */
+ if (!IS_ERR(mmc->supply.vqmmc)) {
+ /*
+ * The usual amlogic setup uses a GPIO to switch from one
+ * regulator to the other. While the voltage ramp up is
+ * pretty fast, care must be taken when switching from 3.3v
+ * to 1.8v. Please make sure the regulator framework is aware
+ * of your own regulator constraints
+ */
+ return mmc_regulator_set_vqmmc(mmc, ios);
+ }
+
+ /* no vqmmc regulator, assume fixed regulator at 3/3.3V */
+ if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330)
+ return 0;
+
+ return -EINVAL;
+}
+
static const struct mmc_host_ops meson_mmc_ops = {
.request = meson_mmc_request,
.set_ios = meson_mmc_set_ios,
@@ -1057,6 +1078,7 @@ static const struct mmc_host_ops meson_mmc_ops = {
.post_req = meson_mmc_post_req,
.execute_tuning = meson_mmc_execute_tuning,
.card_busy = meson_mmc_card_busy,
+ .start_signal_voltage_switch = meson_mmc_voltage_switch,
};
static int meson_mmc_probe(struct platform_device *pdev)
--
2.9.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 00/13] mmc: meson-gx: driver fixups and upgrades Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:30 +0200
[PATCH v3 11/13] mmc: meson-gx: implement voltage switch callback Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:40 +0200
[PATCH v3 03/13] mmc: meson-gx: rework set_ios function Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:40 +0200
[PATCH v3 12/13] mmc: meson-gx: change default tx phase Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:40 +0200
[PATCH v3 10/13] mmc: meson-gx: use CCF to handle the clock phases Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:40 +0200
[PATCH v3 05/13] mmc: meson-gx: rework clock init function Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:40 +0200
[PATCH v3 08/13] mmc: meson-gx: simplify interrupt handler Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:40 +0200
[PATCH v3 07/13] mmc: meson-gx: work around clk-stop issue Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:40 +0200
[PATCH v3 04/13] mmc: meson-gx: rework clk_set function Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:40 +0200
[PATCH v3 01/13] mmc: meson-gx: initialize sane clk default before clock register Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:40 +0200
[PATCH v3 06/13] mmc: meson-gx: fix dual data rate mode frequencies Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:40 +0200
[PATCH v3 02/13] mmc: meson-gx: cfg init overwrite values Jerome Brunet <jbrunet@baylibre.com> - 2017-08-28 16:40 +0200
Re: [PATCH v3 00/13] mmc: meson-gx: driver fixups and upgrades Ulf Hansson <ulf.hansson@linaro.org> - 2017-08-30 15:20 +0200
Re: [PATCH v3 00/13] mmc: meson-gx: driver fixups and upgrades Kevin Hilman <khilman@baylibre.com> - 2017-08-30 21:10 +0200
Re: [PATCH v3 00/13] mmc: meson-gx: driver fixups and upgrades Ulf Hansson <ulf.hansson@linaro.org> - 2017-08-31 12:50 +0200
csiph-web