mirror of https://github.com/torvalds/linux.git
mmc: core: Skip to set the default 200mA SD current limit
Let's avoid updating the SD current limit when the maximum power is 200mA (0.72W) or less, as this is already the default value for the SD card. In this way we avoid sending an unnecessary command during initialization. Signed-off-by: Avri Altman <avri.altman@sandisk.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
218fe24ff2
commit
c2afdd73e5
|
|
@ -554,7 +554,7 @@ static u32 sd_get_host_max_current(struct mmc_host *host)
|
||||||
|
|
||||||
static int sd_set_current_limit(struct mmc_card *card, u8 *status)
|
static int sd_set_current_limit(struct mmc_card *card, u8 *status)
|
||||||
{
|
{
|
||||||
int current_limit = SD_SET_CURRENT_NO_CHANGE;
|
int current_limit = SD_SET_CURRENT_LIMIT_200;
|
||||||
int err;
|
int err;
|
||||||
u32 max_current;
|
u32 max_current;
|
||||||
|
|
||||||
|
|
@ -598,11 +598,8 @@ static int sd_set_current_limit(struct mmc_card *card, u8 *status)
|
||||||
else if (max_current >= 400 &&
|
else if (max_current >= 400 &&
|
||||||
card->sw_caps.sd3_curr_limit & SD_MAX_CURRENT_400)
|
card->sw_caps.sd3_curr_limit & SD_MAX_CURRENT_400)
|
||||||
current_limit = SD_SET_CURRENT_LIMIT_400;
|
current_limit = SD_SET_CURRENT_LIMIT_400;
|
||||||
else if (max_current >= 200 &&
|
|
||||||
card->sw_caps.sd3_curr_limit & SD_MAX_CURRENT_200)
|
|
||||||
current_limit = SD_SET_CURRENT_LIMIT_200;
|
|
||||||
|
|
||||||
if (current_limit != SD_SET_CURRENT_NO_CHANGE) {
|
if (current_limit != SD_SET_CURRENT_LIMIT_200) {
|
||||||
err = mmc_sd_switch(card, SD_SWITCH_SET, 3,
|
err = mmc_sd_switch(card, SD_SWITCH_SET, 3,
|
||||||
current_limit, status);
|
current_limit, status);
|
||||||
if (err)
|
if (err)
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,6 @@ struct sd_switch_caps {
|
||||||
#define SD_SET_CURRENT_LIMIT_400 1
|
#define SD_SET_CURRENT_LIMIT_400 1
|
||||||
#define SD_SET_CURRENT_LIMIT_600 2
|
#define SD_SET_CURRENT_LIMIT_600 2
|
||||||
#define SD_SET_CURRENT_LIMIT_800 3
|
#define SD_SET_CURRENT_LIMIT_800 3
|
||||||
#define SD_SET_CURRENT_NO_CHANGE (-1)
|
|
||||||
|
|
||||||
#define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200)
|
#define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200)
|
||||||
#define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400)
|
#define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue