Skip to content

Commit e5f7e81

Browse files
Wolfram Sanggeertu
authored andcommitted
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 <[email protected]> Acked-by: Ulf Hansson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 079e83b commit e5f7e81

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/mmc/host/renesas_sdhi_core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,10 @@ int renesas_sdhi_probe(struct platform_device *pdev,
921921
if (IS_ERR(priv->clk))
922922
return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk), "cannot get clock");
923923

924+
priv->clkh = devm_clk_get_optional(&pdev->dev, "clkh");
925+
if (IS_ERR(priv->clkh))
926+
return dev_err_probe(&pdev->dev, PTR_ERR(priv->clkh), "cannot get clkh");
927+
924928
/*
925929
* Some controllers provide a 2nd clock just to run the internal card
926930
* detection logic. Unfortunately, the existing driver architecture does
@@ -959,7 +963,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
959963
dma_priv->dma_buswidth = of_data->dma_buswidth;
960964
host->bus_shift = of_data->bus_shift;
961965
/* Fallback for old DTs */
962-
if (of_data->sdhi_flags & SDHI_FLAG_NEED_CLKH_FALLBACK)
966+
if (!priv->clkh && of_data->sdhi_flags & SDHI_FLAG_NEED_CLKH_FALLBACK)
963967
priv->clkh = clk_get_parent(clk_get_parent(priv->clk));
964968

965969
}

0 commit comments

Comments
 (0)