Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35477 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757102Ab0DFCn1 (ORCPT ); Mon, 5 Apr 2010 22:43:27 -0400 Subject: Re: [PATCH] libertas/sdio: set ECSI bit for 1-bit transfers From: Dan Williams To: Daniel Mack Cc: linux-kernel@vger.kernel.org, mirqus@gmail.com, Alagu Sankar , Volker Ernst , "John W. Linville" , Holger Schurig , Bing Zhao , libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org In-Reply-To: <1270042309-18606-1-git-send-email-daniel@caiaq.de> References: <1270042309-18606-1-git-send-email-daniel@caiaq.de> Content-Type: text/plain; charset="UTF-8" Date: Mon, 05 Apr 2010 19:42:39 -0700 Message-ID: <1270521759.24724.6.camel@localhost.localdomain> Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Wed, 2010-03-31 at 15:31 +0200, Daniel Mack wrote: > When operating in 1-bit mode, SDAT1 is used as dedicated interrupt line. > However, the 8686 will only drive this line when the ECSI bit is set in > the CCCR_IF register. > > Thanks to Alagu Sankar for pointing me in the right direction. Could you modify the patch to do this *only* for the 8686? Apparently only the 8686 this hardware "quirk" and thus this might have odd side-effects on the 8688 or the 8385. Check the 'struct if_sdio_card' model member and compare it to IF_SDIO_MODEL_8686 like if_sdio_probe() does. Thanks! Dan > Signed-off-by: Daniel Mack > Cc: Alagu Sankar > Cc: Volker Ernst > Cc: Dan Williams > Cc: John W. Linville > Cc: Holger Schurig > Cc: Bing Zhao > Cc: libertas-dev@lists.infradead.org > Cc: linux-wireless@vger.kernel.org > Cc: linux-mmc@vger.kernel.org > --- > drivers/net/wireless/libertas/if_sdio.c | 21 +++++++++++++++++++++ > include/linux/mmc/sdio.h | 2 ++ > 2 files changed, 23 insertions(+), 0 deletions(-) > > diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c > index 7a73f62..f89bb8b 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,24 @@ static int if_sdio_probe(struct sdio_func *func, > if (ret) > goto disable; > > + /* For 1-bit transfers, we need to enable the interrupt flag in > + * the CCCR register. Set the MMC_QUIRK_LENIENT_FN0 bit to allow > + * access to non-vendor registers. */ > + if ((host->caps & MMC_CAP_SDIO_IRQ) && > + (host->ios.bus_width == MMC_BUS_WIDTH_1)) { > + u8 reg; > + > + func->card->quirks |= MMC_QUIRK_LENIENT_FN0; > + reg = sdio_f0_readb(func, SDIO_CCCR_IF, &ret); > + if (ret) > + goto release_int; > + > + reg |= SDIO_BUS_ECSI; > + sdio_f0_writeb(func, reg, SDIO_CCCR_IF, &ret); > + if (ret) > + goto release_int; > + } > + > 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 >