aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/wbsd.c
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2005-09-12 15:36:19 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-09-12 15:36:19 -0400
commit210ce2a7504e429b7ccc191b1efba4c772c4d8b6 (patch)
tree83b765a1f8cd21a8169fcdbadb731db165a32a42 /drivers/mmc/wbsd.c
parente062c8ae85df633f2ecaa5a5af0d9922ced5e074 (diff)
[MMC] Clean up wbsd detection handling
The wbsd driver's card detection routing is a bit of a mess. This patch cleans up the routine and makes it a bit more comprihensible. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc/wbsd.c')
-rw-r--r--drivers/mmc/wbsd.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c
index 46e5f9a17a23..3cbca7cbea80 100644
--- a/drivers/mmc/wbsd.c
+++ b/drivers/mmc/wbsd.c
@@ -1136,6 +1136,7 @@ static void wbsd_tasklet_card(unsigned long param)
1136{ 1136{
1137 struct wbsd_host* host = (struct wbsd_host*)param; 1137 struct wbsd_host* host = (struct wbsd_host*)param;
1138 u8 csr; 1138 u8 csr;
1139 int delay = -1;
1139 1140
1140 spin_lock(&host->lock); 1141 spin_lock(&host->lock);
1141 1142
@@ -1155,16 +1156,8 @@ static void wbsd_tasklet_card(unsigned long param)
1155 DBG("Card inserted\n"); 1156 DBG("Card inserted\n");
1156 host->flags |= WBSD_FCARD_PRESENT; 1157 host->flags |= WBSD_FCARD_PRESENT;
1157 1158
1158 spin_unlock(&host->lock); 1159 delay = 500;
1159
1160 /*
1161 * Delay card detection to allow electrical connections
1162 * to stabilise.
1163 */
1164 mmc_detect_change(host->mmc, msecs_to_jiffies(500));
1165 } 1160 }
1166 else
1167 spin_unlock(&host->lock);
1168 } 1161 }
1169 else if (host->flags & WBSD_FCARD_PRESENT) 1162 else if (host->flags & WBSD_FCARD_PRESENT)
1170 { 1163 {
@@ -1181,15 +1174,17 @@ static void wbsd_tasklet_card(unsigned long param)
1181 tasklet_schedule(&host->finish_tasklet); 1174 tasklet_schedule(&host->finish_tasklet);
1182 } 1175 }
1183 1176
1184 /* 1177 delay = 0;
1185 * Unlock first since we might get a call back.
1186 */
1187 spin_unlock(&host->lock);
1188
1189 mmc_detect_change(host->mmc, 0);
1190 } 1178 }
1191 else 1179
1192 spin_unlock(&host->lock); 1180 /*
1181 * Unlock first since we might get a call back.
1182 */
1183
1184 spin_unlock(&host->lock);
1185
1186 if (delay != -1)
1187 mmc_detect_change(host->mmc, msecs_to_jiffies(delay));
1193} 1188}
1194 1189
1195static void wbsd_tasklet_fifo(unsigned long param) 1190static void wbsd_tasklet_fifo(unsigned long param)