iRiver: USB support

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5892 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2005-02-10 23:20:34 +00:00
parent 8a4c704909
commit aa2989f4d2
3 changed files with 23 additions and 5 deletions

View file

@ -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);