Hi Ivan,
I have one more question.
We tried detecting that the device is disconnected by detecting when it has stopped receiving SOFs. We the steps to do this were:
- add a SOF counter in arcotg_udc.c
- enable SOF interrupts
- increment the counter each time a SOF interrupt is received
- add the necessary logic, including a new IOCTL, to the webcam driver that allows me to test the value of the SOF counter from the application level
- check the SOF counter at regular intervals
The idea being, if the SOF count stops incrementing we have a disconnect event and can respond appropriately.
What we've found is that, for about 30 seconds after disconnecting from the host, we continue to receive SOF interrupts. After about 30 seconds, something calls fsl_pullup with is_on == 0, and we stop receiving interrupts, and uvc_function_disable() is called. (I am not certain of the exact order of events, I'm relying on printk() statements to trace through all this.)
This happens even if the application is not loaded.
I'm told (but can't verify) that the embedded hub will stop sending SOFs immediately on disconnection from the host. If this is true can you think of anything that might explain the behavior that I'm seeing?
Thanks very much for all the help.
Regards,
Ed Pearson