summaryrefslogtreecommitdiff
path: root/arch/arm/mach-ux500/board-mop500-sdi.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@stericsson.com>2011-11-03 13:11:53 +0100
committerPhilippe Langlais <philippe.langlais@linaro.org>2012-03-19 08:56:46 +0100
commit4fbdb04bc9449e941576f7a36d592ded16684b4a (patch)
treee8df884b50cb15840e4bec539f5cda0c92afc0a2 /arch/arm/mach-ux500/board-mop500-sdi.c
parent1a587901e4f71fa546dc2758447df68b44c83c86 (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.c6
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 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;
}