Add Trendware TEW-411BRplus (#1038)
authorFlorian Fainelli <florian@openwrt.org>
Mon, 11 Dec 2006 21:46:31 +0000 (21:46 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Mon, 11 Dec 2006 21:46:31 +0000 (21:46 +0000)
SVN-Revision: 5764

openwrt/target/linux/package/diag/src/diag.c
openwrt/target/linux/package/switch/src/switch-adm.c

index 0b445f8c22f92b1067229016479c8143cbf37b65..0537da1d09bfa865c0c7759011928ad0242542d1 100644 (file)
@@ -85,6 +85,9 @@ enum {
 
        /* Belkin */
        BELKIN_UNKNOWN,
+
+       /* Trendware */
+       TEW411BRPP,
 };
 
 static struct platform_t __init platforms[] = {
@@ -410,6 +413,17 @@ static struct platform_t __init platforms[] = {
                        { .name = "connected",  .gpio = 1 << 0, .polarity = NORMAL },
                },
        },
+       [TEW411BRPP] = {
+               .name           = "Trendware TEW411BRP+",
+               .buttons        = {
+               { /* No usable buttons */ },
+               },
+               .leds           = {
+                       { .name = "power",      .gpio = 1 << 7, .polarity = NORMAL },
+                       { .name = "wlan",       .gpio = 1 << 1, .polarity = NORMAL },
+                       { .name = "bridge",     .gpio = 1 << 6, .polarity = NORMAL },
+               },
+       },
 };
 
 static inline char __init *getvar(char *str)
@@ -508,6 +522,10 @@ static struct platform_t __init *platform_detect(void)
                return &platforms[WR850GV2V3];
        }
 
+       if (!strcmp(boardnum, "44")) {  /* trendware TEW-411BRP+ */
+               return &platforms[TEW411BRPP];
+       }
+
        /* not found */
        return NULL;
 }
index 113138a8fd8b38aae7cefcc1a20d0bfe3a2c8103..423c5a88d3743b395afcafbb09eebbbd7f902c66 100644 (file)
@@ -493,8 +493,17 @@ static int detect_adm()
 
 #if defined(BCMGPIO2) || defined(BCMGPIO)
        int boardflags = atoi(nvram_get("boardflags"));
+       int boardnum = atoi(nvram_get("boardnum"));
 
-       if ((boardflags & 0x80) || force) {
+       if (boardnum == 44) {   /* trendware TEW-411BRP+ */
+               ret = 1;
+       
+               eecs = getgpiopin("adm_eecs", 2);
+               eesk = getgpiopin("adm_eesk", 3);
+               eedi = getgpiopin("adm_eedi", 4);
+               eerc = getgpiopin("adm_rc", 5);  
+
+       } else if ((boardflags & 0x80) || force) {
                ret = 1;
 
                eecs = getgpiopin("adm_eecs", 2);