aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-03-24 09:45:04 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2015-03-25 04:46:35 -0400
commit07bf2b54cd8555390cf5fced9471689ebf7fd56c (patch)
tree04cf9a0bfd91feebfb890daf89d955ea6a3c258d
parent9369c97cc7eca4a73baf382cfabe92ed20ea04ed (diff)
mmc: sdhci-esdhc-imx: support voltage-range property
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt4
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
index 9046ba06c47a..415c5575cbf7 100644
--- a/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
+++ b/Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
@@ -17,6 +17,10 @@ Optional properties:
17 to select a proper data sampling window in case the clock quality is not good 17 to select a proper data sampling window in case the clock quality is not good
18 due to signal path is too long on the board. Please refer to eSDHC/uSDHC 18 due to signal path is too long on the board. Please refer to eSDHC/uSDHC
19 chapter, DLL (Delay Line) section in RM for details. 19 chapter, DLL (Delay Line) section in RM for details.
20- voltage-ranges : Specify the voltage range in case there are software
21 transparent level shifters on the outputs of the controller. Two cells are
22 required, first cell specifies minimum slot voltage (mV), second cell
23 specifies maximum slot voltage (mV). Several ranges could be specified.
20 24
21Examples: 25Examples:
22 26
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 9cce5cf18ebc..7ee831255f50 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -864,6 +864,7 @@ static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
864#ifdef CONFIG_OF 864#ifdef CONFIG_OF
865static int 865static int
866sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, 866sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
867 struct sdhci_host *host,
867 struct esdhc_platform_data *boarddata) 868 struct esdhc_platform_data *boarddata)
868{ 869{
869 struct device_node *np = pdev->dev.of_node; 870 struct device_node *np = pdev->dev.of_node;
@@ -900,11 +901,14 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
900 if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line)) 901 if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line))
901 boarddata->delay_line = 0; 902 boarddata->delay_line = 0;
902 903
904 mmc_of_parse_voltage(np, &host->ocr_mask);
905
903 return 0; 906 return 0;
904} 907}
905#else 908#else
906static inline int 909static inline int
907sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, 910sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
911 struct sdhci_host *host,
908 struct esdhc_platform_data *boarddata) 912 struct esdhc_platform_data *boarddata)
909{ 913{
910 return -ENODEV; 914 return -ENODEV;
@@ -999,7 +1003,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
999 host->ioaddr + ESDHC_TUNING_CTRL); 1003 host->ioaddr + ESDHC_TUNING_CTRL);
1000 1004
1001 boarddata = &imx_data->boarddata; 1005 boarddata = &imx_data->boarddata;
1002 if (sdhci_esdhc_imx_probe_dt(pdev, boarddata) < 0) { 1006 if (sdhci_esdhc_imx_probe_dt(pdev, host, boarddata) < 0) {
1003 if (!host->mmc->parent->platform_data) { 1007 if (!host->mmc->parent->platform_data) {
1004 dev_err(mmc_dev(host->mmc), "no board data!\n"); 1008 dev_err(mmc_dev(host->mmc), "no board data!\n");
1005 err = -EINVAL; 1009 err = -EINVAL;