From patchwork Fri Oct 16 17:43:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madhusudhan X-Patchwork-Id: 54344 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9GHhlrk028590 for ; Fri, 16 Oct 2009 17:43:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753367AbZJPRnl (ORCPT ); Fri, 16 Oct 2009 13:43:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753248AbZJPRnk (ORCPT ); Fri, 16 Oct 2009 13:43:40 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:50957 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753183AbZJPRnj (ORCPT ); Fri, 16 Oct 2009 13:43:39 -0400 Received: from dlep35.itg.ti.com ([157.170.170.118]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9GHhglD002087 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Oct 2009 12:43:42 -0500 Received: from webmail.ti.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id n9GHhcer015602; Fri, 16 Oct 2009 12:43:40 -0500 (CDT) Received: from 192.168.10.89 (proxying for 128.247.79.84) (SquirrelMail authenticated user x0070977); by dbdmail.itg.ti.com with HTTP; Fri, 16 Oct 2009 23:13:41 +0530 (IST) Message-ID: <42153.192.168.10.89.1255715021.squirrel@dbdmail.itg.ti.com> In-Reply-To: <4AD81DC2.4080607@googlemail.com> References: <4b73d43f0910151330q6c5cae7sa2a5948b586cc215@mail.gmail.com> <4AD81DC2.4080607@googlemail.com> Date: Fri, 16 Oct 2009 23:13:41 +0530 (IST) Subject: Re: MMC_CAP_SDIO_IRQ for omap 3430 From: "Madhusudhan Chikkature" To: "Dirk Behme" , linux-mmc@vger.kernel.org Cc: "John Rigby" , linux-omap@vger.kernel.org, "Steve Sakoman" User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Index: linux-beagle/drivers/mmc/host/omap_hsmmc.c =================================================================== --- linux-beagle.orig/drivers/mmc/host/omap_hsmmc.c +++ linux-beagle/drivers/mmc/host/omap_hsmmc.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -65,6 +66,7 @@ #define SDVSDET 0x00000400 #define AUTOIDLE 0x1 #define SDBP (1 << 8) +#define IBG (1 << 19) #define DTO 0xe #define ICE 0x1 #define ICS 0x2 @@ -76,6 +78,7 @@ #define INT_EN_MASK 0x307F0033 #define BWR_ENABLE (1 << 4) #define BRR_ENABLE (1 << 5) +#define CIRQ_ENABLE (1 << 8) #define INIT_STREAM (1 << 1) #define DP_SELECT (1 << 21) #define DDIR (1 << 4) @@ -87,6 +90,7 @@ #define CC 0x1 #define TC 0x02 #define OD 0x1 +#define CIRQ (1 << 8) #define ERR (1 << 15) #define CMD_TIMEOUT (1 << 16) #define DATA_TIMEOUT (1 << 20) @@ -653,6 +657,15 @@ static irqreturn_t omap_hsmmc_irq(int ir status = OMAP_HSMMC_READ(host->base, STAT); dev_dbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status); + if (status & CIRQ) { + dev_dbg(mmc_dev(host->mmc), "SDIO interrupt"); + OMAP_HSMMC_WRITE(host->base, IE, OMAP_HSMMC_READ(host->base, IE) + & ~(CIRQ_ENABLE)); + mmc_signal_sdio_irq(host->mmc); + spin_unlock(&host->irq_lock); + return IRQ_HANDLED; + } + if (status & ERR) { #ifdef CONFIG_MMC_DEBUG omap_hsmmc_report_irq(host, status); @@ -1165,8 +1178,15 @@ static void omap_hsmmc_set_ios(struct mm break; case MMC_BUS_WIDTH_4: OMAP_HSMMC_WRITE(host->base, CON, con & ~DW8); - OMAP_HSMMC_WRITE(host->base, HCTL, - OMAP_HSMMC_READ(host->base, HCTL) | FOUR_BIT); + if (mmc_card_sdio(host->mmc->card)) { I wish it could be moved to "enable_sdio_irq" so that we can avoid inclusion of card.h and checking the type of card in the host controller driver. But the dependancy on 4-bit seems to be a problem here. On the problems being discussed on testing is the interrupt source geting cleared at the SDIO card level upon genaration of the CIRQ? If not it remains asserted. + OMAP_HSMMC_WRITE(host->base, HCTL, + OMAP_HSMMC_READ(host->base, HCTL)