All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars Persson <lars.persson@axis.com>
To: linux-mmc@vger.kernel.org, devicetree@vger.kernel.org
Cc: g.liakhovetski@gmx.de, ulf.hansson@linaro.org,
	robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	Lars Persson <larper@axis.com>
Subject: [PATCH v4 2/3] mmc: usdhi6rol0: add support for UHS modes
Date: Thu, 21 Apr 2016 15:55:43 +0200	[thread overview]
Message-ID: <f53bfd4b14c36df41449d0bfdaadabd2c8d3ab1d.1461246772.git.larper@axis.com> (raw)
In-Reply-To: <cover.1461246772.git.larper@axis.com>
In-Reply-To: <cover.1461246772.git.larper@axis.com>

Add a start_signal_voltage_switch() operation to support enabling of
UHS modes.

Signed-off-by: Lars Persson <larper@axis.com>
---
 drivers/mmc/host/usdhi6rol0.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c
index 807c06e..28fe5c7 100644
--- a/drivers/mmc/host/usdhi6rol0.c
+++ b/drivers/mmc/host/usdhi6rol0.c
@@ -21,6 +21,7 @@
 #include <linux/mmc/sd.h>
 #include <linux/mmc/sdio.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/pagemap.h>
 #include <linux/platform_device.h>
 #include <linux/scatterlist.h>
@@ -1147,12 +1148,22 @@ static void usdhi6_enable_sdio_irq(struct mmc_host *mmc, int enable)
 	}
 }
 
+static int usdhi6_sig_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios)
+{
+	int ret;
+
+	ret = mmc_regulator_set_vqmmc(mmc, ios);
+
+	return ret;
+}
+
 static struct mmc_host_ops usdhi6_ops = {
 	.request	= usdhi6_request,
 	.set_ios	= usdhi6_set_ios,
 	.get_cd		= usdhi6_get_cd,
 	.get_ro		= usdhi6_get_ro,
 	.enable_sdio_irq = usdhi6_enable_sdio_irq,
+	.start_signal_voltage_switch = usdhi6_sig_volt_switch,
 };
 
 /*			State machine handlers				*/
@@ -1785,7 +1796,17 @@ static int usdhi6_probe(struct platform_device *pdev)
 
 	mmc->ops = &usdhi6_ops;
 	mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED |
-		MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 | MMC_CAP_SDIO_IRQ;
+		     MMC_CAP_SDIO_IRQ;
+
+	/*
+	 * A vqmmc regulator with a 1.8V mode is mandatory to support
+	 * UHS modes.
+	 */
+	if (!of_property_read_bool(dev->of_node, "no-1-8-v") &&
+	    !IS_ERR(mmc->supply.vqmmc)) {
+		mmc->caps |= MMC_CAP_UHS_DDR50 | MMC_CAP_UHS_SDR50;
+	}
+
 	/* Set .max_segs to some random number. Feel free to adjust. */
 	mmc->max_segs = 32;
 	mmc->max_blk_size = 512;
-- 
2.1.4


  parent reply	other threads:[~2016-04-21 13:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-21 13:55 [PATCH v4 0/3] mmc: usdhi6rol0: UHS support Lars Persson
     [not found] ` <cover.1461246772.git.larper-VrBV9hrLPhE@public.gmane.org>
2016-04-21 13:55   ` [PATCH v4 1/3] mmc: dt: usdhi6rol0: add optional pinctrl binding Lars Persson
2016-04-22 20:27     ` Rob Herring
2016-04-26 12:23       ` Lars Persson
2016-04-26 13:19         ` Rob Herring
2016-04-21 13:55 ` Lars Persson [this message]
2016-04-22 12:53   ` [PATCH v4 2/3] mmc: usdhi6rol0: add support for UHS modes Ulf Hansson
2016-04-21 13:55 ` [PATCH v4 3/3] mmc: usdhi6rol0: add pinctrl to set pin drive strength Lars Persson

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=f53bfd4b14c36df41449d0bfdaadabd2c8d3ab1d.1461246772.git.larper@axis.com \
    --to=lars.persson@axis.com \
    --cc=devicetree@vger.kernel.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=larper@axis.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --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 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.