1 From 3829e4f10a232964cc728c0479c8097922e5e073 Mon Sep 17 00:00:00 2001
2 From: Florian Fainelli <f.fainelli@gmail.com>
3 Date: Thu, 6 Jan 2022 19:51:38 -0800
4 Subject: [PATCH] MIPS: BCM47XX: Add board entry for Linksys WRT320N v1
6 This router is based on a Broadcom BCM4717A1 chipset and supports
7 802.11n Wi-Fi. Add a board entry for that router and register LEDs and
10 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
11 Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
13 arch/mips/bcm47xx/board.c | 1 +
14 arch/mips/bcm47xx/buttons.c | 9 +++++++++
15 arch/mips/bcm47xx/leds.c | 10 ++++++++++
16 arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
17 4 files changed, 21 insertions(+)
19 --- a/arch/mips/bcm47xx/board.c
20 +++ b/arch/mips/bcm47xx/board.c
21 @@ -141,6 +141,7 @@ struct bcm47xx_board_type_list2 bcm47xx_
22 {{BCM47XX_BOARD_LINKSYS_WRT300NV11, "Linksys WRT300N V1.1"}, "WRT300N", "1.1"},
23 {{BCM47XX_BOARD_LINKSYS_WRT310NV1, "Linksys WRT310N V1"}, "WRT310N", "1.0"},
24 {{BCM47XX_BOARD_LINKSYS_WRT310NV2, "Linksys WRT310N V2"}, "WRT310N", "2.0"},
25 + {{BCM47XX_BOARD_LINKSYS_WRT320N_V1, "Linksys WRT320N V1"}, "WRT320N", "1.0"},
26 {{BCM47XX_BOARD_LINKSYS_WRT54G3GV2, "Linksys WRT54G3GV2-VF"}, "WRT54G3GV2-VF", "1.0"},
27 {{BCM47XX_BOARD_LINKSYS_WRT610NV1, "Linksys WRT610N V1"}, "WRT610N", "1.0"},
28 {{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"},
29 --- a/arch/mips/bcm47xx/buttons.c
30 +++ b/arch/mips/bcm47xx/buttons.c
31 @@ -277,6 +277,12 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
34 static const struct gpio_keys_button
35 +bcm47xx_buttons_linksys_wrt320n_v1[] __initconst = {
36 + BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
37 + BCM47XX_GPIO_KEY(8, KEY_RESTART),
40 +static const struct gpio_keys_button
41 bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
42 BCM47XX_GPIO_KEY(5, KEY_WIMAX),
43 BCM47XX_GPIO_KEY(6, KEY_RESTART),
44 @@ -608,6 +614,9 @@ int __init bcm47xx_buttons_register(void
45 case BCM47XX_BOARD_LINKSYS_WRT310NV1:
46 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
48 + case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
49 + err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
51 case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
52 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2);
54 --- a/arch/mips/bcm47xx/leds.c
55 +++ b/arch/mips/bcm47xx/leds.c
56 @@ -314,6 +314,13 @@ bcm47xx_leds_linksys_wrt310nv1[] __initc
59 static const struct gpio_led
60 +bcm47xx_leds_linksys_wrt320n_v1[] __initconst = {
61 + BCM47XX_GPIO_LED(1, "blue", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
62 + BCM47XX_GPIO_LED(2, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON),
63 + BCM47XX_GPIO_LED(4, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
66 +static const struct gpio_led
67 bcm47xx_leds_linksys_wrt54g_generic[] __initconst = {
68 BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
69 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
70 @@ -689,6 +696,9 @@ void __init bcm47xx_leds_register(void)
71 case BCM47XX_BOARD_LINKSYS_WRT310NV1:
72 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1);
74 + case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
75 + bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt320n_v1);
77 case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
78 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2);
80 --- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
81 +++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
82 @@ -72,6 +72,7 @@ enum bcm47xx_board {
83 BCM47XX_BOARD_LINKSYS_WRT300NV11,
84 BCM47XX_BOARD_LINKSYS_WRT310NV1,
85 BCM47XX_BOARD_LINKSYS_WRT310NV2,
86 + BCM47XX_BOARD_LINKSYS_WRT320N_V1,
87 BCM47XX_BOARD_LINKSYS_WRT54G3GV2,
88 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101,
89 BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467,