summaryrefslogtreecommitdiff
path: root/firmware/usb.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-02-10 23:20:34 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-02-10 23:20:34 +0000
commitaa2989f4d272344062c43fc894a7721efd7f9f8c (patch)
tree3846aa0b136a6dd5e06e8d4acc498a410a0f116b /firmware/usb.c
parent8a4c70490929d96a193e25a966f4f92e18161ae2 (diff)
downloadrockbox-aa2989f4d272344062c43fc894a7721efd7f9f8c.zip
rockbox-aa2989f4d272344062c43fc894a7721efd7f9f8c.tar.gz
rockbox-aa2989f4d272344062c43fc894a7721efd7f9f8c.tar.bz2
rockbox-aa2989f4d272344062c43fc894a7721efd7f9f8c.tar.xz
iRiver: USB support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5892 a1c6a512-1295-4272-9138-f99709370657
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 327b07d..a9ce20e 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -116,8 +116,7 @@ static void usb_enable(bool on)
or_b(0x08, &PADRL); /* deassert card detect */
}
or_b(0x28, &PAIORL); /* output for USB enable and card detect */
-#else /* standard HD Jukebox */
-#ifdef USB_GMINISTYLE
+#elif defined(USB_GMINISTYLE)
{
int i;
int smscVer = getSMSCVer();
@@ -144,6 +143,19 @@ static void usb_enable(bool on)
}
}
}
+#elif defined(USB_IRIVERSTYLE)
+ if(on)
+ {
+ /* Power on the Cypress chip */
+ GPIO_OUT |= 0x01000000;
+ sleep(2);
+ }
+ else
+ {
+ /* Power off the Cypress chip */
+ GPIO_OUT &= ~0x01000000;
+ }
+
#else
#ifdef HAVE_LCD_BITMAP
if(read_hw_mask() & USB_ACTIVE_HIGH)
@@ -159,7 +171,6 @@ static void usb_enable(bool on)
}
or_b(0x04, &PAIORH);
#endif
-#endif
}
static void usb_slave_mode(bool on)
@@ -403,7 +414,11 @@ void usb_init(void)
countdown = -1;
#ifdef IRIVER_H100
- GPIO1_FUNCTION |= 0x80; /* GPIO39 is the USB detect input */
+ GPIO_OUT &= ~0x01000000; /* GPIO24 is the Cypress chip power */
+ GPIO_ENABLE |= 0x01000000;
+ GPIO_FUNCTION |= 0x01000000;
+
+ GPIO1_FUNCTION |= 0x00000080; /* GPIO39 is the USB detect input */
#endif
usb_enable(false);