From patchwork Mon Aug 15 05:51:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 1066732 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7F5pea1015400 for ; Mon, 15 Aug 2011 05:51:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752461Ab1HOFvk (ORCPT ); Mon, 15 Aug 2011 01:51:40 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:43004 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752229Ab1HOFvj (ORCPT ); Mon, 15 Aug 2011 01:51:39 -0400 Received: from joe.akashicho.tokyo.vergenet.net (joe.akashicho.tokyo.vergenet.net [IPv6:2001:470:f44f:403:1ec1:deff:fe98:754d]) by kirsty.vergenet.net (Postfix) with ESMTP id E4C00245A6; Mon, 15 Aug 2011 15:51:35 +1000 (EST) Received: by joe.akashicho.tokyo.vergenet.net (Postfix, from userid 7100) id 9F46D28A035; Mon, 15 Aug 2011 14:51:33 +0900 (JST) From: Simon Horman To: linux-mmc@vger.kernel.org, linux-sh@vger.kernel.org Cc: Chris Ball , Guennadi Liakhovetski , Magnus Damm , Simon Horman Subject: [PATCH 3/4] mmc: tmio, sdhi: Provide separate interrupt hadnlers Date: Mon, 15 Aug 2011 14:51:27 +0900 Message-Id: <1313387488-28175-4-git-send-email-horms@verge.net.au> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1313387488-28175-1-git-send-email-horms@verge.net.au> References: <1313387488-28175-1-git-send-email-horms@verge.net.au> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 15 Aug 2011 05:51:41 +0000 (UTC) Provide separate interrupt handlers which may be used by platforms where SDHI has three interrupt sources. Cc: Guennadi Liakhovetski Cc: Magnus Damm Signed-off-by: Simon Horman --- drivers/mmc/host/tmio_mmc.h | 3 +++ drivers/mmc/host/tmio_mmc_pio.c | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index eeaf643..647a24c 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -93,6 +93,9 @@ void tmio_mmc_do_data_irq(struct tmio_mmc_host *host); void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i); void tmio_mmc_disable_mmc_irqs(struct tmio_mmc_host *host, u32 i); irqreturn_t tmio_mmc_irq(int irq, void *devid); +irqreturn_t tmio_mmc_card_access_irq(int irq, void *devid); +irqreturn_t tmio_mmc_card_detect_irq(int irq, void *devid); +irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid); static inline char *tmio_mmc_kmap_atomic(struct scatterlist *sg, unsigned long *flags) diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index 3880750..322aa1b 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -570,6 +570,18 @@ static void __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host, } } +irqreturn_t tmio_mmc_card_detect_irq(int irq, void *devid) +{ + unsigned int ireg, irq_mask, status; + struct tmio_mmc_host *host = devid; + + pr_debug("MMC Card Detect IRQ begin\n"); + tmio_mmc_card_irq_status(host, &ireg, &irq_mask, &status); + __tmio_mmc_card_detect_irq(host, ireg, irq_mask, status); + + return IRQ_HANDLED; +} + void __tmio_mmc_card_access_irq(struct tmio_mmc_host *host, int ireg, int irq_mask, int status) { @@ -594,12 +606,23 @@ void __tmio_mmc_card_access_irq(struct tmio_mmc_host *host, } } -static void __tmio_mmc_card_irq(struct tmio_mmc_host *host) +irqreturn_t tmio_mmc_card_access_irq(int irq, void *devid) { unsigned int ireg, irq_mask, status; + struct tmio_mmc_host *host = devid; + pr_debug("MMC Card Access IRQ begin\n"); tmio_mmc_card_irq_status(host, &ireg, &irq_mask, &status); + __tmio_mmc_card_detect_irq(host, ireg, irq_mask, status); + return IRQ_HANDLED; +} + +static void __tmio_mmc_card_irq(struct tmio_mmc_host *host) +{ + unsigned int ireg, irq_mask, status; + + tmio_mmc_card_irq_status(host, &ireg, &irq_mask, &status); __tmio_mmc_card_detect_irq(host, ireg, irq_mask, status); __tmio_mmc_card_access_irq(host, ireg, irq_mask, status); } @@ -623,6 +646,16 @@ static void __tmio_mmc_sdio_irq(struct tmio_mmc_host *host) mmc_signal_sdio_irq(mmc); } +irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid) +{ + struct tmio_mmc_host *host = devid; + + pr_debug("MMC SDIO IRQ begin\n"); + __tmio_mmc_sdio_irq(host); + + return IRQ_HANDLED; +} + irqreturn_t tmio_mmc_irq(int irq, void *devid) { struct tmio_mmc_host *host = devid;