X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/aaa55ddf861074c6673cc05113ae4a84a4acea2c..29c1e23114477a83fd45531f876946220d398366:/openwrt/target/linux/package/diag/diag_led.c?ds=sidebyside diff --git a/openwrt/target/linux/package/diag/diag_led.c b/openwrt/target/linux/package/diag/diag_led.c index 8d4acd549..e4dc39111 100644 --- a/openwrt/target/linux/package/diag/diag_led.c +++ b/openwrt/target/linux/package/diag/diag_led.c @@ -28,6 +28,7 @@ * 2005/03/14 asus wl-500g deluxe and buffalo v2 support added * 2005/04/13 added licensing informations * 2005/04/18 base reset polarity off initial readings + * 2006/02/07 motorola wa840g/we800g support added */ #include @@ -36,6 +37,7 @@ #include #include #include +#include #include #include @@ -47,9 +49,9 @@ static void *sbh; #define DMZ_GPIO (1<<7) static void set_gpio(uint32 mask, uint32 value) { - sb_gpiocontrol(sbh,mask,0); - sb_gpioouten(sbh,mask,mask); - sb_gpioout(sbh,mask,value); + sb_gpiocontrol(sbh,mask, 0, GPIO_DRV_PRIORITY); + sb_gpioouten(sbh,mask,mask,GPIO_DRV_PRIORITY); + sb_gpioout(sbh,mask,value,GPIO_DRV_PRIORITY); } static void v2_set_diag(u8 state) { @@ -122,8 +124,8 @@ static int proc_reset(ctl_table *table, int write, struct file *filp, { if (reset_gpio) { - sb_gpiocontrol(sbh,reset_gpio,reset_gpio); - sb_gpioouten(sbh,reset_gpio,0); + sb_gpiocontrol(sbh,reset_gpio,reset_gpio,GPIO_DRV_PRIORITY); + sb_gpioouten(sbh,reset_gpio,0,GPIO_DRV_PRIORITY); reset=!(sb_gpioin(sbh)&reset_gpio); if (reset_polarity) reset=!reset; @@ -185,6 +187,10 @@ static int __init diag_init() //asus wl-500g reset_gpio=(1<<6); } + if (!strcmp(buf,"2")) { + //wa840g v1 / we800g v1 + reset_gpio=(1<<0); + } } if (!strcmp(buf,"bcm94710ap")) { buf=nvram_get("boardnum")?:""; @@ -222,8 +228,8 @@ static int __init diag_init() } - sb_gpiocontrol(sbh,reset_gpio,reset_gpio); - sb_gpioouten(sbh,reset_gpio,0); + sb_gpiocontrol(sbh,reset_gpio,reset_gpio,GPIO_DRV_PRIORITY); + sb_gpioouten(sbh,reset_gpio,0,GPIO_DRV_PRIORITY); reset_polarity=!(sb_gpioin(sbh)&reset_gpio); diag_sysctl_header = register_sysctl_table(sys_diag, 0);