aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorStefan Nilsson XK <stefan.xk.nilsson@stericsson.com>2011-04-26 23:07:49 +0200
committerHenrik Aberg <henrik.aberg@stericsson.com>2011-05-18 09:40:08 +0200
commitcf76e455faedb8f85e38e2d9f3af3c6ee52237ee (patch)
tree51ee1790cbfdc3475d507658d9af957a4b6a7d3a /drivers/mmc
parent44fd3adcd961b7fa5ceaa01d1631101a5c51e6cc (diff)
SDIO: Optimized SDIO IRQ handling
If there is only 1 function registered, and IRQ:s are supported and currently enabled, then there is no need to check the CCCR registers. ST-Ericsson ID: ER318044 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I99699bc6bb7e28b43bb88c977c1b8a09ad877ae3 Signed-off-by: Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21666 Reviewed-by: QATEST Reviewed-by: Sebastian RASMUSSEN <sebastian.rasmussen@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/sdio_irq.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index 69802351996..96f81237d75 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -34,6 +34,22 @@ static int process_sdio_pending_irqs(struct mmc_card *card)
int i, ret, count;
unsigned char pending;
+ /*
+ * Optimization, if there is only 1 function registered
+ * and IRQ:s are supported and currently enabled, then
+ * we can assume that this actually is an IRQ and we can
+ * call the registered IRQ handler directly without
+ * checking the CCCR registers.
+ */
+ if ((card->host->caps & MMC_CAP_SDIO_IRQ) &&
+ card->host->sdio_irqs && (card->sdio_funcs == 1)) {
+ struct sdio_func *func = card->sdio_func[0];
+ if (func && func->irq_handler) {
+ func->irq_handler(func);
+ return 1;
+ }
+ }
+
ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_INTx, 0, &pending);
if (ret) {
printk(KERN_DEBUG "%s: error %d reading SDIO_CCCR_INTx\n",