diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-12-06 10:06:40 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-12-06 10:06:40 +0000 |
commit | 55e9670c702cbb13895c74a3b0ac32122e5b518f (patch) | |
tree | 4e3e0602b67eb3ba5c7c38f42ed8895f08959a57 /firmware/usb.c | |
parent | c9016f82e02470ea0f282d676742044ff0851e97 (diff) | |
download | rockbox-55e9670c702cbb13895c74a3b0ac32122e5b518f.tar.gz rockbox-55e9670c702cbb13895c74a3b0ac32122e5b518f.zip |
USB support for H300
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8167 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usb.c')
-rw-r--r-- | firmware/usb.c | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/firmware/usb.c b/firmware/usb.c index fd92f852ed..8f9de111e4 100644 --- a/firmware/usb.c +++ b/firmware/usb.c | |||
@@ -136,13 +136,21 @@ static void usb_enable(bool on) | |||
136 | if(on) | 136 | if(on) |
137 | { | 137 | { |
138 | /* Power on the Cypress chip */ | 138 | /* Power on the Cypress chip */ |
139 | or_l(0x01000000, &GPIO_OUT); | 139 | #ifdef IRIVER_H100_SERIES |
140 | or_l(0x01000040, &GPIO_OUT); | ||
141 | #else | ||
142 | and_l(~0x00000008,&GPIO1_OUT); | ||
143 | #endif | ||
140 | sleep(2); | 144 | sleep(2); |
141 | } | 145 | } |
142 | else | 146 | else |
143 | { | 147 | { |
144 | /* Power off the Cypress chip */ | 148 | /* Power off the Cypress chip */ |
145 | and_l(~0x01000000, &GPIO_OUT); | 149 | #ifdef IRIVER_H100_SERIES |
150 | and_l(~0x01000040, &GPIO_OUT); | ||
151 | #else | ||
152 | or_l(0x00000008,&GPIO1_OUT); | ||
153 | #endif | ||
146 | } | 154 | } |
147 | 155 | ||
148 | #elif defined(USB_IPODSTYLE) | 156 | #elif defined(USB_IPODSTYLE) |
@@ -361,7 +369,7 @@ bool usb_detect(void) | |||
361 | #endif | 369 | #endif |
362 | #ifdef IRIVER_H300 | 370 | #ifdef IRIVER_H300 |
363 | /* TODO: add proper code code for H300 USB style */ | 371 | /* TODO: add proper code code for H300 USB style */ |
364 | current_status = false; | 372 | current_status = (GPIO1_READ & 0x80)?true:false; |
365 | #endif | 373 | #endif |
366 | #ifdef USB_IPODSTYLE | 374 | #ifdef USB_IPODSTYLE |
367 | /* TODO: Implement USB_IPODSTYLE */ | 375 | /* TODO: Implement USB_IPODSTYLE */ |
@@ -436,11 +444,23 @@ void usb_init(void) | |||
436 | countdown = -1; | 444 | countdown = -1; |
437 | 445 | ||
438 | #ifdef USB_IRIVERSTYLE | 446 | #ifdef USB_IRIVERSTYLE |
439 | and_l(~0x01000000, &GPIO_OUT); /* GPIO24 is the Cypress chip power */ | ||
440 | or_l(0x01000000, &GPIO_ENABLE); | ||
441 | or_l(0x01000000, &GPIO_FUNCTION); | ||
442 | |||
443 | or_l(0x00000080, &GPIO1_FUNCTION); /* GPIO39 is the USB detect input */ | 447 | or_l(0x00000080, &GPIO1_FUNCTION); /* GPIO39 is the USB detect input */ |
448 | |||
449 | #ifdef IRIVER_H300_SERIES | ||
450 | /* ISD300 3.3V ON */ | ||
451 | or_l(8,&GPIO1_FUNCTION); | ||
452 | or_l(8,&GPIO1_OUT); | ||
453 | or_l(8,&GPIO1_ENABLE); | ||
454 | |||
455 | /* Tristate the SCK/SDA to the ISD300 config EEPROM */ | ||
456 | and_l(~0x03000000, &GPIO_ENABLE); | ||
457 | or_l(0x03000000, &GPIO_FUNCTION); | ||
458 | #else | ||
459 | and_l(~0x01000040, &GPIO_OUT); /* GPIO24 is the Cypress chip power */ | ||
460 | or_l(0x01000040, &GPIO_ENABLE); | ||
461 | or_l(0x01000040, &GPIO_FUNCTION); | ||
462 | #endif | ||
463 | |||
444 | #endif | 464 | #endif |
445 | 465 | ||
446 | usb_enable(false); | 466 | usb_enable(false); |