Hello,
I am using a custom board with AM335x (mostly cloned from BeagleBone). We use USB1 host, with a UVC-compatible USB camera always plugged.
USB1_ID is grounded, USB1_DRVVBUS connected to TPS2051 (power switch) enable signal, USB1_VBUS connected to the TPS2051 output and to the pin1 of USB A connector (usb power 5V).
The camera works fine, but we want to control (switch-on and switch-off) the USB power (for power saving). And I don't know I to do it.
We have found two problems:
- the USB1_DRVVBUS is controlled from the linux driver (and I don't found any way to instruct the driver to move it).
- if I unplug and plug again the camera, the system disconnect and found the camera, but there is same dmesg errors: "[ 2037.444946] 6:3:1: cannot set freq 16000 to ep 0x86".... and when I try to use the camera another error: "uvcvideo: Failed to set UVC probe control : -110 (exp. 26)."
I can solve the second problem doing "rmmod uvcvideo" before pluging the camera. But probably there is a better solution!!
And about the first problem, I don't have a good solution. What could I do to control USB_DRVVBUS1? (from command line, from programm, from kernel...).
I have try to change USB1_DRVVBUS pin mux to 7 (gpio) and control it manually. It removes the power from USB but there is a lot of dmesg errors (every 250ms) "hub 1-0:1.0: over-current condition on port 1".
I have try to change USB1 mode to manually device (USB1MODE=0x180), trying to override the ID pin, and hopping that this would turn-off the DRVVBUS, but it didn´t work (probably only works on boot?).
I could change the hardware layout in order to cheat the driver: with a transistor I can send 5V to USB1_VBUS when the USB1_DRVVBUS is active; an I can use any other gpio to control from my program the TPS2051 switch to send power to the USB connector. I don´t know if this would work, but there should be a simpler software solution.
Any idea? Thanks in advance,
Alfredo Agudo
uname -a
Linux ibernexNX050x 3.2.42 #19 Mon Jun 3 19:06:27 CEST 2013 armv7l GNU/Linux
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 046d:0825 Logitech, Inc.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub