On our design based in i.MX6Q, we're using USB OTG (as host or as device). On this design, we have a OTG ID pin on i.MX6 (GPIO1) but no dynamic VBUS pin : this one is set to +5V.
With our previous Linux kernel (3.0.35), it wasn't a problem. But with the new 3.10.31, it seems that the USB ChipIdea driver monitors the changes of VBUS pin in the OTG stage machine :
} else if (otg_int_src & OTGSC_AVVIS) {
hw_write_otgsc(ci, OTGSC_AVVIS, OTGSC_AVVIS);
if (otgsc & OTGSC_AVV) {
fsm->a_vbus_vld = 1;
} else {
fsm->a_vbus_vld = 0;
fsm->b_conn = 0;
}
}
With this kernel, the USB device is disconnected few milliseconds after detecting it, as the condition 'fsm->a_vbus_vld = 1' cannot be generated as there is no change on VBUS.
So is there a way to get a working OTG with VBUS pin connected to +5V ?
I made this workaround in ci_hdrc_otg_fsm_init() :
ci->fsm.a_vbus_vld = hw_read_otgsc(ci, OTGSC_AVV) ? 1 : 0;
So like this, 'fsm->a_vbus_vld' reflects the correct state of VBUS.