diff options
author | MichaelRey <woulle@yahoo.com> | 2018-11-09 17:51:50 -0700 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-07-28 01:13:48 +0000 |
commit | fbe557d4324c2bec2a990e9f07732d8bbb448261 (patch) | |
tree | 071b302c1109925bc68d7f6be1a9fe2f097530e0 | |
parent | 5e72616618658c8b377db323696042ca122a5c89 (diff) | |
download | rockbox-fbe557d4324c2bec2a990e9f07732d8bbb448261.tar.gz rockbox-fbe557d4324c2bec2a990e9f07732d8bbb448261.zip |
Fix IPod 3G USB Recognition Problem
Allow IPod 3rd generation to recognize when USB is connected and reboot into disk mode.
This problem is listed at the bottom of the Ipod status page https://www.rockbox.org/wiki/IpodStatus
Change-Id: I8f32afd065d3a91cddc56fe63454bd082bfa29b9
-rw-r--r-- | docs/CREDITS | 1 | ||||
-rw-r--r-- | firmware/target/arm/pp/usb-fw-pp5002.c | 16 |
2 files changed, 12 insertions, 5 deletions
diff --git a/docs/CREDITS b/docs/CREDITS index 012b31c72b..a1041f4952 100644 --- a/docs/CREDITS +++ b/docs/CREDITS | |||
@@ -696,6 +696,7 @@ Adrián Tinoco | |||
696 | Boris Kovačević | 696 | Boris Kovačević |
697 | Stéphane Moutard-Martin | 697 | Stéphane Moutard-Martin |
698 | Rune Pade | 698 | Rune Pade |
699 | Michael Rey | ||
699 | 700 | ||
700 | The libmad team | 701 | The libmad team |
701 | The wavpack team | 702 | The wavpack team |
diff --git a/firmware/target/arm/pp/usb-fw-pp5002.c b/firmware/target/arm/pp/usb-fw-pp5002.c index d296b05b2f..d0fbbd6e48 100644 --- a/firmware/target/arm/pp/usb-fw-pp5002.c +++ b/firmware/target/arm/pp/usb-fw-pp5002.c | |||
@@ -28,12 +28,14 @@ | |||
28 | 28 | ||
29 | void usb_pin_init(void) | 29 | void usb_pin_init(void) |
30 | { | 30 | { |
31 | /* TODO: add USB init for iPod 3rd gen */ | 31 | #if defined(IPOD_1G2G) |
32 | |||
33 | #if defined(IPOD_1G2G) || defined(IPOD_3G) | ||
34 | /* GPIO C bit 7 is firewire detect */ | 32 | /* GPIO C bit 7 is firewire detect */ |
35 | GPIOC_ENABLE |= 0x80; | 33 | GPIOC_ENABLE |= 0x80; |
36 | GPIOC_OUTPUT_EN &= ~0x80; | 34 | GPIOC_OUTPUT_EN &= ~0x80; |
35 | #elif defined(IPOD_3G) | ||
36 | /* GPIO D bit 4 is USB detect */ | ||
37 | GPIOD_ENABLE |= 0x10; | ||
38 | GPIOD_OUTPUT_EN &= ~0x10; | ||
37 | #endif | 39 | #endif |
38 | } | 40 | } |
39 | 41 | ||
@@ -62,13 +64,17 @@ void usb_enable(bool on) | |||
62 | 64 | ||
63 | int usb_detect(void) | 65 | int usb_detect(void) |
64 | { | 66 | { |
65 | #if defined(IPOD_1G2G) || defined(IPOD_3G) | 67 | #if defined(IPOD_1G2G) |
66 | /* GPIO C bit 7 is firewire detect */ | 68 | /* GPIO C bit 7 is firewire detect */ |
67 | if (!(GPIOC_INPUT_VAL & 0x80)) | 69 | if (!(GPIOC_INPUT_VAL & 0x80)) |
68 | return USB_INSERTED; | 70 | return USB_INSERTED; |
69 | #endif | 71 | #endif |
70 | 72 | ||
71 | /* TODO: add USB detection for iPod 3rd gen */ | 73 | #if defined(IPOD_3G) |
74 | /* GPIO D bit 4 is USB detect */ | ||
75 | if (GPIOD_INPUT_VAL & 0x10) | ||
76 | return USB_INSERTED; | ||
77 | #endif | ||
72 | 78 | ||
73 | return USB_EXTRACTED; | 79 | return USB_EXTRACTED; |
74 | } | 80 | } |