diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2005-09-09 13:54:03 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-09-09 13:54:03 -0400 |
commit | aa6c2e794f7e1f54dc52c84471c750327fa21ccd (patch) | |
tree | 4926d8d06260bb68fadfca2d1adf23ef68e0d53c /arch/arm/mach-pxa | |
parent | 9b9eb8c06177f07657ad35440b56cbf68e1d253b (diff) |
[ARM] 2893/1: [MMC] Update corgi to use the new mmc delayed detection function
Patch from Richard Purdie
We can remove this timer and its associated code from the corgi
platform code now mmc_detect_change() and the pxamci code support
an optional delay.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r-- | arch/arm/mach-pxa/corgi.c | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 29185acdd9e1..07b5dd453565 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -131,27 +131,12 @@ static struct platform_device corgits_device = { | |||
131 | /* | 131 | /* |
132 | * MMC/SD Device | 132 | * MMC/SD Device |
133 | * | 133 | * |
134 | * The card detect interrupt isn't debounced so we delay it by HZ/4 | 134 | * The card detect interrupt isn't debounced so we delay it by 250ms |
135 | * to give the card a chance to fully insert/eject. | 135 | * to give the card a chance to fully insert/eject. |
136 | */ | 136 | */ |
137 | static struct mmc_detect { | 137 | static struct pxamci_platform_data corgi_mci_platform_data; |
138 | struct timer_list detect_timer; | ||
139 | void *devid; | ||
140 | } mmc_detect; | ||
141 | 138 | ||
142 | static void mmc_detect_callback(unsigned long data) | 139 | static int corgi_mci_init(struct device *dev, irqreturn_t (*corgi_detect_int)(int, void *, struct pt_regs *), void *data) |
143 | { | ||
144 | mmc_detect_change(mmc_detect.devid); | ||
145 | } | ||
146 | |||
147 | static irqreturn_t corgi_mmc_detect_int(int irq, void *devid, struct pt_regs *regs) | ||
148 | { | ||
149 | mmc_detect.devid=devid; | ||
150 | mod_timer(&mmc_detect.detect_timer, jiffies + HZ/4); | ||
151 | return IRQ_HANDLED; | ||
152 | } | ||
153 | |||
154 | static int corgi_mci_init(struct device *dev, irqreturn_t (*unused_detect_int)(int, void *, struct pt_regs *), void *data) | ||
155 | { | 140 | { |
156 | int err; | 141 | int err; |
157 | 142 | ||
@@ -161,11 +146,9 @@ static int corgi_mci_init(struct device *dev, irqreturn_t (*unused_detect_int)(i | |||
161 | pxa_gpio_mode(CORGI_GPIO_nSD_DETECT | GPIO_IN); | 146 | pxa_gpio_mode(CORGI_GPIO_nSD_DETECT | GPIO_IN); |
162 | pxa_gpio_mode(CORGI_GPIO_SD_PWR | GPIO_OUT); | 147 | pxa_gpio_mode(CORGI_GPIO_SD_PWR | GPIO_OUT); |
163 | 148 | ||
164 | init_timer(&mmc_detect.detect_timer); | 149 | corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250); |
165 | mmc_detect.detect_timer.function = mmc_detect_callback; | ||
166 | mmc_detect.detect_timer.data = (unsigned long) &mmc_detect; | ||
167 | 150 | ||
168 | err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_mmc_detect_int, SA_INTERRUPT, | 151 | err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int, SA_INTERRUPT, |
169 | "MMC card detect", data); | 152 | "MMC card detect", data); |
170 | if (err) { | 153 | if (err) { |
171 | printk(KERN_ERR "corgi_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); | 154 | printk(KERN_ERR "corgi_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); |
@@ -198,7 +181,6 @@ static int corgi_mci_get_ro(struct device *dev) | |||
198 | static void corgi_mci_exit(struct device *dev, void *data) | 181 | static void corgi_mci_exit(struct device *dev, void *data) |
199 | { | 182 | { |
200 | free_irq(CORGI_IRQ_GPIO_nSD_DETECT, data); | 183 | free_irq(CORGI_IRQ_GPIO_nSD_DETECT, data); |
201 | del_timer(&mmc_detect.detect_timer); | ||
202 | } | 184 | } |
203 | 185 | ||
204 | static struct pxamci_platform_data corgi_mci_platform_data = { | 186 | static struct pxamci_platform_data corgi_mci_platform_data = { |