diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-08 18:28:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-08 18:28:16 -0400 |
commit | 63068465fa9ba8258e341f70c07cd2221b8c114d (patch) | |
tree | 79ec2bc8af8b95c09479ddc0661b2dec89281e92 | |
parent | 35b7ac4c48fa851600c028e088d2239a2cf3dfca (diff) | |
parent | c26971cbb39727b0b692c6236f890ba13046a663 (diff) |
Merge master.kernel.org:/home/rmk/linux-2.6-mmc
-rw-r--r-- | drivers/mmc/mmc.c | 12 | ||||
-rw-r--r-- | drivers/mmc/mmci.c | 2 | ||||
-rw-r--r-- | drivers/mmc/pxamci.c | 4 | ||||
-rw-r--r-- | drivers/mmc/wbsd.c | 4 | ||||
-rw-r--r-- | include/asm-arm/arch-pxa/mmc.h | 1 | ||||
-rw-r--r-- | include/linux/mmc/host.h | 10 |
6 files changed, 23 insertions, 10 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 0a117c61cd18..ceae379a4d4c 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c | |||
@@ -1079,13 +1079,17 @@ static void mmc_setup(struct mmc_host *host) | |||
1079 | /** | 1079 | /** |
1080 | * mmc_detect_change - process change of state on a MMC socket | 1080 | * mmc_detect_change - process change of state on a MMC socket |
1081 | * @host: host which changed state. | 1081 | * @host: host which changed state. |
1082 | * @delay: optional delay to wait before detection (jiffies) | ||
1082 | * | 1083 | * |
1083 | * All we know is that card(s) have been inserted or removed | 1084 | * All we know is that card(s) have been inserted or removed |
1084 | * from the socket(s). We don't know which socket or cards. | 1085 | * from the socket(s). We don't know which socket or cards. |
1085 | */ | 1086 | */ |
1086 | void mmc_detect_change(struct mmc_host *host) | 1087 | void mmc_detect_change(struct mmc_host *host, unsigned long delay) |
1087 | { | 1088 | { |
1088 | schedule_work(&host->detect); | 1089 | if (delay) |
1090 | schedule_delayed_work(&host->detect, delay); | ||
1091 | else | ||
1092 | schedule_work(&host->detect); | ||
1089 | } | 1093 | } |
1090 | 1094 | ||
1091 | EXPORT_SYMBOL(mmc_detect_change); | 1095 | EXPORT_SYMBOL(mmc_detect_change); |
@@ -1189,7 +1193,7 @@ int mmc_add_host(struct mmc_host *host) | |||
1189 | ret = mmc_add_host_sysfs(host); | 1193 | ret = mmc_add_host_sysfs(host); |
1190 | if (ret == 0) { | 1194 | if (ret == 0) { |
1191 | mmc_power_off(host); | 1195 | mmc_power_off(host); |
1192 | mmc_detect_change(host); | 1196 | mmc_detect_change(host, 0); |
1193 | } | 1197 | } |
1194 | 1198 | ||
1195 | return ret; | 1199 | return ret; |
@@ -1259,7 +1263,7 @@ EXPORT_SYMBOL(mmc_suspend_host); | |||
1259 | */ | 1263 | */ |
1260 | int mmc_resume_host(struct mmc_host *host) | 1264 | int mmc_resume_host(struct mmc_host *host) |
1261 | { | 1265 | { |
1262 | mmc_detect_change(host); | 1266 | mmc_detect_change(host, 0); |
1263 | 1267 | ||
1264 | return 0; | 1268 | return 0; |
1265 | } | 1269 | } |
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c index 716c4ef4faf6..91c74843dc0d 100644 --- a/drivers/mmc/mmci.c +++ b/drivers/mmc/mmci.c | |||
@@ -442,7 +442,7 @@ static void mmci_check_status(unsigned long data) | |||
442 | 442 | ||
443 | status = host->plat->status(mmc_dev(host->mmc)); | 443 | status = host->plat->status(mmc_dev(host->mmc)); |
444 | if (status ^ host->oldstat) | 444 | if (status ^ host->oldstat) |
445 | mmc_detect_change(host->mmc); | 445 | mmc_detect_change(host->mmc, 0); |
446 | 446 | ||
447 | host->oldstat = status; | 447 | host->oldstat = status; |
448 | mod_timer(&host->timer, jiffies + HZ); | 448 | mod_timer(&host->timer, jiffies + HZ); |
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c index e99a53b09e32..b53af57074e3 100644 --- a/drivers/mmc/pxamci.c +++ b/drivers/mmc/pxamci.c | |||
@@ -423,7 +423,9 @@ static void pxamci_dma_irq(int dma, void *devid, struct pt_regs *regs) | |||
423 | 423 | ||
424 | static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs *regs) | 424 | static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs *regs) |
425 | { | 425 | { |
426 | mmc_detect_change(devid); | 426 | struct pxamci_host *host = mmc_priv(devid); |
427 | |||
428 | mmc_detect_change(devid, host->pdata->detect_delay); | ||
427 | return IRQ_HANDLED; | 429 | return IRQ_HANDLED; |
428 | } | 430 | } |
429 | 431 | ||
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index dec01d38c782..a62c86fef5cc 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c | |||
@@ -1122,7 +1122,7 @@ static void wbsd_detect_card(unsigned long data) | |||
1122 | 1122 | ||
1123 | DBG("Executing card detection\n"); | 1123 | DBG("Executing card detection\n"); |
1124 | 1124 | ||
1125 | mmc_detect_change(host->mmc); | 1125 | mmc_detect_change(host->mmc, 0); |
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | /* | 1128 | /* |
@@ -1198,7 +1198,7 @@ static void wbsd_tasklet_card(unsigned long param) | |||
1198 | */ | 1198 | */ |
1199 | spin_unlock(&host->lock); | 1199 | spin_unlock(&host->lock); |
1200 | 1200 | ||
1201 | mmc_detect_change(host->mmc); | 1201 | mmc_detect_change(host->mmc, 0); |
1202 | } | 1202 | } |
1203 | else | 1203 | else |
1204 | spin_unlock(&host->lock); | 1204 | spin_unlock(&host->lock); |
diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h index 9718063a2119..88c17dd02ed2 100644 --- a/include/asm-arm/arch-pxa/mmc.h +++ b/include/asm-arm/arch-pxa/mmc.h | |||
@@ -9,6 +9,7 @@ struct mmc_host; | |||
9 | 9 | ||
10 | struct pxamci_platform_data { | 10 | struct pxamci_platform_data { |
11 | unsigned int ocr_mask; /* available voltages */ | 11 | unsigned int ocr_mask; /* available voltages */ |
12 | unsigned long detect_delay; /* delay in jiffies before detecting cards after interrupt */ | ||
12 | int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *); | 13 | int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *); |
13 | int (*get_ro)(struct device *); | 14 | int (*get_ro)(struct device *); |
14 | void (*setpower)(struct device *, unsigned int); | 15 | void (*setpower)(struct device *, unsigned int); |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 6014160d9c06..c1f021eddffa 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -109,6 +109,8 @@ struct mmc_host { | |||
109 | struct mmc_card *card_selected; /* the selected MMC card */ | 109 | struct mmc_card *card_selected; /* the selected MMC card */ |
110 | 110 | ||
111 | struct work_struct detect; | 111 | struct work_struct detect; |
112 | |||
113 | unsigned long private[0] ____cacheline_aligned; | ||
112 | }; | 114 | }; |
113 | 115 | ||
114 | extern struct mmc_host *mmc_alloc_host(int extra, struct device *); | 116 | extern struct mmc_host *mmc_alloc_host(int extra, struct device *); |
@@ -116,14 +118,18 @@ extern int mmc_add_host(struct mmc_host *); | |||
116 | extern void mmc_remove_host(struct mmc_host *); | 118 | extern void mmc_remove_host(struct mmc_host *); |
117 | extern void mmc_free_host(struct mmc_host *); | 119 | extern void mmc_free_host(struct mmc_host *); |
118 | 120 | ||
119 | #define mmc_priv(x) ((void *)((x) + 1)) | 121 | static inline void *mmc_priv(struct mmc_host *host) |
122 | { | ||
123 | return (void *)host->private; | ||
124 | } | ||
125 | |||
120 | #define mmc_dev(x) ((x)->dev) | 126 | #define mmc_dev(x) ((x)->dev) |
121 | #define mmc_hostname(x) ((x)->class_dev.class_id) | 127 | #define mmc_hostname(x) ((x)->class_dev.class_id) |
122 | 128 | ||
123 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); | 129 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); |
124 | extern int mmc_resume_host(struct mmc_host *); | 130 | extern int mmc_resume_host(struct mmc_host *); |
125 | 131 | ||
126 | extern void mmc_detect_change(struct mmc_host *); | 132 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); |
127 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 133 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); |
128 | 134 | ||
129 | #endif | 135 | #endif |