mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
iRiver: USB support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5892 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8a4c704909
commit
aa2989f4d2
3 changed files with 23 additions and 5 deletions
|
@ -48,7 +48,7 @@
|
|||
/* Offset ( in the firmware file's header ) to the real data */
|
||||
#define FIRMWARE_OFFSET_FILE_DATA 8
|
||||
|
||||
#define USB_NONE /* FIX: USB temorarily disabled */
|
||||
#define USB_IRIVERSTYLE
|
||||
|
||||
/* Define this if you have a software controlled poweroff */
|
||||
#define HAVE_SW_POWEROFF
|
||||
|
|
|
@ -1995,6 +1995,9 @@ static void mpeg_thread(void)
|
|||
mpeg_stop_done = true;
|
||||
break;
|
||||
default:
|
||||
/* Tell the USB thread that we are safe */
|
||||
DEBUGF("mpeg_thread got SYS_USB_CONNECTED\n");
|
||||
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue