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-19 08:56:46 +0100 |
commit | 4fbdb04bc9449e941576f7a36d592ded16684b4a (patch) | |
tree | e8df884b50cb15840e4bec539f5cda0c92afc0a2 /arch/arm/mach-ux500/board-u5500-sdi.c | |
parent | 1a587901e4f71fa546dc2758447df68b44c83c86 (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
Diffstat (limited to 'arch/arm/mach-ux500/board-u5500-sdi.c')
-rw-r--r-- | arch/arm/mach-ux500/board-u5500-sdi.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |