diff options
author | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-11-03 13:11:53 +0100 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@linaro.org> | 2012-03-06 17:30:03 +0100 |
commit | 39688d809b8426268b50e2061116150034978e8e (patch) | |
tree | 701ce701ca896d35c9e16026b0ace7f109efb5b3 | |
parent | f465215bf31f0e6f383d51857b42661df43e8f1c (diff) |
ARM: ux500: Optimize ios_handler for SD-card
The ios_handler may be called several times without a changed
power_mode, thus make sure the power_mode has changed before
we act on it.
Change-Id: I72933da44b6930a0ed4b0f0f1e294443dba2b30d
Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/36215
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-sdi.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-u5500-sdi.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c index 59ac76f980b..814c4e5c3b6 100644 --- a/arch/arm/mach-ux500/board-mop500-sdi.c +++ b/arch/arm/mach-ux500/board-mop500-sdi.c @@ -38,6 +38,11 @@ static int sdi0_vsel = -1; static int mop500_sdi0_ios_handler(struct device *dev, struct mmc_ios *ios) { + static int power_mode = -1; + + if (power_mode == ios->power_mode) + return 0; + switch (ios->power_mode) { case MMC_POWER_UP: case MMC_POWER_ON: @@ -59,6 +64,7 @@ static int mop500_sdi0_ios_handler(struct device *dev, struct mmc_ios *ios) break; } + power_mode = ios->power_mode; return 0; } diff --git a/arch/arm/mach-ux500/board-u5500-sdi.c b/arch/arm/mach-ux500/board-u5500-sdi.c index b2801f76fa1..881035c4f4d 100644 --- a/arch/arm/mach-ux500/board-u5500-sdi.c +++ b/arch/arm/mach-ux500/board-u5500-sdi.c @@ -66,6 +66,11 @@ static struct mmci_platform_data u5500_sdi0_data = { static int u5500_sdi1_ios_handler(struct device *dev, struct mmc_ios *ios) { + static int power_mode = -1; + + if (power_mode == ios->power_mode) + return 0; + switch (ios->power_mode) { case MMC_POWER_UP: case MMC_POWER_ON: @@ -85,6 +90,7 @@ static int u5500_sdi1_ios_handler(struct device *dev, struct mmc_ios *ios) break; } + power_mode = ios->power_mode; return 0; } |