From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kever Yang Date: Mon, 10 Oct 2016 14:40:11 +0800 Subject: [U-Boot] [PATCH] mmc: rockchip_sdhci: add clock init for mmc In-Reply-To: <606545aa-cde3-70f4-e6b6-18927939bbf4@samsung.com> References: <1475832231-3575-1-git-send-email-kever.yang@rock-chips.com> <606545aa-cde3-70f4-e6b6-18927939bbf4@samsung.com> Message-ID: <57FB37CB.2060405@rock-chips.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Jaehoon, On 10/10/2016 07:01 AM, Jaehoon Chung wrote: > On 10/07/2016 06:23 PM, Kever Yang wrote: >> Init the clock rate to CONFIG_ROCKCHIP_SDHCI_MAX_FREQ with clock driver >> api. >> >> Signed-off-by: Kever Yang >> --- >> >> drivers/mmc/rockchip_sdhci.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c >> index c56e1a3..e787343 100644 >> --- a/drivers/mmc/rockchip_sdhci.c >> +++ b/drivers/mmc/rockchip_sdhci.c >> @@ -12,6 +12,7 @@ >> #include >> #include >> #include >> +#include >> >> /* 400KHz is max freq for card ID etc. Use that as min */ >> #define EMMC_MIN_FREQ 400000 >> @@ -33,7 +34,10 @@ static int arasan_sdhci_probe(struct udevice *dev) >> struct rockchip_sdhc *prv = dev_get_priv(dev); >> struct sdhci_host *host = &prv->host; >> int ret; >> + struct clk clk; >> >> + ret = clk_get_by_index(dev, 0, &clk); > What purpose do you use "ret" value? Forgot to do the error check with 'ret', will add it at V2. Thanks, - Kever > > Best Regards, > Jaehoon Chung > >> + clk_set_rate(&clk, CONFIG_ROCKCHIP_SDHCI_MAX_FREQ); >> host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD; >> >> ret = sdhci_setup_cfg(&plat->cfg, host, CONFIG_ROCKCHIP_SDHCI_MAX_FREQ, >> > > >