public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v1 1/2] rockchip: mmc: rockchip_dw_mmc: fix ciu clock index
@ 2022-01-07 18:34 Johan Jonker
  2022-01-07 18:34 ` [PATCH v1 2/2] rockchip: mmc: rockchip_dw_mmc: add rk3066/rk3188 support Johan Jonker
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Jonker @ 2022-01-07 18:34 UTC (permalink / raw)
  To: kever.yang; +Cc: sjg, philipp.tomsich, peng.fan, jh80.chung, u-boot

The document rockchip-dw-mshc.yaml decribes a maximum of 4 clocks.
In the rockchip_dw_mmc driver the clock name in use was "fixed"
to "ciu" with index 1, but later reverted back to index 0.
The clock drivers can handle both, but the calling driver
should submit correct data as a standard practice.
Fix the "ciu" clock index by setting it back to 1.

  clock-names:
    minItems: 2
    items:
      - const: biu
      - const: ciu
      - const: ciu-drive
      - const: ciu-sample

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 drivers/mmc/rockchip_dw_mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c
index 7f8dea1e..be065ec0 100644
--- a/drivers/mmc/rockchip_dw_mmc.c
+++ b/drivers/mmc/rockchip_dw_mmc.c
@@ -123,11 +123,11 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
 	priv->minmax[0] = 400000;  /*  400 kHz */
 	priv->minmax[1] = dtplat->max_frequency;
 
-	ret = clk_get_by_phandle(dev, dtplat->clocks, &priv->clk);
+	ret = clk_get_by_phandle(dev, &dtplat->clocks[1], &priv->clk);
 	if (ret < 0)
 		return ret;
 #else
-	ret = clk_get_by_index(dev, 0, &priv->clk);
+	ret = clk_get_by_index(dev, 1, &priv->clk);
 	if (ret < 0)
 		return ret;
 #endif
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-12  9:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-07 18:34 [PATCH v1 1/2] rockchip: mmc: rockchip_dw_mmc: fix ciu clock index Johan Jonker
2022-01-07 18:34 ` [PATCH v1 2/2] rockchip: mmc: rockchip_dw_mmc: add rk3066/rk3188 support Johan Jonker
2022-03-12  9:02   ` Jagan Teki
2022-03-12  9:14     ` Johan Jonker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox