Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Avri Altman and committed by
Ulf Hansson
c2afdd73 218fe24f

+2 -6
+2 -5
drivers/mmc/core/sd.c
··· 554 554 555 555 static int sd_set_current_limit(struct mmc_card *card, u8 *status) 556 556 { 557 - int current_limit = SD_SET_CURRENT_NO_CHANGE; 557 + int current_limit = SD_SET_CURRENT_LIMIT_200; 558 558 int err; 559 559 u32 max_current; 560 560 ··· 598 598 else if (max_current >= 400 && 599 599 card->sw_caps.sd3_curr_limit & SD_MAX_CURRENT_400) 600 600 current_limit = SD_SET_CURRENT_LIMIT_400; 601 - else if (max_current >= 200 && 602 - card->sw_caps.sd3_curr_limit & SD_MAX_CURRENT_200) 603 - current_limit = SD_SET_CURRENT_LIMIT_200; 604 601 605 - if (current_limit != SD_SET_CURRENT_NO_CHANGE) { 602 + if (current_limit != SD_SET_CURRENT_LIMIT_200) { 606 603 err = mmc_sd_switch(card, SD_SWITCH_SET, 3, 607 604 current_limit, status); 608 605 if (err)
-1
include/linux/mmc/card.h
··· 182 182 #define SD_SET_CURRENT_LIMIT_400 1 183 183 #define SD_SET_CURRENT_LIMIT_600 2 184 184 #define SD_SET_CURRENT_LIMIT_800 3 185 - #define SD_SET_CURRENT_NO_CHANGE (-1) 186 185 187 186 #define SD_MAX_CURRENT_200 (1 << SD_SET_CURRENT_LIMIT_200) 188 187 #define SD_MAX_CURRENT_400 (1 << SD_SET_CURRENT_LIMIT_400)