summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci-xenon.c
diff options
context:
space:
mode:
authorHu Ziji <huziji@marvell.com>2017-03-30 17:23:00 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2017-04-24 21:42:16 +0200
commit06c8b667ff5b984ac3aa901c4928e4a427987a56 (patch)
treede93db86ea84f24cf6608edd68bf8ee146d92cc4 /drivers/mmc/host/sdhci-xenon.c
parent3a3748dba881ed23ba8465dd6d66a267af89cdc0 (diff)
downloadblackbird-op-linux-06c8b667ff5b984ac3aa901c4928e4a427987a56.tar.gz
blackbird-op-linux-06c8b667ff5b984ac3aa901c4928e4a427987a56.zip
mmc: sdhci-xenon: Add support to PHYs of Marvell Xenon SDHC
Marvell Xenon eMMC/SD/SDIO Host Controller contains PHY. Multiple types of PHYs are supported. Add support to multiple types of PHYs init and configuration. Add register definitions of PHYs. Xenon PHY cannot fit in kernel common PHY framework. Xenon SDHC PHY register is a part of Xenon SDHC register set. Besides, MMC initialization has to call several PHY functions to complete timing setting. Those PHY setting functions have to access SDHC registers and know current MMC setting, such as bus width, clock frequency and speed mode. As a result, implement Xenon PHY in MMC host directory. Signed-off-by: Hu Ziji <huziji@marvell.com> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-xenon.c')
-rw-r--r--drivers/mmc/host/sdhci-xenon.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
index b3f2b018fe3d..36e22bd2b8cc 100644
--- a/drivers/mmc/host/sdhci-xenon.c
+++ b/drivers/mmc/host/sdhci-xenon.c
@@ -257,6 +257,7 @@ static void xenon_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
}
sdhci_set_ios(mmc, ios);
+ xenon_phy_adj(host, ios);
if (host->clock > XENON_DEFAULT_SDCLK_FREQ)
xenon_set_sdclk_off_idle(host, priv->sdhc_id, true);
@@ -401,7 +402,7 @@ static int xenon_probe_dt(struct platform_device *pdev)
}
priv->tuning_count = tuning_count;
- return 0;
+ return xenon_phy_parse_dt(np, host);
}
static int xenon_sdhc_prepare(struct sdhci_host *host)
@@ -483,7 +484,7 @@ static int xenon_probe(struct platform_device *pdev)
err = xenon_sdhc_prepare(host);
if (err)
- goto err_clk;
+ goto clean_phy_param;
err = sdhci_add_host(host);
if (err)
@@ -493,6 +494,8 @@ static int xenon_probe(struct platform_device *pdev)
remove_sdhc:
xenon_sdhc_unprepare(host);
+clean_phy_param:
+ xenon_clean_phy(host);
err_clk:
clk_disable_unprepare(pltfm_host->clk);
free_pltfm:
@@ -505,6 +508,8 @@ static int xenon_remove(struct platform_device *pdev)
struct sdhci_host *host = platform_get_drvdata(pdev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ xenon_clean_phy(host);
+
xenon_sdhc_unprepare(host);
sdhci_remove_host(host, 0);
OpenPOWER on IntegriCloud