summaryrefslogtreecommitdiff
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-09-09 18:54:03 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-09-09 18:54:03 +0100
commitaa6c2e794f7e1f54dc52c84471c750327fa21ccd (patch)
tree4926d8d06260bb68fadfca2d1adf23ef68e0d53c /arch/arm/mach-pxa
parent9b9eb8c06177f07657ad35440b56cbf68e1d253b (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.c28
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 = {
/*
* MMC/SD Device
*
- * The card detect interrupt isn't debounced so we delay it by HZ/4
+ * The card detect interrupt isn't debounced so we delay it by 250ms
* to give the card a chance to fully insert/eject.
*/
-static struct mmc_detect {
- struct timer_list detect_timer;
- void *devid;
-} mmc_detect;
+static struct pxamci_platform_data corgi_mci_platform_data;
-static void mmc_detect_callback(unsigned long data)
-{
- mmc_detect_change(mmc_detect.devid);
-}
-
-static irqreturn_t corgi_mmc_detect_int(int irq, void *devid, struct pt_regs *regs)
-{
- mmc_detect.devid=devid;
- mod_timer(&mmc_detect.detect_timer, jiffies + HZ/4);
- return IRQ_HANDLED;
-}
-
-static int corgi_mci_init(struct device *dev, irqreturn_t (*unused_detect_int)(int, void *, struct pt_regs *), void *data)
+static int corgi_mci_init(struct device *dev, irqreturn_t (*corgi_detect_int)(int, void *, struct pt_regs *), void *data)
{
int err;
@@ -161,11 +146,9 @@ static int corgi_mci_init(struct device *dev, irqreturn_t (*unused_detect_int)(i
pxa_gpio_mode(CORGI_GPIO_nSD_DETECT | GPIO_IN);
pxa_gpio_mode(CORGI_GPIO_SD_PWR | GPIO_OUT);
- init_timer(&mmc_detect.detect_timer);
- mmc_detect.detect_timer.function = mmc_detect_callback;
- mmc_detect.detect_timer.data = (unsigned long) &mmc_detect;
+ corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250);
- err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_mmc_detect_int, SA_INTERRUPT,
+ err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int, SA_INTERRUPT,
"MMC card detect", data);
if (err) {
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)
static void corgi_mci_exit(struct device *dev, void *data)
{
free_irq(CORGI_IRQ_GPIO_nSD_DETECT, data);
- del_timer(&mmc_detect.detect_timer);
}
static struct pxamci_platform_data corgi_mci_platform_data = {