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>
This commit is contained in:

committed by
Ulf Hansson

parent
9369c97cc7
commit
07bf2b54cd
@@ -17,6 +17,10 @@ Optional properties:
|
|||||||
to select a proper data sampling window in case the clock quality is not good
|
to select a proper data sampling window in case the clock quality is not good
|
||||||
due to signal path is too long on the board. Please refer to eSDHC/uSDHC
|
due to signal path is too long on the board. Please refer to eSDHC/uSDHC
|
||||||
chapter, DLL (Delay Line) section in RM for details.
|
chapter, DLL (Delay Line) section in RM for details.
|
||||||
|
- voltage-ranges : Specify the voltage range in case there are software
|
||||||
|
transparent level shifters on the outputs of the controller. Two cells are
|
||||||
|
required, first cell specifies minimum slot voltage (mV), second cell
|
||||||
|
specifies maximum slot voltage (mV). Several ranges could be specified.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
|
@@ -864,6 +864,7 @@ static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
|
|||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
static int
|
static int
|
||||||
sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
|
sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
|
||||||
|
struct sdhci_host *host,
|
||||||
struct esdhc_platform_data *boarddata)
|
struct esdhc_platform_data *boarddata)
|
||||||
{
|
{
|
||||||
struct device_node *np = pdev->dev.of_node;
|
struct device_node *np = pdev->dev.of_node;
|
||||||
@@ -900,11 +901,14 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
|
|||||||
if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line))
|
if (of_property_read_u32(np, "fsl,delay-line", &boarddata->delay_line))
|
||||||
boarddata->delay_line = 0;
|
boarddata->delay_line = 0;
|
||||||
|
|
||||||
|
mmc_of_parse_voltage(np, &host->ocr_mask);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline int
|
static inline int
|
||||||
sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
|
sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
|
||||||
|
struct sdhci_host *host,
|
||||||
struct esdhc_platform_data *boarddata)
|
struct esdhc_platform_data *boarddata)
|
||||||
{
|
{
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@@ -999,7 +1003,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
|
|||||||
host->ioaddr + ESDHC_TUNING_CTRL);
|
host->ioaddr + ESDHC_TUNING_CTRL);
|
||||||
|
|
||||||
boarddata = &imx_data->boarddata;
|
boarddata = &imx_data->boarddata;
|
||||||
if (sdhci_esdhc_imx_probe_dt(pdev, boarddata) < 0) {
|
if (sdhci_esdhc_imx_probe_dt(pdev, host, boarddata) < 0) {
|
||||||
if (!host->mmc->parent->platform_data) {
|
if (!host->mmc->parent->platform_data) {
|
||||||
dev_err(mmc_dev(host->mmc), "no board data!\n");
|
dev_err(mmc_dev(host->mmc), "no board data!\n");
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
|
Reference in New Issue
Block a user