1
0
Fork 0
forked from len0rd/rockbox

usb: add support for hardware handled SET ADDR/CONFIG

Some USB controllers like the one of the Rockchip 27xx handle some
requests in pure hardware. This is especially a problem for two
of them:
- SET ADDR which is used by our core to track the DEFAULT/ADDRESS
  state and is required for the drivers to work properly
- SET CONFIG which is used by our core to initialise the drivers
  by calling init_connection()
In these cases we need a way to notify the core that such requests
happened.
We do this by exporting two functions which directly notify the
core about these requests and perform the necessary init steps
required without doing the actual USB transfers. Special care is
needed because these functions could be called from an interrupt
handler. For this reason we still use the usb_queue and introduce
new IDs so that they are processed in order and safely.

No functional change is intended, both in the usbstack and on
targets without such quirks.

Change-Id: Ie42feffd4584e88bf37cff018b627f333dca1140
This commit is contained in:
Amaury Pouly 2012-12-07 13:37:26 +01:00
parent fb43a137e7
commit 775ab07d5e
4 changed files with 71 additions and 17 deletions

View file

@ -44,6 +44,8 @@ enum
#endif
#ifdef HAVE_USBSTACK
USB_TRANSFER_COMPLETION, /* Event */
USB_NOTIFY_SET_ADDR, /* Event */
USB_NOTIFY_SET_CONFIG, /* Event */
#endif
#ifdef USB_FIREWIRE_HANDLING
USB_REQUEST_REBOOT, /* Event */
@ -130,6 +132,7 @@ void usb_charger_update(void);
#ifdef HAVE_USBSTACK
void usb_signal_transfer_completion(
struct usb_transfer_completion_event_data *event_data);
void usb_signal_notify(long id, intptr_t data);
bool usb_driver_enabled(int driver);
bool usb_exclusive_storage(void); /* storage is available for usb */
#endif