Thanks,found it with
echo in > /sys/class/gpio/gpio4/direction
My usb stick is recognized right after this.


But I can't get usb initialize from mach!How to solve it?


I've added these lines to mach:
static void __init tl_wr843n_usb_setup(void)
{
        /* enable power for the USB port */
        gpio_request(TL_WR843N_GPIO_USB_POWER, "USB power");
        gpio_direction_output(TL_WR843N_GPIO_USB_POWER, 0);  /* 1 is not 
working,too */


        ath79_register_usb();
}



tl_wr843n_usb_setup();
 
------------------ Original ------------------
From:  "Florian Fainelli"<flor...@openwrt.org>;
Date:  Sun, Apr 29, 2012 01:09 AM
To:  "openwrt-devel"<openwrt-devel@lists.openwrt.org>; 
Cc:  "Vince Huang"<axish...@foxmail.com>; 
Subject:  Re: [OpenWrt-Devel] Exhausted on finding a gpio for USB_POWER...

 
Hi,

Le samedi 28 avril 2012 19:01:03, Vince Huang a écrit :
> Hi,guys!
> I am finding the gpio to enable USB_POWER for tl-wr843n(arthoes
> ar9341).I've tried out all gpio number just can't power up the usb(with
> factory firmware it does).Can someone kind to help me solve this? These
> are the command I tried to find gpios,don't know if it's proper.But it
> works on leds. root@OpenWrt:~# echo 6 > /sys/class/gpio/export
> root@OpenWrt:~# echo out > /sys/class/gpio/gpio6/direction
> root@OpenWrt:~# echo 0 > /sys/class/gpio/export
> root@OpenWrt:~# echo out > /sys/class/gpio/gpio0/direction
> root@OpenWrt:~# echo 1 > /sys/class/gpio/export
> root@OpenWrt:~# echo out > /sys/class/gpio/gpio1/direction
> root@OpenWrt:~# echo 2 > /sys/class/gpio/export
> root@OpenWrt:~# echo out > /sys/class/gpio/gpio2/direction
> root@OpenWrt:~# echo 3 > /sys/class/gpio/export
> root@OpenWrt:~# echo out > /sys/class/gpio/gpio3/direction
> root@OpenWrt:~# echo 4 > /sys/class/gpio/export
> root@OpenWrt:~# echo out > /sys/class/gpio/gpio4/direction
> Mach is attached.

Check whether the GPIO might be controlling the USB power using a pull-up/down 
GPIO. Set the GPIO direction to output, then back to input and see if that 
changes anything.
-- 
Florian
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to