summaryrefslogtreecommitdiff
path: root/package/broadcom-diag
diff options
context:
space:
mode:
authorMike Baker <mbm@openwrt.org>2007-08-25 12:27:01 +0000
committerMike Baker <mbm@openwrt.org>2007-08-25 12:27:01 +0000
commitc6e6780624dbc6fa1488b6c2fd3a2936215c436b (patch)
treef9fcc1e4b0afea016ab2286a6b3a39ee2fcffca7 /package/broadcom-diag
parentd21941ca4d7b8ec88ee55271f2ef00dd5cbac9ca (diff)
downloadmtk-20170518-c6e6780624dbc6fa1488b6c2fd3a2936215c436b.zip
mtk-20170518-c6e6780624dbc6fa1488b6c2fd3a2936215c436b.tar.gz
mtk-20170518-c6e6780624dbc6fa1488b6c2fd3a2936215c436b.tar.bz2
fix wan configuration on wr850g v2/v3
SVN-Revision: 8482
Diffstat (limited to 'package/broadcom-diag')
-rw-r--r--package/broadcom-diag/src/diag.c8
-rw-r--r--package/broadcom-diag/src/diag.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/package/broadcom-diag/src/diag.c b/package/broadcom-diag/src/diag.c
index e8da312..ef586ba 100644
--- a/package/broadcom-diag/src/diag.c
+++ b/package/broadcom-diag/src/diag.c
@@ -492,7 +492,7 @@ static struct platform_t __initdata platforms[] = {
.leds = {
{ .name = "power", .gpio = 1 << 1, .polarity = NORMAL },
{ .name = "wlan", .gpio = 1 << 0, .polarity = REVERSE },
- { .name = "dmz", .gpio = 1 << 6, .polarity = REVERSE },
+ { .name = "wan", .gpio = 1 << 6, .polarity = INPUT },
{ .name = "diag", .gpio = 1 << 7, .polarity = REVERSE },
},
},
@@ -893,6 +893,7 @@ static void register_leds(struct led_t *l)
{
struct proc_dir_entry *p;
u32 mask = 0;
+ u32 oe_mask = 0;
u32 val = 0;
leds = proc_mkdir("led", diag);
@@ -907,10 +908,13 @@ static void register_leds(struct led_t *l)
l->state = 0;
set_led_extif(l);
} else {
+ if (l->polarity != INPUT) oe_mask != l->gpio;
mask |= l->gpio;
val |= (l->polarity == NORMAL)?0:l->gpio;
}
+ if (l->polarity == INPUT) continue;
+
if ((p = create_proc_entry(l->name, S_IRUSR, leds))) {
l->proc.type = PROC_LED;
l->proc.ptr = l;
@@ -919,7 +923,7 @@ static void register_leds(struct led_t *l)
}
}
- gpio_outen(mask, mask);
+ gpio_outen(mask, oe_mask);
gpio_control(mask, 0);
gpio_out(mask, val);
}
diff --git a/package/broadcom-diag/src/diag.h b/package/broadcom-diag/src/diag.h
index 93fdedb..5f46d9d 100644
--- a/package/broadcom-diag/src/diag.h
+++ b/package/broadcom-diag/src/diag.h
@@ -30,6 +30,7 @@
enum polarity_t {
REVERSE = 0,
NORMAL = 1,
+ INPUT = 2,
};
enum {