From 4352c2858f89b4d913fd2b30268d42f78b2e5f01 Mon Sep 17 00:00:00 2001 From: jogo Date: Sat, 24 Nov 2012 14:19:09 +0000 Subject: bcm63xx: fix spi transfer handling * Accept transfers without bits_per_word set. * Work around the inability of the hardware of keeping CS asserted. Signed-off-by: Jonas Gorski git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34320 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...bcm63xx-fix-transfer-bits_per_words-check.patch | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 target/linux/brcm63xx/patches-3.3/109-bcm63xx-fix-transfer-bits_per_words-check.patch (limited to 'target/linux/brcm63xx/patches-3.3/109-bcm63xx-fix-transfer-bits_per_words-check.patch') diff --git a/target/linux/brcm63xx/patches-3.3/109-bcm63xx-fix-transfer-bits_per_words-check.patch b/target/linux/brcm63xx/patches-3.3/109-bcm63xx-fix-transfer-bits_per_words-check.patch new file mode 100644 index 000000000..37d9d49d6 --- /dev/null +++ b/target/linux/brcm63xx/patches-3.3/109-bcm63xx-fix-transfer-bits_per_words-check.patch @@ -0,0 +1,29 @@ +From fbef4dff80be6254e36ab5b9c655d248a3991ded Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 24 Nov 2012 12:08:22 +0100 +Subject: [PATCH 3.7] spi/bcm63xx: fix transfer bits_per_words check + +Transfers often do not have bits_per_words set, so use the spi device's +bits_per_words in this case. + +This fixes the driver rejecting valid transfers e.g. generated by +spi_write() or spi_read(). + +Cc: stable@vger.kernel.org +Signed-off-by: Jonas Gorski +--- + drivers/spi/spi-bcm63xx.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/spi/spi-bcm63xx.c ++++ b/drivers/spi/spi-bcm63xx.c +@@ -103,7 +103,8 @@ static int bcm63xx_spi_check_transfer(st + { + u8 bits_per_word; + +- bits_per_word = (t) ? t->bits_per_word : spi->bits_per_word; ++ bits_per_word = (t && t->bits_per_word) ? ++ t->bits_per_word : spi->bits_per_word; + if (bits_per_word != 8) { + dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", + __func__, bits_per_word); -- cgit v1.2.3