summaryrefslogtreecommitdiff
path: root/firmware/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/usb.c')
-rw-r--r--firmware/usb.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index 327b07d39e..a9ce20e13a 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -116,8 +116,7 @@ static void usb_enable(bool on)
116 or_b(0x08, &PADRL); /* deassert card detect */ 116 or_b(0x08, &PADRL); /* deassert card detect */
117 } 117 }
118 or_b(0x28, &PAIORL); /* output for USB enable and card detect */ 118 or_b(0x28, &PAIORL); /* output for USB enable and card detect */
119#else /* standard HD Jukebox */ 119#elif defined(USB_GMINISTYLE)
120#ifdef USB_GMINISTYLE
121 { 120 {
122 int i; 121 int i;
123 int smscVer = getSMSCVer(); 122 int smscVer = getSMSCVer();
@@ -144,6 +143,19 @@ static void usb_enable(bool on)
144 } 143 }
145 } 144 }
146 } 145 }
146#elif defined(USB_IRIVERSTYLE)
147 if(on)
148 {
149 /* Power on the Cypress chip */
150 GPIO_OUT |= 0x01000000;
151 sleep(2);
152 }
153 else
154 {
155 /* Power off the Cypress chip */
156 GPIO_OUT &= ~0x01000000;
157 }
158
147#else 159#else
148#ifdef HAVE_LCD_BITMAP 160#ifdef HAVE_LCD_BITMAP
149 if(read_hw_mask() & USB_ACTIVE_HIGH) 161 if(read_hw_mask() & USB_ACTIVE_HIGH)
@@ -159,7 +171,6 @@ static void usb_enable(bool on)
159 } 171 }
160 or_b(0x04, &PAIORH); 172 or_b(0x04, &PAIORH);
161#endif 173#endif
162#endif
163} 174}
164 175
165static void usb_slave_mode(bool on) 176static void usb_slave_mode(bool on)
@@ -403,7 +414,11 @@ void usb_init(void)
403 countdown = -1; 414 countdown = -1;
404 415
405#ifdef IRIVER_H100 416#ifdef IRIVER_H100
406 GPIO1_FUNCTION |= 0x80; /* GPIO39 is the USB detect input */ 417 GPIO_OUT &= ~0x01000000; /* GPIO24 is the Cypress chip power */
418 GPIO_ENABLE |= 0x01000000;
419 GPIO_FUNCTION |= 0x01000000;
420
421 GPIO1_FUNCTION |= 0x00000080; /* GPIO39 is the USB detect input */
407#endif 422#endif
408 423
409 usb_enable(false); 424 usb_enable(false);