diff options
author | Felix Fietkau <nbd@nbd.name> | 2018-02-22 10:09:30 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-02-24 16:05:28 +0100 |
commit | bcf4a5f474d1899af65f0974914f737bf9a8d9dd (patch) | |
tree | c83ce8309a4820e71d80ab250280042f5725bae5 /target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch | |
parent | 46c49d83815a84225c1bfcb54fd96b9f73c7c2cb (diff) | |
download | upstream-bcf4a5f474d1899af65f0974914f737bf9a8d9dd.tar.gz upstream-bcf4a5f474d1899af65f0974914f737bf9a8d9dd.tar.bz2 upstream-bcf4a5f474d1899af65f0974914f737bf9a8d9dd.zip |
ramips: remove chunked-io patch and set spi->max_transfer_size instead
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch')
-rw-r--r-- | target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch b/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch index bc5418bab2..5f939e3e40 100644 --- a/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch +++ b/target/linux/ramips/patches-4.14/0043-spi-add-mt7621-support.patch @@ -38,7 +38,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org> obj-$(CONFIG_SPI_OC_TINY) += spi-oc-tiny.o --- /dev/null +++ b/drivers/spi/spi-mt7621.c -@@ -0,0 +1,483 @@ +@@ -0,0 +1,491 @@ +/* + * spi-mt7621.c -- MediaTek MT7621 SPI controller driver + * @@ -243,10 +243,12 @@ Signed-off-by: John Crispin <blogic@openwrt.org> + if (t->speed_hz < speed) + speed = t->speed_hz; + -+ if (WARN_ON(len + t->len > 36)) { -+ status = -EIO; -+ goto msg_done; -+ } ++ /* ++ * m25p80 might attempt to write more data than we can handle. ++ * truncate the message to what we can fit into the registers ++ */ ++ if (len + t->len > 36) ++ t->len = 36 - len; + + for (i = 0; i < t->len; i++, len++) + data[len / 4] |= buf[i] << (8 * (len & 3)); @@ -426,6 +428,11 @@ Signed-off-by: John Crispin <blogic@openwrt.org> +}; +MODULE_DEVICE_TABLE(of, mt7621_spi_match); + ++static size_t mt7621_max_transfer_size(struct spi_device *spi) ++{ ++ return 32; ++} ++ +static int mt7621_spi_probe(struct platform_device *pdev) +{ + const struct of_device_id *match; @@ -472,6 +479,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org> + master->bits_per_word_mask = SPI_BPW_MASK(8); + master->dev.of_node = pdev->dev.of_node; + master->num_chipselect = 2; ++ master->max_transfer_size = mt7621_max_transfer_size; + + dev_set_drvdata(&pdev->dev, master); + |