[ar71xx] fix GPIO function select bit definitions (based on a patch by Jonas <jmajau...
[openwrt.git] / target / linux / s3c24xx / patches-2.6.26 / 1162-fix-glamo-mci-power-setting-timeout-waiting-for-pcf5.patch
1 From 98c8ab6ee24e43f1a9fdd941695917b426227b85 Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Fri, 25 Jul 2008 23:06:12 +0100
4 Subject: [PATCH] fix-glamo-mci-power-setting-timeout-waiting-for-pcf50633.patch
5
6 Glamo MCI power setting stuff spins on pcf50633
7 but it won't hurt if it gives up after a second or
8 two instead of stalling the resume silently.
9
10 Signed-off-by: Andy Green <andy@openmoko.com>
11 ---
12 arch/arm/mach-s3c2440/mach-gta02.c | 11 +++++++++--
13 1 files changed, 9 insertions(+), 2 deletions(-)
14
15 diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
16 index 5980ea9..69a952a 100644
17 --- a/arch/arm/mach-s3c2440/mach-gta02.c
18 +++ b/arch/arm/mach-s3c2440/mach-gta02.c
19 @@ -1265,6 +1265,7 @@ static void
20 gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd)
21 {
22 int mv = 1650;
23 + int timeout = 100;
24
25 printk(KERN_DEBUG "mmc_set_power(power_mode=%u, vdd=%u\n",
26 power_mode, vdd);
27 @@ -1281,8 +1282,14 @@ gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd)
28 case MMC_POWER_ON:
29 case MMC_POWER_UP:
30 /* depend on pcf50633 driver init + not suspended */
31 - while (pcf50633_ready(pcf50633_global))
32 - msleep(1);
33 + while (pcf50633_ready(pcf50633_global) && (timeout--))
34 + msleep(5);
35 +
36 + if (!timeout) {
37 + printk(KERN_ERR"gta02_glamo_mmc_set_power "
38 + "BAILING on timeout\n");
39 + return;
40 + }
41 /* select and set the voltage */
42 if (vdd > 7) {
43 mv += 300 + 100 * (vdd - 8);
44 --
45 1.5.6.3
46
This page took 0.050641 seconds and 5 git commands to generate.