Skip to content

Commit e75be1f

Browse files
committed
Merge branch 'at91-5.4-trunk/wilc' into linux-5.4-at91
2 parents 5d791ec + 2d7411c commit e75be1f

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

drivers/staging/wilc1000/sdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ static int wilc_sdio_init(struct wilc *wilc, bool resume)
695695
cmd.read_write = 1;
696696
cmd.function = 0;
697697
cmd.raw = 1;
698-
cmd.address = SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF;
698+
cmd.address = SDIO_FBR_BASE(1);
699699
cmd.data = SDIO_FBR_ENABLE_CSA;
700700
ret = wilc_sdio_cmd52(wilc, &cmd);
701701
if (ret) {

drivers/staging/wilc1000/spi.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static u8 wilc_get_crc7(u8 *buffer, u32 len)
4747

4848
#define SPI_RESP_RETRY_COUNT (10)
4949
#define SPI_RETRY_COUNT (10)
50+
#define SPI_ENABLE_VMM_RETRY_LIMIT 2
5051
#define DATA_PKT_SZ_256 256
5152
#define DATA_PKT_SZ_512 512
5253
#define DATA_PKT_SZ_1K 1024
@@ -1172,8 +1173,26 @@ static int wilc_spi_read_int(struct wilc *wilc, u32 *int_status)
11721173

11731174
static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 val)
11741175
{
1175-
return spi_internal_write(wilc,
1176-
WILC_SPI_INT_CLEAR - WILC_SPI_REG_BASE, val);
1176+
int ret;
1177+
int retry = SPI_ENABLE_VMM_RETRY_LIMIT;
1178+
u32 check;
1179+
1180+
while (retry) {
1181+
ret = spi_internal_write(wilc,
1182+
WILC_SPI_INT_CLEAR - WILC_SPI_REG_BASE,
1183+
val);
1184+
if (ret)
1185+
break;
1186+
1187+
ret = spi_internal_read(wilc,
1188+
WILC_SPI_INT_CLEAR - WILC_SPI_REG_BASE,
1189+
&check);
1190+
if (ret || ((check & EN_VMM) == (val & EN_VMM)))
1191+
break;
1192+
1193+
retry--;
1194+
}
1195+
return ret;
11771196
}
11781197

11791198
static int wilc_spi_sync_ext(struct wilc *wilc, int nint)

0 commit comments

Comments
 (0)