diff options
author | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-11-03 13:11:53 +0100 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:02:58 +0200 |
commit | 04c12decba2b243cb7910547d0d894ab87da96bd (patch) | |
tree | a951c5eead38e644d99e0100ac2eb5ce56bda771 /arch/arm/mach-ux500/board-mop500-sdi.c | |
parent | 82baa9eb77339c5d0c6864a637abc903ea56f9ab (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-mop500-sdi.c')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-sdi.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c index 14a7b6e69d0..d6a42ddd68a 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; } |