summaryrefslogtreecommitdiff
path: root/target/linux/brcm63xx/patches-4.4
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2017-05-14 23:45:31 +0200
committerJonas Gorski <jonas.gorski@gmail.com>2017-06-10 12:40:38 +0200
commit0aa366c6e0f323b161cb61331fd456d3d775dba2 (patch)
treed94ad058a973a35fcddaf310d1b6414962b79e55 /target/linux/brcm63xx/patches-4.4
parentc5d394e9ba83e72552b9e9e80094d1cb5110e182 (diff)
downloadmtk-20170518-0aa366c6e0f323b161cb61331fd456d3d775dba2.zip
mtk-20170518-0aa366c6e0f323b161cb61331fd456d3d775dba2.tar.gz
mtk-20170518-0aa366c6e0f323b161cb61331fd456d3d775dba2.tar.bz2
brcm63xx: leds-bcm6328: fix signal assignments for leds 4~7
Properly use modulus for bit calculation for LEDs 4 to 7. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'target/linux/brcm63xx/patches-4.4')
-rw-r--r--target/linux/brcm63xx/patches-4.4/001-4.13-01-leds-bcm6328-fix-signal-source-assignment-for-high-l.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.13-01-leds-bcm6328-fix-signal-source-assignment-for-high-l.patch b/target/linux/brcm63xx/patches-4.4/001-4.13-01-leds-bcm6328-fix-signal-source-assignment-for-high-l.patch
new file mode 100644
index 0000000..d8a5a39
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.4/001-4.13-01-leds-bcm6328-fix-signal-source-assignment-for-high-l.patch
@@ -0,0 +1,34 @@
+From dc90895d776d7b8017bc3b14f588d569d8edbe1f Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski@gmail.com>
+Date: Thu, 11 May 2017 13:36:52 +0200
+Subject: [PATCH] leds: bcm6328: fix signal source assignment for high leds
+
+Each nibble represents 4 LEDs, and in case of the higher register, bit 0
+represents LED 4, so we need to use modulus for the LED number as well.
+
+Fixes: fd7b025a238d0a5440bfa26c585eb78097bf48dc ("leds: add BCM6328 LED driver")
+Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
+---
+ drivers/leds/leds-bcm6328.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/leds/leds-bcm6328.c
++++ b/drivers/leds/leds-bcm6328.c
+@@ -224,7 +224,7 @@ static int bcm6328_hwled(struct device *
+
+ spin_lock_irqsave(lock, flags);
+ val = bcm6328_led_read(addr);
+- val |= (BIT(reg) << (((sel % 4) * 4) + 16));
++ val |= (BIT(reg % 4) << (((sel % 4) * 4) + 16));
+ bcm6328_led_write(addr, val);
+ spin_unlock_irqrestore(lock, flags);
+ }
+@@ -251,7 +251,7 @@ static int bcm6328_hwled(struct device *
+
+ spin_lock_irqsave(lock, flags);
+ val = bcm6328_led_read(addr);
+- val |= (BIT(reg) << ((sel % 4) * 4));
++ val |= (BIT(reg % 4) << ((sel % 4) * 4));
+ bcm6328_led_write(addr, val);
+ spin_unlock_irqrestore(lock, flags);
+ }