diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-02-10 23:20:34 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-02-10 23:20:34 +0000 |
commit | aa2989f4d272344062c43fc894a7721efd7f9f8c (patch) | |
tree | 3846aa0b136a6dd5e06e8d4acc498a410a0f116b | |
parent | 8a4c70490929d96a193e25a966f4f92e18161ae2 (diff) | |
download | rockbox-aa2989f4d272344062c43fc894a7721efd7f9f8c.tar.gz rockbox-aa2989f4d272344062c43fc894a7721efd7f9f8c.zip |
iRiver: USB support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5892 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/export/config-h100.h | 2 | ||||
-rw-r--r-- | firmware/mpeg.c | 3 | ||||
-rw-r--r-- | firmware/usb.c | 23 |
3 files changed, 23 insertions, 5 deletions
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index c8a7a5c26c..0083842770 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h | |||
@@ -48,7 +48,7 @@ | |||
48 | /* Offset ( in the firmware file's header ) to the real data */ | 48 | /* Offset ( in the firmware file's header ) to the real data */ |
49 | #define FIRMWARE_OFFSET_FILE_DATA 8 | 49 | #define FIRMWARE_OFFSET_FILE_DATA 8 |
50 | 50 | ||
51 | #define USB_NONE /* FIX: USB temorarily disabled */ | 51 | #define USB_IRIVERSTYLE |
52 | 52 | ||
53 | /* Define this if you have a software controlled poweroff */ | 53 | /* Define this if you have a software controlled poweroff */ |
54 | #define HAVE_SW_POWEROFF | 54 | #define HAVE_SW_POWEROFF |
diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 4a1ff52666..954faece94 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c | |||
@@ -1995,6 +1995,9 @@ static void mpeg_thread(void) | |||
1995 | mpeg_stop_done = true; | 1995 | mpeg_stop_done = true; |
1996 | break; | 1996 | break; |
1997 | default: | 1997 | default: |
1998 | /* Tell the USB thread that we are safe */ | ||
1999 | DEBUGF("mpeg_thread got SYS_USB_CONNECTED\n"); | ||
2000 | usb_acknowledge(SYS_USB_CONNECTED_ACK); | ||
1998 | break; | 2001 | break; |
1999 | } | 2002 | } |
2000 | } | 2003 | } |
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 | ||
165 | static void usb_slave_mode(bool on) | 176 | static 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); |