aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-04-06 04:52:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-06 16:52:06 -0400
commit8a64c0f6b7ec7f758c4ef445e49f479e27fa2236 (patch)
tree291339f33fd32a7076c98d88386b61b2baddc51d
parentcfcfe4469cc39625cb8257355c00dd8f35f900aa (diff)
libertas/sdio: 8686: set ECSI bit for 1-bit transfers
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. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Alagu Sankar <alagusankar@embwise.com> Cc: Volker Ernst <volker.ernst@txtr.com> Cc: Dan Williams <dcbw@redhat.com> Cc: John W. Linville <linville@tuxdriver.com> Cc: Holger Schurig <hs4233@mail.mn-solutions.de> Cc: Bing Zhao <bzhao@marvell.com> Cc: libertas-dev@lists.infradead.org Cc: linux-wireless@vger.kernel.org Cc: linux-mmc@vger.kernel.org Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/libertas/if_sdio.c22
-rw-r--r--include/linux/mmc/sdio.h2
2 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 7a73f625273b..33206a98a572 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -34,6 +34,8 @@
34#include <linux/mmc/card.h> 34#include <linux/mmc/card.h>
35#include <linux/mmc/sdio_func.h> 35#include <linux/mmc/sdio_func.h>
36#include <linux/mmc/sdio_ids.h> 36#include <linux/mmc/sdio_ids.h>
37#include <linux/mmc/sdio.h>
38#include <linux/mmc/host.h>
37 39
38#include "host.h" 40#include "host.h"
39#include "decl.h" 41#include "decl.h"
@@ -942,6 +944,7 @@ static int if_sdio_probe(struct sdio_func *func,
942 int ret, i; 944 int ret, i;
943 unsigned int model; 945 unsigned int model;
944 struct if_sdio_packet *packet; 946 struct if_sdio_packet *packet;
947 struct mmc_host *host = func->card->host;
945 948
946 lbs_deb_enter(LBS_DEB_SDIO); 949 lbs_deb_enter(LBS_DEB_SDIO);
947 950
@@ -1022,6 +1025,25 @@ static int if_sdio_probe(struct sdio_func *func,
1022 if (ret) 1025 if (ret)
1023 goto disable; 1026 goto disable;
1024 1027
1028 /* For 1-bit transfers to the 8686 model, we need to enable the
1029 * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0
1030 * bit to allow access to non-vendor registers. */
1031 if ((card->model == IF_SDIO_MODEL_8686) &&
1032 (host->caps & MMC_CAP_SDIO_IRQ) &&
1033 (host->ios.bus_width == MMC_BUS_WIDTH_1)) {
1034 u8 reg;
1035
1036 func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
1037 reg = sdio_f0_readb(func, SDIO_CCCR_IF, &ret);
1038 if (ret)
1039 goto release_int;
1040
1041 reg |= SDIO_BUS_ECSI;
1042 sdio_f0_writeb(func, reg, SDIO_CCCR_IF, &ret);
1043 if (ret)
1044 goto release_int;
1045 }
1046
1025 card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret); 1047 card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret);
1026 if (ret) 1048 if (ret)
1027 goto release_int; 1049 goto release_int;
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h
index 47ba464f5170..118f0295a575 100644
--- a/include/linux/mmc/sdio.h
+++ b/include/linux/mmc/sdio.h
@@ -94,6 +94,8 @@
94 94
95#define SDIO_BUS_WIDTH_1BIT 0x00 95#define SDIO_BUS_WIDTH_1BIT 0x00
96#define SDIO_BUS_WIDTH_4BIT 0x02 96#define SDIO_BUS_WIDTH_4BIT 0x02
97#define SDIO_BUS_ECSI 0x20 /* Enable continuous SPI interrupt */
98#define SDIO_BUS_SCSI 0x40 /* Support continuous SPI interrupt */
97 99
98#define SDIO_BUS_CD_DISABLE 0x80 /* disable pull-up on DAT3 (pin 1) */ 100#define SDIO_BUS_CD_DISABLE 0x80 /* disable pull-up on DAT3 (pin 1) */
99 101