From c222f38c03734b7849799b08f2daf5bd85ace303 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 14 Sep 2011 16:42:43 +0000 Subject: Remove obsolete USB_DETECT_BY_DRV define throughout. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30549 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/usb.h | 2 +- firmware/target/arm/usb-fw-pp502x.c | 4 +--- firmware/usb.c | 27 +++++++++++---------------- 3 files changed, 13 insertions(+), 20 deletions(-) (limited to 'firmware') diff --git a/firmware/export/usb.h b/firmware/export/usb.h index ca3f72eaa4..2dac4c75db 100644 --- a/firmware/export/usb.h +++ b/firmware/export/usb.h @@ -34,7 +34,7 @@ enum { USB_EXTRACTED = 0, /* Event+State */ USB_INSERTED, /* Event+State */ USB_POWERED, /* Event+State - transitional indicator if no power */ -#if defined(USB_DETECT_BY_DRV) || defined(USB_DETECT_BY_CORE) +#ifdef USB_DETECT_BY_CORE USB_UNPOWERED, /* Event */ #endif #ifdef HAVE_LCD_BITMAP diff --git a/firmware/target/arm/usb-fw-pp502x.c b/firmware/target/arm/usb-fw-pp502x.c index 19f21e12ed..f1d250d3ec 100644 --- a/firmware/target/arm/usb-fw-pp502x.c +++ b/firmware/target/arm/usb-fw-pp502x.c @@ -226,9 +226,7 @@ void usb_insert_int(void) timeout_register(&usb_oneshot, usb_timeout_event, HZ/5, val); } -/* USB_DETECT_BY_DRV: Called during the bus reset interrupt when in detect mode - * USB_DETECT_BY_CORE: Called when device descriptor is requested - */ +/* 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. */ diff --git a/firmware/usb.c b/firmware/usb.c index 298627c4a5..64e727330a 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -57,11 +57,6 @@ #define USB_FULL_INIT #endif -#if defined(USB_DETECT_BY_DRV) || defined(USB_DETECT_BY_CORE) -/* These aren't treated differently here */ -#define USB_DELAYED_INSERT -#endif - #ifdef HAVE_LCD_BITMAP bool do_screendump_instead_of_usb = false; #endif @@ -370,7 +365,7 @@ static void usb_thread(void) NORETURN_ATTR; #endif static void usb_thread(void) { -#ifdef USB_DELAYED_INSERT +#ifdef USB_DETECT_BY_CORE bool host_detected = false; #endif int num_acks_to_expect = 0; @@ -392,7 +387,7 @@ static void usb_thread(void) #endif /* HAVE_USBSTACK */ case USB_INSERTED: -#ifdef USB_DELAYED_INSERT +#ifdef USB_DETECT_BY_CORE if(usb_state != USB_POWERED) break; @@ -400,7 +395,7 @@ static void usb_thread(void) break; /* Drivers configured but we're still USB_POWERED */ host_detected = true; -#else /* !USB_DELAYED_INSERT */ +#else /* !USB_DETECT_BY_CORE */ if(usb_state != USB_EXTRACTED) break; @@ -408,7 +403,7 @@ static void usb_thread(void) break; usb_state = USB_POWERED; -#endif /* USB_DELAYED_INSERT */ +#endif /* USB_DETECT_BY_CORE */ if(usb_power_button()) { @@ -461,7 +456,7 @@ static void usb_thread(void) break; /* SYS_USB_CONNECTED_ACK */ -#ifdef USB_DELAYED_INSERT +#ifdef USB_DETECT_BY_CORE /* In this case, these events handle cable insertion. USB driver or core determines USB_INSERTED. */ case USB_POWERED: @@ -481,7 +476,7 @@ static void usb_thread(void) usb_enable(false); /* Fall-through - other legal states can be USB_INSERTED or USB_SCREENDUMP */ -#endif /* USB_DELAYED_INSERT */ +#endif /* USB_DETECT_BY_CORE */ case USB_EXTRACTED: if(usb_state == USB_EXTRACTED) break; @@ -495,7 +490,7 @@ static void usb_thread(void) /* Ok to broadcast disconnect now */ usb_configure_drivers(USB_EXTRACTED); -#ifdef USB_DELAYED_INSERT +#ifdef USB_DETECT_BY_CORE host_detected = false; #endif break; @@ -549,9 +544,9 @@ void usb_status_event(int current_status) { /* Caller isn't expected to filter for changes in status. * current_status: - * USB_DETECT_BY_DRV/CORE: USB_POWERED, USB_UNPOWERED, - USB_INSERTED (driver/core) - * else: USB_INSERTED, USB_EXTRACTED + * USB_DETECT_BY_CORE: USB_POWERED, USB_UNPOWERED, + USB_INSERTED (core) + * else: USB_INSERTED, USB_EXTRACTED */ if(usb_monitor_enabled) { @@ -572,7 +567,7 @@ void usb_start_monitoring(void) /* An event may have been missed because it was sent before monitoring * was enabled due to the connector already having been inserted before * before or during boot. */ -#ifdef USB_DELAYED_INSERT +#ifdef USB_DETECT_BY_CORE /* Filter the status - USB_INSERTED may happen later */ status = (status == USB_EXTRACTED) ? USB_UNPOWERED : USB_POWERED; #endif -- cgit v1.2.3