diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-11-03 23:57:24 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-11-03 23:57:24 +0000 |
commit | 015f6286a8db3fb79d155cf33698ededf219d32e (patch) | |
tree | 2d6bce1fa42719e947ac8034012a8fe0e7627e20 /firmware/target/arm | |
parent | 33acc662569ab01e0770b85a6b32c57ed340c351 (diff) | |
download | rockbox-015f6286a8db3fb79d155cf33698ededf219d32e.tar.gz rockbox-015f6286a8db3fb79d155cf33698ededf219d32e.zip |
Finally: HDD power control for all PP502x iPods (4th gen Grayscale, Color, Minis, Video). * Wait a short time after powering on the HDD on all disk based targets, as that seems like a good idea. Shorten the excessive wait on initial power on.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15444 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/ipod/power-ipod.c | 26 | ||||
-rw-r--r-- | firmware/target/arm/iriver/h10/power-h10.c | 5 |
2 files changed, 22 insertions, 9 deletions
diff --git a/firmware/target/arm/ipod/power-ipod.c b/firmware/target/arm/ipod/power-ipod.c index 37ef418026..ae663d16e5 100644 --- a/firmware/target/arm/ipod/power-ipod.c +++ b/firmware/target/arm/ipod/power-ipod.c | |||
@@ -63,9 +63,19 @@ void ide_power_enable(bool on) | |||
63 | GPIOC_OUTPUT_VAL &= ~0x40; | 63 | GPIOC_OUTPUT_VAL &= ~0x40; |
64 | else | 64 | else |
65 | GPIOC_OUTPUT_VAL |= 0x40; | 65 | GPIOC_OUTPUT_VAL |= 0x40; |
66 | #else | 66 | #elif defined(IPOD_4G) || defined(IPOD_COLOR) \ |
67 | /* We do nothing on other iPods yet */ | 67 | || defined(IPOD_MINI) || defined(IPOD_MINI2G) |
68 | (void)on; | 68 | if (on) |
69 | GPIO_CLEAR_BITWISE(GPIOJ_OUTPUT_VAL, 0x04); | ||
70 | else | ||
71 | GPIO_SET_BITWISE(GPIOJ_OUTPUT_VAL, 0x04); | ||
72 | #elif defined(IPOD_VIDEO) | ||
73 | if (on) | ||
74 | GPO32_VAL &= ~0x40000000; | ||
75 | else | ||
76 | GPO32_VAL |= 0x40000000; | ||
77 | #else /* Nano */ | ||
78 | (void)on; /* Do nothing. */ | ||
69 | #endif | 79 | #endif |
70 | } | 80 | } |
71 | 81 | ||
@@ -73,9 +83,13 @@ bool ide_powered(void) | |||
73 | { | 83 | { |
74 | #if defined(IPOD_1G2G) || defined(IPOD_3G) | 84 | #if defined(IPOD_1G2G) || defined(IPOD_3G) |
75 | return !(GPIOC_OUTPUT_VAL & 0x40); | 85 | return !(GPIOC_OUTPUT_VAL & 0x40); |
76 | #else | 86 | #elif defined(IPOD_4G) || defined(IPOD_COLOR) \ |
77 | /* pretend we are always powered - we don't turn it off on the ipod */ | 87 | || defined(IPOD_MINI) || defined(IPOD_MINI2G) |
78 | return true; | 88 | return !(GPIOJ_OUTPUT_VAL & 0x04); |
89 | #elif defined(IPOD_VIDEO) | ||
90 | return !(GPO32_VAL & 0x40000000); | ||
91 | #else /* Nano */ | ||
92 | return true; /* Pretend we are always powered */ | ||
79 | #endif | 93 | #endif |
80 | } | 94 | } |
81 | 95 | ||
diff --git a/firmware/target/arm/iriver/h10/power-h10.c b/firmware/target/arm/iriver/h10/power-h10.c index 9cbdb50080..7f3fb40b36 100644 --- a/firmware/target/arm/iriver/h10/power-h10.c +++ b/firmware/target/arm/iriver/h10/power-h10.c | |||
@@ -60,10 +60,9 @@ bool charger_inserted(void) | |||
60 | void ide_power_enable(bool on) | 60 | void ide_power_enable(bool on) |
61 | { | 61 | { |
62 | if(on){ | 62 | if(on){ |
63 | GPIOF_OUTPUT_VAL &=~ 0x1; | 63 | GPIO_CLEAR_BITWISE(GPIOF_OUTPUT_VAL, 0x01); |
64 | sleep(1); | ||
65 | } else { | 64 | } else { |
66 | GPIOF_OUTPUT_VAL |= 0x1; | 65 | GPIO_SET_BITWISE(GPIOF_OUTPUT_VAL, 0x01); |
67 | } | 66 | } |
68 | } | 67 | } |
69 | 68 | ||