aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-07-24 02:09:39 -0400
committerPierre Ossman <drzeus@drzeus.cx>2007-09-23 21:13:08 +0200
commit17b759aff916b4d02721e75ce5ed82b1903e5bd6 (patch)
treeeef4463cbc556e7ae4bd78dba0e6acd861b283c3 /drivers/mmc/core
parent112c9db91ee6bf19eca7cbb6854be3127381c229 (diff)
sdio: add interface for host side SDIO interrupt reporting
Signed-off-by: Nicolas Pitre <npitre@mvista.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/host.c3
-rw-r--r--drivers/mmc/core/sdio_irq.c8
2 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 2c7ce8f43a9..37b761891d6 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -100,6 +100,9 @@ int mmc_add_host(struct mmc_host *host)
{
int err;
+ WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) &&
+ !host->ops->enable_sdio_irq);
+
if (!idr_pre_get(&mmc_host_idr, GFP_KERNEL))
return -ENOMEM;
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index 01922d29241..01daee934d1 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -70,7 +70,8 @@ static int sdio_irq_thread(void *_host)
* asynchronous notification of pending SDIO card interrupts
* hence we poll for them in that case.
*/
- period = msecs_to_jiffies(10);
+ period = (host->caps & MMC_CAP_SDIO_IRQ) ?
+ MAX_SCHEDULE_TIMEOUT : msecs_to_jiffies(10);
pr_debug("%s: IRQ thread started (poll period = %lu jiffies)\n",
mmc_hostname(host), period);
@@ -104,11 +105,16 @@ static int sdio_irq_thread(void *_host)
ssleep(1);
set_task_state(current, TASK_INTERRUPTIBLE);
+ if (host->caps & MMC_CAP_SDIO_IRQ)
+ host->ops->enable_sdio_irq(host, 1);
if (!kthread_should_stop())
schedule_timeout(period);
set_task_state(current, TASK_RUNNING);
} while (!kthread_should_stop());
+ if (host->caps & MMC_CAP_SDIO_IRQ)
+ host->ops->enable_sdio_irq(host, 0);
+
pr_debug("%s: IRQ thread exiting with code %d\n",
mmc_hostname(host), ret);