[U-Boot] [PATCH] mmc: sdhci: assigned to current clock value for host->clock

Minkyu Kang mk7.kang at samsung.com
Thu Oct 29 09:40:23 CET 2015


Hi!

On 29/10/15 16:53, Jaehoon Chung wrote:
> There is no place where host->clock is assgined to any value.
> If real clock is changed to mmc->clock, host->clock can be assigned to
> mmc->clock. If card request to same clock value, it doesn't need to
> call sdhci_set_clock() function.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
> ---
>  drivers/mmc/sdhci.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index d89e302..3f87a23 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -380,8 +380,10 @@ static void sdhci_set_ios(struct mmc *mmc)
>  	if (host->set_control_reg)
>  		host->set_control_reg(host);
>  
> -	if (mmc->clock != host->clock)
> -		sdhci_set_clock(mmc, mmc->clock);
> +	if (mmc->clock != host->clock) {
> +		if (!sdhci_set_clock(mmc, mmc->clock))
> +			host->clock = mmc->clock;

I think it's better to move into sdhci_set_clock function.

> +	}
>  
>  	/* Set bus width */
>  	ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> 

Thanks,
Minkyu Kang.


More information about the U-Boot mailing list