Re: [PATCH 2/4] mmc: core: use mmc_power_up in hw_reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24/10/14 15:46, Johan Rudholm wrote:
> The steps performed in mmc_do_hw_reset for eMMC:s after the hardware
> reset are very similar to those performed by mmc_power_up, so do a call

They perform different functions.  mmc_power_up() does nothing if the card
is powered up.  To share the common code you need to create a function for
the common functionality which is setting the initial state e.g.

int mmc_set_initial_state(struct mmc_host *host)
{
	...
}

And call that from mmc_do_hw_reset and mmc_power_up.

> to this function instead.
> 
> Signed-off-by: Johan Rudholm <johanru@xxxxxxxx>
> ---
>  drivers/mmc/core/core.c |   11 +----------
>  1 files changed, 1 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 5d215ee..d56e222 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -2273,16 +2273,7 @@ static int mmc_do_hw_reset(struct mmc_host *host, int check)
>  		}
>  	}
>  
> -	if (mmc_host_is_spi(host)) {
> -		host->ios.chip_select = MMC_CS_HIGH;
> -		host->ios.bus_mode = MMC_BUSMODE_PUSHPULL;
> -	} else {
> -		host->ios.chip_select = MMC_CS_DONTCARE;
> -		host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
> -	}
> -	host->ios.bus_width = MMC_BUS_WIDTH_1;
> -	host->ios.timing = MMC_TIMING_LEGACY;
> -	mmc_set_ios(host);
> +	mmc_power_up(host, card->ocr);
>  
>  	mmc_host_clk_release(host);
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux