#17062: LEDs mapped to wrong GPIOs on WRT54GL
------------------------+------------------------------------------
Reporter: anonymous | Owner: developers
Type: defect | Status: reopened
Priority: normal | Milestone: Chaos Calmer 15.05
Component: kernel | Version: Trunk
Resolution: | Keywords: wrt54g wrt54gl gpio led leds
------------------------+------------------------------------------
Changes (by pesco):
* status: closed => reopened
* resolution: fixed =>
Comment:
The fix above is correct for boardtype 0x0467; however, the issue applies
to other WRT boards as well. I have a WRT54G v2.2 with boardtype 0x0708
which doesn't work with the pinout currently in the kernel. It should
probably use the same as 0x0467 which I believe is actually the "generic"
layout.
(I haven't been able to build a custom image to test, yet, but wanted to
get this post out anyway.)
Appearently the GPIO definitions for WRT54G vs WRTSL54GS were confused
when added to the kernel. This is simply the wrong way around:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=96c10de32fde6c50e4f9e5c1f027e670073ea086
{{{
diff --git a/arch/mips/bcm47xx/leds.c b/arch/mips/bcm47xx/leds.c
index 647d155..d741175 100644
--- a/arch/mips/bcm47xx/leds.c
+++ b/arch/mips/bcm47xx/leds.c
@@ -292,6 +292,21 @@ bcm47xx_leds_linksys_wrt310nv1[] __initconst = {
};
static const struct gpio_led
+bcm47xx_leds_linksys_wrt54gsv1[] __initconst = {
+ BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
+ BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
+ BCM47XX_GPIO_LED(5, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
+ BCM47XX_GPIO_LED(7, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
+};
+
+ [...]
+
+static const struct gpio_led
bcm47xx_leds_linksys_wrt610nv1[] __initconst = {
BCM47XX_GPIO_LED(0, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF),
BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
@@ -308,6 +323,15 @@ bcm47xx_leds_linksys_wrt610nv2[] __initconst = {
BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
};
+static const struct gpio_led
+bcm47xx_leds_linksys_wrtsl54gs[] __initconst = {
+ BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
+ BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
+ BCM47XX_GPIO_LED(2, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
+ BCM47XX_GPIO_LED(3, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
+ BCM47XX_GPIO_LED(7, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
+};
+
/* Motorola */
}}}
See also the original code of broadcom-diag:
http://git.openwrt.org/?p=openwrt.git;a=commitdiff;h=1e1e587817521fc188f20de4e674e02a7ebf6887
{{{
[WRT54G] = {
.name = "Linksys WRT54G/GS/GL",
.buttons = {
{ .name = "reset", .gpio = 1 << 6 },
{ .name = "ses", .gpio = 1 << 4 },
},
.leds = {
{ .name = "power", .gpio = 1 << 1, .polarity =
NORMAL },
{ .name = "dmz", .gpio = 1 << 7, .polarity =
REVERSE },
{ .name = "ses_white", .gpio = 1 << 2, .polarity =
REVERSE },
{ .name = "ses_orange", .gpio = 1 << 3, .polarity =
REVERSE },
{ .name = "wlan", .gpio = 1 << 0, .polarity =
REVERSE },
},
},
}}}
--
Ticket URL: <https://dev.openwrt.org/ticket/17062#comment:6>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets