summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/renesas_sdhi_core.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2021-11-10 20:16:09 +0100
committerGeert Uytterhoeven <geert+renesas@glider.be>2021-11-19 11:32:39 +0100
commite5f7e81ee430acb6d1fa9a6323fe645bd52e0b9c (patch)
tree08d406090d6d7fcae051e0e56b5af2520dee5f5e /drivers/mmc/host/renesas_sdhi_core.c
parent079e83b958a3c3d9c84e24b28478d57adc1cd7fe (diff)
downloadlinux-e5f7e81ee430acb6d1fa9a6323fe645bd52e0b9c.tar.bz2
mmc: renesas_sdhi: Parse DT for SDnH
If there is a SDnH clock provided in DT, let's use it instead of relying on the fallback. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://lore.kernel.org/r/20211110191610.5664-21-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Diffstat (limited to 'drivers/mmc/host/renesas_sdhi_core.c')
-rw-r--r--drivers/mmc/host/renesas_sdhi_core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 7f842fd306a3..2f5e22e539a3 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -921,6 +921,10 @@ int renesas_sdhi_probe(struct platform_device *pdev,
if (IS_ERR(priv->clk))
return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk), "cannot get clock");
+ priv->clkh = devm_clk_get_optional(&pdev->dev, "clkh");
+ if (IS_ERR(priv->clkh))
+ return dev_err_probe(&pdev->dev, PTR_ERR(priv->clkh), "cannot get clkh");
+
/*
* Some controllers provide a 2nd clock just to run the internal card
* detection logic. Unfortunately, the existing driver architecture does
@@ -959,7 +963,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
dma_priv->dma_buswidth = of_data->dma_buswidth;
host->bus_shift = of_data->bus_shift;
/* Fallback for old DTs */
- if (of_data->sdhi_flags & SDHI_FLAG_NEED_CLKH_FALLBACK)
+ if (!priv->clkh && of_data->sdhi_flags & SDHI_FLAG_NEED_CLKH_FALLBACK)
priv->clkh = clk_get_parent(clk_get_parent(priv->clk));
}