forked from len0rd/rockbox
Enable usbstack on ipods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15772 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
73d514f1c1
commit
482e839ea9
8 changed files with 24 additions and 56 deletions
|
@ -147,10 +147,10 @@
|
|||
/* USB On-the-go */
|
||||
#define CONFIG_USBOTG USBOTG_ARC
|
||||
|
||||
/* enable these for the experimental usb stack
|
||||
/* enable these for the experimental usb stack */
|
||||
#define HAVE_USBSTACK
|
||||
#define USBSTACK_CAPS CONTROLLER_DEVICE
|
||||
*/
|
||||
#define USB_VENDOR_ID 0x05ac
|
||||
#define USB_PRODUCT_ID 0x1203
|
||||
|
||||
/* Virtual LED (icon) */
|
||||
#define CONFIG_LED LED_VIRTUAL
|
||||
|
|
|
@ -134,10 +134,10 @@
|
|||
/* USB On-the-go */
|
||||
#define CONFIG_USBOTG USBOTG_ARC
|
||||
|
||||
/* enable these for the experimental usb stack
|
||||
/* enable these for the experimental usb stack */
|
||||
#define HAVE_USBSTACK
|
||||
#define USBSTACK_CAPS CONTROLLER_DEVICE
|
||||
*/
|
||||
#define USB_VENDOR_ID 0x05ac
|
||||
#define USB_PRODUCT_ID 0x1204
|
||||
|
||||
/* Virtual LED (icon) */
|
||||
#define CONFIG_LED LED_VIRTUAL
|
||||
|
|
|
@ -137,10 +137,10 @@
|
|||
/* USB On-the-go */
|
||||
#define CONFIG_USBOTG USBOTG_ARC
|
||||
|
||||
/* enable these for the experimental usb stack
|
||||
/* enable these for the experimental usb stack */
|
||||
#define HAVE_USBSTACK
|
||||
#define USBSTACK_CAPS CONTROLLER_DEVICE
|
||||
*/
|
||||
#define USB_VENDOR_ID 0x05ac
|
||||
#define USB_PRODUCT_ID 0x1205
|
||||
|
||||
/* Virtual LED (icon) */
|
||||
#define CONFIG_LED LED_VIRTUAL
|
||||
|
|
|
@ -144,10 +144,11 @@
|
|||
/* USB On-the-go */
|
||||
#define CONFIG_USBOTG USBOTG_ARC
|
||||
|
||||
/* enable these for the experimental usb stack
|
||||
/* enable these for the experimental usb stack */
|
||||
#define HAVE_USBSTACK
|
||||
#define USBSTACK_CAPS CONTROLLER_DEVICE
|
||||
*/
|
||||
#define USB_VENDOR_ID 0x05ac
|
||||
#define USB_PRODUCT_ID 0x1205
|
||||
|
||||
|
||||
/* Virtual LED (icon) */
|
||||
#define CONFIG_LED LED_VIRTUAL
|
||||
|
|
|
@ -143,10 +143,10 @@
|
|||
/* USB On-the-go */
|
||||
#define CONFIG_USBOTG USBOTG_ARC
|
||||
|
||||
/* enable these for the experimental usb stack
|
||||
/* enable these for the experimental usb stack */
|
||||
#define HAVE_USBSTACK
|
||||
#define USBSTACK_CAPS CONTROLLER_DEVICE
|
||||
*/
|
||||
#define USB_VENDOR_ID 0x05ac
|
||||
#define USB_PRODUCT_ID 0x120a
|
||||
|
||||
/* Virtual LED (icon) */
|
||||
#define CONFIG_LED LED_VIRTUAL
|
||||
|
|
|
@ -150,10 +150,10 @@
|
|||
/* USB On-the-go */
|
||||
#define CONFIG_USBOTG USBOTG_ARC
|
||||
|
||||
/* enable these for the experimental usb stack
|
||||
/* enable these for the experimental usb stack */
|
||||
#define HAVE_USBSTACK
|
||||
#define USBSTACK_CAPS CONTROLLER_DEVICE
|
||||
*/
|
||||
#define USB_VENDOR_ID 0x05ac
|
||||
#define USB_PRODUCT_ID 0x1209
|
||||
|
||||
/* Virtual LED (icon) */
|
||||
#define CONFIG_LED LED_VIRTUAL
|
||||
|
|
|
@ -27,10 +27,8 @@
|
|||
#include "button.h"
|
||||
#include "ata.h"
|
||||
#include "string.h"
|
||||
#ifdef HAVE_USBSTACK
|
||||
#include "usb_core.h"
|
||||
#include "usb_drv.h"
|
||||
#endif
|
||||
|
||||
void usb_init_device(void)
|
||||
{
|
||||
|
@ -58,43 +56,10 @@ void usb_init_device(void)
|
|||
|
||||
void usb_enable(bool on)
|
||||
{
|
||||
#ifdef HAVE_USBSTACK
|
||||
if (on)
|
||||
usb_core_init();
|
||||
else
|
||||
usb_core_exit();
|
||||
#else
|
||||
/* This device specific code will eventually give way to proper USB
|
||||
handling, which should be the same for all PP502x targets. */
|
||||
if (on)
|
||||
{
|
||||
#if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined (IRIVER_H10_5GB) ||\
|
||||
defined(SANSA_C200)
|
||||
/* For the H10 and iPod, we can only do one thing with USB mode - reboot
|
||||
into the flash-based disk-mode. This does not return. */
|
||||
|
||||
#if defined(IRIVER_H10) || defined (IRIVER_H10_5GB)
|
||||
if(button_status()==BUTTON_RIGHT)
|
||||
#endif /* defined(IRIVER_H10) || defined (IRIVER_H10_5GB) */
|
||||
{
|
||||
#ifndef HAVE_FLASH_STORAGE
|
||||
ata_sleepnow(); /* Immediately spindown the disk. */
|
||||
sleep(HZ*2);
|
||||
#endif
|
||||
|
||||
#ifdef IPOD_ARCH /* The following code is based on ipodlinux */
|
||||
#if CONFIG_CPU == PP5020
|
||||
memcpy((void *)0x40017f00, "diskmode\0\0hotstuff\0\0\1", 21);
|
||||
#elif CONFIG_CPU == PP5022
|
||||
memcpy((void *)0x4001ff00, "diskmode\0\0hotstuff\0\0\1", 21);
|
||||
#endif /* CONFIG_CPU */
|
||||
#endif /* IPOD_ARCH */
|
||||
|
||||
system_reboot(); /* Reboot */
|
||||
}
|
||||
#endif /*defined(IPOD_ARCH) || defined(IRIVER_H10) || defined (IRIVER_H10_5GB)*/
|
||||
}
|
||||
#endif /* !HAVE_USBSTACK */
|
||||
}
|
||||
|
||||
int usb_detect(void)
|
||||
|
@ -117,6 +82,8 @@ int usb_detect(void)
|
|||
if (GPIOL_INPUT_VAL & 0x4)
|
||||
return USB_INSERTED;
|
||||
#endif
|
||||
if (usb_drv_powered())
|
||||
return USB_INSERTED;
|
||||
|
||||
return USB_EXTRACTED;
|
||||
}
|
||||
|
|
|
@ -268,14 +268,14 @@ static const struct {
|
|||
} usb_strings[] =
|
||||
{
|
||||
{
|
||||
16,
|
||||
24,
|
||||
USB_DT_STRING,
|
||||
{'R','o','c','k','b','o','x'}
|
||||
{'R','o','c','k','b','o','x','.','o','r','g'}
|
||||
},
|
||||
{
|
||||
42,
|
||||
USB_DT_STRING,
|
||||
{'D','i','g','i','t','a','l',' ','a','u','d','i','o',' ','p','l','a','y','e','r'}
|
||||
{'R','o','c','k','b','o','x',' ','m','e','d','i','a',' ','p','l','a','y','e','r'}
|
||||
},
|
||||
{
|
||||
40,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue