While marked and marketed as different boards, the F7Dxxxx series is
(so far) largely the same in what matters for broadcom-diag: all the
buttons and leds are assigned to the same gpios.

The only difference that may need to be noted: some models lack a usb1
led (as they lack usb1). Given that it is relatively easy to populate
that led, I see no point in disabling access to it. Additionally, this
does mean that /proc/diag/model will only show the non-specific model.
As /proc/cpuinfo's "machine:" entry still shows the detailed board
type, we don't loose anything overall.

Signed-off-by: Cody P Schafer <de...@codyps.com>
---
 package/kernel/broadcom-diag/src/diag.c | 36 +++++++++------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/package/kernel/broadcom-diag/src/diag.c 
b/package/kernel/broadcom-diag/src/diag.c
index fccc219..3feb746 100644
--- a/package/kernel/broadcom-diag/src/diag.c
+++ b/package/kernel/broadcom-diag/src/diag.c
@@ -145,8 +145,7 @@ enum {
 
        /* Belkin */
        BELKIN_UNKNOWN,
-       BELKIN_F7D330X, /* covers F7D7302,F7D3302,F7D3301, and F7D7301 */
-       BELKIN_F7D4301,
+       BELKIN_F7DXXXX,
 
        /* Netgear */
        WGT634U,
@@ -967,28 +966,8 @@ static struct platform_t __initdata platforms[] = {
                        { .name = "connected",  .gpio = 1 << 0, .polarity = 
NORMAL },
                },
        },
-       [BELKIN_F7D330X] = {
-               .name           = "Belkin F7D330X",
-               .buttons        = {
-                       { .name = "reset",      .gpio = 1 << 6 },
-                       { .name = "wps",        .gpio = 1 << 8 },
-               },
-               .leds           = {
-                       /* green */
-                       { .name = "power",      .gpio = 1 << 10, .polarity = 
REVERSE },
-                       /* orange power */
-                       { .name = "warn",       .gpio = 1 << 11, .polarity = 
REVERSE },
-                       /* green */
-                       { .name = "wps",        .gpio = 1 << 12, .polarity = 
REVERSE },
-                       /* orange wps */
-                       { .name = "wlan",       .gpio = 1 << 13, .polarity = 
REVERSE },
-                       { .name = "usb0",       .gpio = 1 << 14, .polarity = 
REVERSE },
-                       /* shipped unconnected in the F7D3302 */
-                       { .name = "usb1",       .gpio = 1 << 15, .polarity = 
REVERSE },
-               },
-       },
-       [BELKIN_F7D4301] = {
-               .name           = "Belkin PlayMax F7D4301",
+       [BELKIN_F7DXXXX] = {
+               .name           = "Belkin F7Dxxxx",
                .buttons        = {
                        { .name = "reset",      .gpio = 1 << 6 },
                        { .name = "wps",        .gpio = 1 << 8 },
@@ -1399,10 +1378,13 @@ static struct platform_t __init *platform_detect(void)
                return &platforms[WL700GE];
        case BCM47XX_BOARD_ASUS_WLHDD:
                return &platforms[WLHDD];
+       case BCM47XX_BOARD_BELKIN_F7DXXXX:
+       case BCM47XX_BOARD_BELKIN_F7D3301:
+       case BCM47XX_BOARD_BELKIN_F7D3302:
        case BCM47XX_BOARD_BELKIN_F7D4301:
-               return &platforms[BELKIN_F7D4301];
-       case BCM47XX_BOARD_BELKIN_F7D330X:
-               return &platforms[BELKIN_F7D330X];
+       case BCM47XX_BOARD_BELKIN_F7D4302:
+       case BCM47XX_BOARD_BELKIN_F7D4401:
+               return &platforms[BELKIN_F7DXXXX];
        case BCM47XX_BOARD_BUFFALO_WBR2_G54:
                return &platforms[WBR2_G54];
        case BCM47XX_BOARD_BUFFALO_WHR2_A54G54:
-- 
1.8.4.2
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to