ar71xx: add support for the TP-LINK TL-WR941ND v5
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / patches-3.14 / 464-spi-ath79-fix-fast-flash-read.patch
1 --- a/drivers/mtd/devices/m25p80.c
2 +++ b/drivers/mtd/devices/m25p80.c
3 @@ -530,6 +530,8 @@ static int m25p80_read(struct mtd_info *
4 if (dummy < 0) {
5 dev_err(&flash->spi->dev, "No valid read command supported\n");
6 return -EINVAL;
7 + } else if (dummy == 1) {
8 + t[0].dummy = true;
9 }
10
11 t[0].type = SPI_TRANSFER_FLASH_READ_CMD;
12 --- a/drivers/spi/spi-ath79.c
13 +++ b/drivers/spi/spi-ath79.c
14 @@ -262,6 +262,10 @@ static int ath79_spi_do_read_flash_cmd(s
15 sp->read_addr = 0;
16
17 len = t->len - 1;
18 +
19 + if (t->dummy)
20 + len -= 1;
21 +
22 p = t->tx_buf;
23
24 while (len--) {
25 --- a/include/linux/spi/spi.h
26 +++ b/include/linux/spi/spi.h
27 @@ -598,6 +598,7 @@ struct spi_transfer {
28 u16 delay_usecs;
29 u32 speed_hz;
30 enum spi_transfer_type type;
31 + bool dummy;
32
33 struct list_head transfer_list;
34 };