diff options
author | Felix Fietkau <nbd@nbd.name> | 2017-11-05 18:34:01 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2017-11-05 18:52:12 +0100 |
commit | e0d58157d8e2ec3da0a1fe62a65aa756c5514871 (patch) | |
tree | 739fe3b9a41f345d5af83c47193aa412cb03288c /target/linux/ar71xx/patches-4.9 | |
parent | e0bd22526906961c15c6d77f17819845677eceb0 (diff) | |
download | mtk-20170518-e0d58157d8e2ec3da0a1fe62a65aa756c5514871.zip mtk-20170518-e0d58157d8e2ec3da0a1fe62a65aa756c5514871.tar.gz mtk-20170518-e0d58157d8e2ec3da0a1fe62a65aa756c5514871.tar.bz2 |
ar71xx: fix flash fast read on devices using multiple flash chips
Add a callback to allow the SPI driver to indicate which devices fast
flash read works on.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/ar71xx/patches-4.9')
-rw-r--r-- | target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch b/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch index 0dc73a8..5c3583f 100644 --- a/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch +++ b/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch @@ -10,10 +10,18 @@ } static void ath79_spi_disable(struct ath79_spi *sp) -@@ -205,6 +202,33 @@ static u32 ath79_spi_txrx_mode0(struct s +@@ -205,6 +202,38 @@ static u32 ath79_spi_txrx_mode0(struct s return ath79_spi_rr(sp, AR71XX_SPI_REG_RDS); } ++static bool ath79_spi_flash_read_supported(struct spi_device *spi) ++{ ++ if (spi->chip_select || gpio_is_valid(spi->cs_gpio)) ++ return false; ++ ++ return true; ++} ++ +static int ath79_spi_read_flash_data(struct spi_device *spi, + struct spi_flash_read_message *msg) +{ @@ -22,9 +30,6 @@ + if (msg->addr_width > 3) + return -EOPNOTSUPP; + -+ if (spi->chip_select || gpio_is_valid(spi->cs_gpio)) -+ return -EOPNOTSUPP; -+ + /* disable GPIO mode */ + ath79_spi_wr(sp, AR71XX_SPI_REG_FS, 0); + @@ -44,11 +49,12 @@ static int ath79_spi_probe(struct platform_device *pdev) { struct spi_master *master; -@@ -234,6 +258,7 @@ static int ath79_spi_probe(struct platfo +@@ -234,6 +263,8 @@ static int ath79_spi_probe(struct platfo master->num_chipselect = pdata->num_chipselect; master->cs_gpios = pdata->cs_gpios; } + master->spi_flash_read = ath79_spi_read_flash_data; ++ master->flash_read_supported = ath79_spi_flash_read_supported; sp->bitbang.master = master; sp->bitbang.chipselect = ath79_spi_chipselect; |