aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2016-04-20 16:49:19 +0000
committerJohn Crispin <blogic@openwrt.org>2016-04-20 16:49:19 +0000
commit53c70521a69e303a01387746dd45297dab48a0d7 (patch)
treec403ef5e19586668b4bd533c9e32a977f0a7ab7e
parentdfcf8a8dbe2e77b7b5797838d809e778dba0ff9f (diff)
downloadupstream-53c70521a69e303a01387746dd45297dab48a0d7.tar.gz
upstream-53c70521a69e303a01387746dd45297dab48a0d7.tar.bz2
upstream-53c70521a69e303a01387746dd45297dab48a0d7.zip
ramips: fix 16 bit IO on newer cores
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@49203 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/ramips/patches-3.18/0061-SPI-ralink-add-mt7621-SoC-spi-driver.patch11
1 files changed, 6 insertions, 5 deletions
diff --git a/target/linux/ramips/patches-3.18/0061-SPI-ralink-add-mt7621-SoC-spi-driver.patch b/target/linux/ramips/patches-3.18/0061-SPI-ralink-add-mt7621-SoC-spi-driver.patch
index f3c359ed90..d52cd2e09d 100644
--- a/target/linux/ramips/patches-3.18/0061-SPI-ralink-add-mt7621-SoC-spi-driver.patch
+++ b/target/linux/ramips/patches-3.18/0061-SPI-ralink-add-mt7621-SoC-spi-driver.patch
@@ -25,7 +25,7 @@
obj-$(CONFIG_SPI_OC_TINY) += spi-oc-tiny.o
--- /dev/null
+++ b/drivers/spi/spi-mt7621.c
-@@ -0,0 +1,390 @@
+@@ -0,0 +1,391 @@
+/*
+ * spi-mt7621.c -- MediaTek MT7621 SPI controller driver
+ *
@@ -217,19 +217,20 @@
+
+ list_for_each_entry(t, &m->transfers, transfer_list) {
+ const u8 *buf = t->tx_buf;
++ int rlen = t->len;
+
+ if (t->rx_buf)
-+ rx_len += t->len;
++ rx_len += rlen;
+
+ if (!buf)
+ continue;
+
-+ if (WARN_ON(len + t->len > 36)) {
++ if (WARN_ON(len + rlen > 36)) {
+ status = -EIO;
+ goto msg_done;
+ }
+
-+ for (i = 0; i < t->len; i++, len++)
++ for (i = 0; i < rlen; i++, len++)
+ data[len / 4] |= buf[i] << (8 * (len & 3));
+ }
+
@@ -363,7 +364,7 @@
+
+ master->setup = mt7621_spi_setup;
+ master->transfer_one_message = mt7621_spi_transfer_one_message;
-+ master->bits_per_word_mask = SPI_BPW_MASK(8);
++ master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 16);
+ master->dev.of_node = pdev->dev.of_node;
+ master->num_chipselect = 2;
+