1
0
Fork 0
forked from len0rd/rockbox

Reorganise USB initialisation to not depend on a specific enumeration sequence, by Bartosz Fabianowski, with minor tweaks by Michael Sevakis (FS#12497)

FreeBSD apparently sends a SET_ADDRESS first, which confused our code.
This patch fixes that, and also simplifies the connection handling a bit.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31582 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Frank Gevaerts 2012-01-04 21:55:09 +00:00
parent fd5524ff92
commit 4fcffcbdf3
10 changed files with 86 additions and 133 deletions

View file

@ -58,22 +58,6 @@ void usb_remove_int(void)
#endif
}
void usb_drv_usb_detect_event(void)
{
#if (CONFIG_CPU != AS3525v2 || defined(USE_ROCKBOX_USB)) \
&& defined (USB_STATUS_BY_EVENT)
/* Rebooting on USB plug can crash these players in a state where
* hardware power off (pressing the power button) doesn't work anymore
* TODO: Implement USB in rockbox for these players */
int oldstatus = disable_irq_save(); /* May come via USB thread */
if (usb_status == USB_INSERTED)
usb_status_event(USB_HOSTED);
restore_irq(oldstatus);
#endif
}
int usb_detect(void)
{
return usb_status;

View file

@ -40,11 +40,6 @@ void usb_remove_int(void)
usb_status_event(USB_EXTRACTED);
}
void usb_drv_usb_detect_event()
{
usb_status_event(USB_HOSTED);
}
void usb_attach(void)
{
usb_drv_attach();

View file

@ -145,13 +145,6 @@ void usb_drv_int_enable(bool enable)
}
}
/* Called during the setup packet request by the host */
void usb_drv_usb_detect_event(void)
{
if (usb_drv_powered())
usb_status_event(USB_HOSTED);
}
/* Called when reading the MBR */
void usb_fix_mbr(unsigned char *mbr)
{

View file

@ -224,15 +224,6 @@ void usb_insert_int(void)
USB_GPIO_INT_CLR = USB_GPIO_MASK;
timeout_register(&usb_oneshot, usb_timeout_event, HZ/5, val);
}
/* USB_DETECT_BY_CORE: Called when device descriptor is requested */
void usb_drv_usb_detect_event(void)
{
/* Filter for invalid bus reset when unplugging by checking the pin state. */
if(usb_plugged()) {
usb_status_event(USB_HOSTED);
}
}
#endif /* USB_STATUS_BY_EVENT */
#ifdef HAVE_BOOTLOADER_USB_MODE

View file

@ -30,11 +30,6 @@
int usb_status = USB_EXTRACTED;
void usb_drv_usb_detect_event()
{
usb_status_event(USB_INSERTED);
}
void usb_init_device(void)
{
}