MIPS: BCM47XX: Add Luxul devices to the database
authorDan Haab <dhaab@luxul.com>
Mon, 23 Jan 2017 19:50:38 +0000 (12:50 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 25 Jan 2017 01:51:12 +0000 (02:51 +0100)
So far only Luxul XWR-1750 router was supported. This adds a set of
other Luxul devices based on BCM47XX. It's a standard support for LEDs
and buttons.

Signed-off-by: Dan Haab <dhaab@luxul.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Rafał Miłecki <zajec5@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15106/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/bcm47xx/board.c
arch/mips/bcm47xx/buttons.c
arch/mips/bcm47xx/leds.c
arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h

index a88975a55c4db1f2b04c36ef1abfd9552bb7034d..8cbe60cc51d42e056e3bb446a99e8063b5034df1 100644 (file)
@@ -149,6 +149,15 @@ struct bcm47xx_board_type_list2 bcm47xx_board_list_boot_hw[] __initconst = {
 /* board_id */
 static const
 struct bcm47xx_board_type_list1 bcm47xx_board_list_board_id[] __initconst = {
+       {{BCM47XX_BOARD_LUXUL_ABR_4400_V1, "Luxul ABR-4400 V1"}, "luxul_abr4400_v1"},
+       {{BCM47XX_BOARD_LUXUL_XAP_310_V1, "Luxul XAP-310 V1"}, "luxul_xap310_v1"},
+       {{BCM47XX_BOARD_LUXUL_XAP_1210_V1, "Luxul XAP-1210 V1"}, "luxul_xap1210_v1"},
+       {{BCM47XX_BOARD_LUXUL_XAP_1230_V1, "Luxul XAP-1230 V1"}, "luxul_xap1230_v1"},
+       {{BCM47XX_BOARD_LUXUL_XAP_1240_V1, "Luxul XAP-1240 V1"}, "luxul_xap1240_v1"},
+       {{BCM47XX_BOARD_LUXUL_XAP_1500_V1, "Luxul XAP-1500 V1"}, "luxul_xap1500_v1"},
+       {{BCM47XX_BOARD_LUXUL_XBR_4400_V1, "Luxul XBR-4400 V1"}, "luxul_xbr4400_v1"},
+       {{BCM47XX_BOARD_LUXUL_XVW_P30_V1, "Luxul XVW-P30 V1"}, "luxul_xvwp30_v1"},
+       {{BCM47XX_BOARD_LUXUL_XWR_600_V1, "Luxul XWR-600 V1"}, "luxul_xwr600_v1"},
        {{BCM47XX_BOARD_LUXUL_XWR_1750_V1, "Luxul XWR-1750 V1"}, "luxul_xwr1750_v1"},
        {{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"},
        {{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"},
index 52caa75bfe4e5eb1ec43b0e4152fbb1230d0ae21..7d582275908ca84766b9cd0e8811a622e61079a0 100644 (file)
@@ -301,6 +301,51 @@ bcm47xx_buttons_linksys_wrtsl54gs[] __initconst = {
 
 /* Luxul */
 
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_abr_4400_v1[] = {
+       BCM47XX_GPIO_KEY(14, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xap_310_v1[] = {
+       BCM47XX_GPIO_KEY(20, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xap_1210_v1[] = {
+       BCM47XX_GPIO_KEY(8, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xap_1230_v1[] = {
+       BCM47XX_GPIO_KEY(8, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xap_1240_v1[] = {
+       BCM47XX_GPIO_KEY(8, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xap_1500_v1[] = {
+       BCM47XX_GPIO_KEY(14, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xbr_4400_v1[] = {
+       BCM47XX_GPIO_KEY(14, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xvw_p30_v1[] = {
+       BCM47XX_GPIO_KEY(20, KEY_RESTART),
+};
+
+static const struct gpio_keys_button
+bcm47xx_buttons_luxul_xwr_600_v1[] = {
+       BCM47XX_GPIO_KEY(8, KEY_RESTART),
+};
+
 static const struct gpio_keys_button
 bcm47xx_buttons_luxul_xwr_1750_v1[] = {
        BCM47XX_GPIO_KEY(14, BTN_TASK),
@@ -561,6 +606,33 @@ int __init bcm47xx_buttons_register(void)
                err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrtsl54gs);
                break;
 
+       case BCM47XX_BOARD_LUXUL_ABR_4400_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_abr_4400_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_310_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_310_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1210_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1210_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1230_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1230_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1240_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1240_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1500_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1500_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XBR_4400_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xbr_4400_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XVW_P30_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xvw_p30_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XWR_600_V1:
+               err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_600_v1);
+               break;
        case BCM47XX_BOARD_LUXUL_XWR_1750_V1:
                err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_1750_v1);
                break;
index d20ae63eb3c2e051579f60cac8eab4360c331b33..a35f1d5cde9fd175fbb2f42039edd5094cc06062 100644 (file)
@@ -372,6 +372,60 @@ bcm47xx_leds_linksys_wrtsl54gs[] __initconst = {
 
 /* Luxul */
 
+static const struct gpio_led
+bcm47xx_leds_luxul_abr_4400_v1[] __initconst = {
+       BCM47XX_GPIO_LED(12, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED_TRIGGER(15, "green", "status", 0, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xap_310_v1[] __initconst = {
+       BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xap_1210_v1[] __initconst = {
+       BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xap_1230_v1[] __initconst = {
+       BCM47XX_GPIO_LED(3, "blue", "2ghz", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED(4, "green", "bridge", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xap_1240_v1[] __initconst = {
+       BCM47XX_GPIO_LED(3, "blue", "2ghz", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED(4, "green", "bridge", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xap_1500_v1[] __initconst = {
+       BCM47XX_GPIO_LED_TRIGGER(13, "green", "status", 1, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xbr_4400_v1[] __initconst = {
+       BCM47XX_GPIO_LED(12, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED_TRIGGER(15, "green", "status", 0, "timer"),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xvw_p30_v1[] __initconst = {
+       BCM47XX_GPIO_LED_TRIGGER(0, "blue", "status", 1, "timer"),
+       BCM47XX_GPIO_LED(1, "green", "link", 1, LEDS_GPIO_DEFSTATE_OFF),
+};
+
+static const struct gpio_led
+bcm47xx_leds_luxul_xwr_600_v1[] __initconst = {
+       BCM47XX_GPIO_LED(3, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
+       BCM47XX_GPIO_LED_TRIGGER(6, "green", "status", 1, "timer"),
+       BCM47XX_GPIO_LED(9, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
+};
+
 static const struct gpio_led
 bcm47xx_leds_luxul_xwr_1750_v1[] __initconst = {
        BCM47XX_GPIO_LED(5, "green", "5ghz", 0, LEDS_GPIO_DEFSTATE_OFF),
@@ -633,6 +687,33 @@ void __init bcm47xx_leds_register(void)
                bcm47xx_set_pdata(bcm47xx_leds_linksys_wrtsl54gs);
                break;
 
+       case BCM47XX_BOARD_LUXUL_ABR_4400_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_abr_4400_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_310_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_310_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1210_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1210_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1230_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1230_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1240_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1240_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XAP_1500_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xap_1500_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XBR_4400_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xbr_4400_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XVW_P30_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xvw_p30_v1);
+               break;
+       case BCM47XX_BOARD_LUXUL_XWR_600_V1:
+               bcm47xx_set_pdata(bcm47xx_leds_luxul_xwr_600_v1);
+               break;
        case BCM47XX_BOARD_LUXUL_XWR_1750_V1:
                bcm47xx_set_pdata(bcm47xx_leds_luxul_xwr_1750_v1);
                break;
index 2afb84072ad01b4aeff3a1d53d3134a928117024..ee3d4fe515a09b24bb420ae05e8b00517cb1eb0f 100644 (file)
@@ -80,6 +80,15 @@ enum bcm47xx_board {
        BCM47XX_BOARD_LINKSYS_WRT610NV2,
        BCM47XX_BOARD_LINKSYS_WRTSL54GS,
 
+       BCM47XX_BOARD_LUXUL_ABR_4400_V1,
+       BCM47XX_BOARD_LUXUL_XAP_310_V1,
+       BCM47XX_BOARD_LUXUL_XAP_1210_V1,
+       BCM47XX_BOARD_LUXUL_XAP_1230_V1,
+       BCM47XX_BOARD_LUXUL_XAP_1240_V1,
+       BCM47XX_BOARD_LUXUL_XAP_1500_V1,
+       BCM47XX_BOARD_LUXUL_XBR_4400_V1,
+       BCM47XX_BOARD_LUXUL_XVW_P30_V1,
+       BCM47XX_BOARD_LUXUL_XWR_600_V1,
        BCM47XX_BOARD_LUXUL_XWR_1750_V1,
 
        BCM47XX_BOARD_MICROSOFT_MN700,