summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/gigabeat-s/usb-gigabeat-s.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/usb-gigabeat-s.c')
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/usb-gigabeat-s.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/usb-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/usb-gigabeat-s.c
index 19c3b3173f..9ee1a47fd6 100644
--- a/firmware/target/arm/imx31/gigabeat-s/usb-gigabeat-s.c
+++ b/firmware/target/arm/imx31/gigabeat-s/usb-gigabeat-s.c
@@ -54,15 +54,11 @@ static void enable_transceiver(bool enable)
54 } 54 }
55} 55}
56 56
57/* Read the immediate state of the cable from the PMIC */
58bool usb_plugged(void)
59{
60 return mc13783_read(MC13783_INTERRUPT_SENSE0) & MC13783_USB4V4S;
61}
62
63void usb_connect_event(void) 57void usb_connect_event(void)
64{ 58{
65 int status = usb_plugged() ? USB_INSERTED : USB_EXTRACTED; 59 /* Read the immediate state of the cable from the PMIC */
60 int status = (mc13783_read(MC13783_INTERRUPT_SENSE0) & MC13783_USB4V4S)
61 ? USB_INSERTED : USB_EXTRACTED;
66 usb_status = status; 62 usb_status = status;
67 /* Notify power that USB charging is potentially available */ 63 /* Notify power that USB charging is potentially available */
68 charger_usb_detect_event(status); 64 charger_usb_detect_event(status);