AnsweredAssumed Answered

USB power-up delay for device recognition

Question asked by Rob. on Jun 4, 2012
Latest reply on Jun 5, 2012 by Rob.

I encountered the need to introduce a delay from the very moment where the musb driver activates vrsel (the VUSB via the USB power switch). It is assumed that a device is inserted from power-on of the blackfin application board. The USB device (e.g. mass storage device) is powered in

 

static int bfin_musb_init(struct musb *musb)

{

 

/*

* Rev 1.0 BF549 EZ-KITs require PE7 to be high for both DEVICE

* and OTG HOST modes, while rev 1.1 and greater require PE7 to

* be low for DEVICE mode and high for HOST mode. We set it high

* here because we are in host mode

*/

 

if (gpio_request(musb->config->gpio_vrsel, "USB_VRSEL")) {

printk(KERN_ERR "Failed ro request USB_VRSEL GPIO_%d\n",

musb->config->gpio_vrsel);

return -ENODEV;

}

gpio_direction_output(musb->config->gpio_vrsel, 0);

msleep(320);  /* some delay to accommodate worst delay power-up devices; */

              /* however, high end devices, like 3G sticks may require seconds */

(/drivers/usb/musb/blackfin.c)

The red highlighted statement is added yet. Of course, this is far from optimal, since e.g. 3G sticks would require many seconds, prior to be fully recognized (typically a mass storage device and three ttyUSB devices). Does any appropriate mdev configuration take care of serialization beyond boot termination?

Outcomes