aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/patches-3.10/0126-spi-introduce-macros-to-set-bits_per_word_mask.patch
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-03-18 19:21:56 +0000
committerJohn Crispin <blogic@openwrt.org>2014-03-18 19:21:56 +0000
commitde51ae36beb618be705b292e32610a2e3efae330 (patch)
tree5bd54a4e1462f1d3bd187b2af9d1f2d1d4f00d55 /target/linux/ramips/patches-3.10/0126-spi-introduce-macros-to-set-bits_per_word_mask.patch
parent694bc2270f53c34cdf86d5067040481f37e44e00 (diff)
downloadmaster-187ad058-de51ae36beb618be705b292e32610a2e3efae330.tar.gz
master-187ad058-de51ae36beb618be705b292e32610a2e3efae330.tar.bz2
master-187ad058-de51ae36beb618be705b292e32610a2e3efae330.zip
ralink: refresh patches
Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39949 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/patches-3.10/0126-spi-introduce-macros-to-set-bits_per_word_mask.patch')
-rw-r--r--target/linux/ramips/patches-3.10/0126-spi-introduce-macros-to-set-bits_per_word_mask.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-3.10/0126-spi-introduce-macros-to-set-bits_per_word_mask.patch b/target/linux/ramips/patches-3.10/0126-spi-introduce-macros-to-set-bits_per_word_mask.patch
new file mode 100644
index 0000000000..1dcba05078
--- /dev/null
+++ b/target/linux/ramips/patches-3.10/0126-spi-introduce-macros-to-set-bits_per_word_mask.patch
@@ -0,0 +1,29 @@
+From b07600f50efe84d7e3b431e6d10fe774bb00d573 Mon Sep 17 00:00:00 2001
+From: Stephen Warren <swarren@wwwdotorg.org>
+Date: Tue, 21 May 2013 20:36:34 -0600
+Subject: [PATCH 126/133] spi: introduce macros to set bits_per_word_mask
+
+Introduce two macros to make setting up spi_master.bits_per_word_mask
+easier, and avoid mistakes like writing BIT(n) instead of BIT(n - 1).
+
+SPI_BPW_MASK is for a single supported value of bits_per_word_mask.
+
+SPI_BPW_RANGE_MASK represents a contiguous set of bit lengths.
+
+Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
+Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+---
+ include/linux/spi/spi.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/include/linux/spi/spi.h
++++ b/include/linux/spi/spi.h
+@@ -308,6 +308,8 @@ struct spi_master {
+
+ /* bitmask of supported bits_per_word for transfers */
+ u32 bits_per_word_mask;
++#define SPI_BPW_MASK(bits) BIT((bits) - 1)
++#define SPI_BPW_RANGE_MASK(min, max) ((BIT(max) - 1) - (BIT(min) - 1))
+
+ /* other constraints relevant to this driver */
+ u16 flags;