From patchwork Thu Jan 16 14:12:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faiz Abbas X-Patchwork-Id: 239662 List-Id: U-Boot discussion From: faiz_abbas at ti.com (Faiz Abbas) Date: Thu, 16 Jan 2020 19:42:18 +0530 Subject: [PATCH v2 1/7] mmc: am654_sdhci: Get Xin clock by name In-Reply-To: <20200116141224.15879-1-faiz_abbas@ti.com> References: <20200116141224.15879-1-faiz_abbas@ti.com> Message-ID: <20200116141224.15879-2-faiz_abbas@ti.com> Get clk_xin by name instead of by index to avoid having to put clocks in the same order in all devices. Signed-off-by: Faiz Abbas --- arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 3 ++- drivers/mmc/am654_sdhci.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi index bea80c5d00..57877f3d84 100644 --- a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi +++ b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi @@ -25,7 +25,8 @@ compatible = "ti,am654-sdhci-5.1"; reg = <0x0 0x4FA0000 0x0 0x1000>, <0x0 0x4FB0000 0x0 0x400>; - clocks = <&k3_clks 48 1>; + clocks =<&k3_clks 48 0>, <&k3_clks 48 1>; + clock-names = "clk_ahb", "clk_xin"; power-domains = <&k3_pds 48 TI_SCI_PD_EXCLUSIVE>; max-frequency = <25000000>; ti,otap-del-sel = <0x2>; diff --git a/drivers/mmc/am654_sdhci.c b/drivers/mmc/am654_sdhci.c index 7cd5516197..a4359fcc18 100644 --- a/drivers/mmc/am654_sdhci.c +++ b/drivers/mmc/am654_sdhci.c @@ -223,7 +223,7 @@ static int am654_sdhci_probe(struct udevice *dev) unsigned long clock; int ret; - ret = clk_get_by_index(dev, 0, &clk); + ret = clk_get_by_name(dev, "clk_xin", &clk); if (ret) { dev_err(dev, "failed to get clock\n"); return ret;