summaryrefslogtreecommitdiffstats
path: root/target/linux/rb532/patches-2.6.28/003-gpio_bit_setting.patch
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-03-15 12:56:39 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-03-15 12:56:39 +0000
commit47fedb5947414d3b46786a94186b123295ba0f48 (patch)
tree66f5f78c1b6ca8383418b4cd3f5444c4f4716459 /target/linux/rb532/patches-2.6.28/003-gpio_bit_setting.patch
parent474e65cbab6cad7dbf74b7cb62acb02aa12403a3 (diff)
[rb532] add 2.6.28 patches and kernel config
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14884 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/rb532/patches-2.6.28/003-gpio_bit_setting.patch')
-rw-r--r--target/linux/rb532/patches-2.6.28/003-gpio_bit_setting.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/rb532/patches-2.6.28/003-gpio_bit_setting.patch b/target/linux/rb532/patches-2.6.28/003-gpio_bit_setting.patch
new file mode 100644
index 000000000..49f9f4b3b
--- /dev/null
+++ b/target/linux/rb532/patches-2.6.28/003-gpio_bit_setting.patch
@@ -0,0 +1,35 @@
+The algorithm works unconditionally. If bitval is one, the first line is
+a no op and the second line sets the bit at offset position. Vice versa,
+if bitval is zero, the first line clears the bit at offset position and
+the second line is a no op.
+
+Signed-off-by: Phil Sutter <n0-1@freewrt.org>
+---
+ arch/mips/rb532/gpio.c | 6 ++----
+ 1 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c
+index 0e84c8a..e35cb75 100644
+--- a/arch/mips/rb532/gpio.c
++++ b/arch/mips/rb532/gpio.c
+@@ -119,13 +119,11 @@ static inline void rb532_set_bit(unsigned bitval,
+ unsigned long flags;
+ u32 val;
+
+- bitval = !!bitval; /* map parameter to {0,1} */
+-
+ local_irq_save(flags);
+
+ val = readl(ioaddr);
+- val &= ~( ~bitval << offset ); /* unset bit if bitval == 0 */
+- val |= ( bitval << offset ); /* set bit if bitval == 1 */
++ val &= ~(!bitval << offset); /* unset bit if bitval == 0 */
++ val |= (!!bitval << offset); /* set bit if bitval == 1 */
+ writel(val, ioaddr);
+
+ local_irq_restore(flags);
+--
+1.5.6.4
+
+
+