From patchwork Tue Mar 30 17:38:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 89350 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2UHe7NH001432 for ; Tue, 30 Mar 2010 17:40:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752204Ab0C3Rjo (ORCPT ); Tue, 30 Mar 2010 13:39:44 -0400 Received: from buzzloop.caiaq.de ([212.112.241.133]:55007 "EHLO buzzloop.caiaq.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751531Ab0C3Rjn (ORCPT ); Tue, 30 Mar 2010 13:39:43 -0400 Received: from localhost (localhost [127.0.0.1]) by buzzloop.caiaq.de (Postfix) with ESMTP id 601F97F403B; Tue, 30 Mar 2010 19:39:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at buzzloop.caiaq.de Received: from buzzloop.caiaq.de ([127.0.0.1]) by localhost (buzzloop.caiaq.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X+dVdFDp7ZZq; Tue, 30 Mar 2010 19:39:20 +0200 (CEST) Received: from localhost.localdomain (pd95699b2.dip0.t-ipconnect.de [217.86.153.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by buzzloop.caiaq.de (Postfix) with ESMTPSA id 1828F7F4038; Tue, 30 Mar 2010 19:39:19 +0200 (CEST) From: Daniel Mack To: linux-kernel@vger.kernel.org Cc: Daniel Mack , Alagu Sankar , Volker Ernst , Dan Williams , "John W. Linville" , Holger Schurig , Bing Zhao , libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org Subject: [PATCH] libertas/sdio: set ECSI and SCSI bits for 1-bit transfers Date: Tue, 30 Mar 2010 19:38:53 +0200 Message-Id: <1269970733-24681-1-git-send-email-daniel@caiaq.de> X-Mailer: git-send-email 1.7.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 30 Mar 2010 17:40:08 +0000 (UTC) diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index 7a73f62..d3170f2 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include "host.h" #include "decl.h" @@ -942,6 +944,7 @@ static int if_sdio_probe(struct sdio_func *func, int ret, i; unsigned int model; struct if_sdio_packet *packet; + struct mmc_host *host = func->card->host; lbs_deb_enter(LBS_DEB_SDIO); @@ -1022,6 +1025,27 @@ static int if_sdio_probe(struct sdio_func *func, if (ret) goto disable; + /* For 1-bit transfers, we need to enable the interrupt flags in + * the CCCR register. Temporarily set the function number to 0 + * for that. */ + if ((host->caps & MMC_CAP_SDIO_IRQ) && + (host->ios.bus_width == MMC_BUS_WIDTH_1)) { + unsigned int num = func->num; + u8 reg; + + func->num = 0; + reg = sdio_readb(func, SDIO_CCCR_IF, &ret); + if (ret) + goto release_int; + + reg |= SDIO_BUS_ECSI | SDIO_BUS_SCSI; + sdio_writeb(func, reg, SDIO_CCCR_IF, &ret); + if (ret) + goto release_int; + + func->num = num; + } + card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret); if (ret) goto release_int; diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h index 0ebaef5..329a8fa 100644 --- a/include/linux/mmc/sdio.h +++ b/include/linux/mmc/sdio.h @@ -94,6 +94,8 @@ #define SDIO_BUS_WIDTH_1BIT 0x00 #define SDIO_BUS_WIDTH_4BIT 0x02 +#define SDIO_BUS_ECSI 0x20 /* Enable continuous SPI interrupt */ +#define SDIO_BUS_SCSI 0x40 /* Support continuous SPI interrupt */ #define SDIO_BUS_ASYNC_INT 0x20