diff options
author | Michael Giacomelli <giac2000@hotmail.com> | 2008-02-10 05:39:20 +0000 |
---|---|---|
committer | Michael Giacomelli <giac2000@hotmail.com> | 2008-02-10 05:39:20 +0000 |
commit | 054447f9e6037e4feb1a4c4313bd0afd4eb382a6 (patch) | |
tree | 57d78a645d2700d78a66f1807cc26dca9b6c45c9 /firmware/drivers | |
parent | 2b3136e1f350721fa65cc304cad7a00504390850 (diff) | |
download | rockbox-054447f9e6037e4feb1a4c4313bd0afd4eb382a6.tar.gz rockbox-054447f9e6037e4feb1a4c4313bd0afd4eb382a6.zip |
Commit FS#8379 by Andree Buschmann. Disables much of the remaining unneeded hardware on PP50xx targets (Ipods, Sansa, H10s, etc) resulting in a large savings in power and consequent increase in battery life. Results vary from target to target and from codec to codec, but we now approach the OF runtime on several PP devices. For now, leave base CPU clock at 30MHz, although further savings is possible with some codecs if clock is reduced. Additionally, fix battery capacity on c200 and use my measurements to improve runtime estimation for Sandisk targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16259 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/audio/as3514.c | 10 | ||||
-rw-r--r-- | firmware/drivers/pcf50605.c | 43 |
2 files changed, 44 insertions, 9 deletions
diff --git a/firmware/drivers/audio/as3514.c b/firmware/drivers/audio/as3514.c index 2dc1513668..80ada46f80 100644 --- a/firmware/drivers/audio/as3514.c +++ b/firmware/drivers/audio/as3514.c | |||
@@ -146,11 +146,15 @@ void audiohw_init(void) | |||
146 | DEV_RS |= DEV_I2S; | 146 | DEV_RS |= DEV_I2S; |
147 | DEV_RS &=~DEV_I2S; | 147 | DEV_RS &=~DEV_I2S; |
148 | 148 | ||
149 | /* device enable */ | 149 | /* I2S device reset */ |
150 | DEV_EN |= (DEV_I2S | 0x7); | 150 | DEV_RS |= DEV_I2S; |
151 | DEV_RS &=~DEV_I2S; | ||
152 | |||
153 | /* I2S device enable */ | ||
154 | DEV_EN |= DEV_I2S; | ||
151 | 155 | ||
152 | /* enable external dev clock clocks */ | 156 | /* enable external dev clock clocks */ |
153 | DEV_EN |= 0x2; | 157 | DEV_EN |= DEV_EXTCLOCKS; |
154 | 158 | ||
155 | /* external dev clock to 24MHz */ | 159 | /* external dev clock to 24MHz */ |
156 | outl(inl(0x70000018) & ~0xc, 0x70000018); | 160 | outl(inl(0x70000018) & ~0xc, 0x70000018); |
diff --git a/firmware/drivers/pcf50605.c b/firmware/drivers/pcf50605.c index d34e8512c1..afa0a5ca11 100644 --- a/firmware/drivers/pcf50605.c +++ b/firmware/drivers/pcf50605.c | |||
@@ -63,11 +63,20 @@ | |||
63 | #define PSSC 0x18 | 63 | #define PSSC 0x18 |
64 | #define PWROKM 0x19 | 64 | #define PWROKM 0x19 |
65 | #define PWROKS 0x1a | 65 | #define PWROKS 0x1a |
66 | #define DCDC1 0x1b | ||
67 | #define DCDC2 0x1c | ||
68 | #define DCDC3 0x1d | ||
69 | #define DCDC4 0x1e | ||
70 | #define DCDEC1 0x1f | ||
71 | #define DCDEC2 0x20 | ||
72 | #define DCUDC1 0x21 | ||
73 | #define DCUDC2 0x22 | ||
74 | #define IOREGC 0x23 | ||
66 | #define D1REGC1 0x24 | 75 | #define D1REGC1 0x24 |
67 | #define VOUT_3000mV 0xf5 | ||
68 | #define VOUT_3300mV 0xf8 | ||
69 | #define D2REGC1 0x25 | 76 | #define D2REGC1 0x25 |
70 | #define D3REGC1 0x26 | 77 | #define D3REGC1 0x26 |
78 | #define LPREG1C 0x27 | ||
79 | |||
71 | 80 | ||
72 | unsigned char pcf50605_wakeup_flags = 0; | 81 | unsigned char pcf50605_wakeup_flags = 0; |
73 | 82 | ||
@@ -113,8 +122,30 @@ void pcf50605_standby_mode(void) | |||
113 | 122 | ||
114 | void pcf50605_init(void) | 123 | void pcf50605_init(void) |
115 | { | 124 | { |
116 | /* The following values were taken from the ipodlinux kernel source */ | 125 | #if defined (IPOD_VIDEO) |
117 | pcf50605_write(D1REGC1, VOUT_3000mV); /* Unknown */ | 126 | /* I/O and GPO voltage supply (default: 0xf8 = 3.3V ON) */ |
118 | pcf50605_write(D2REGC1, VOUT_3300mV); /* Dock Connector pin 17 */ | 127 | /* ECO not allowed regarding data sheet */ |
119 | pcf50605_write(D3REGC1, VOUT_3000mV); /* Unknown */ | 128 | pcf50605_write(IOREGC, 0xf8); /* 3.3V ON */ |
129 | |||
130 | /* core voltage supply (default DCDC1/DCDC2: 0xec = 1.2V ON) */ | ||
131 | /* ECO not stable, assumed due to less precision of voltage in ECO mode */ | ||
132 | pcf50605_write(DCDC1, 0xec); /* 1.2V ON */ | ||
133 | pcf50605_write(DCDC2, 0x0c); /* OFF */ | ||
134 | |||
135 | /* unknown (default: 0xe3 = 1.8V ON) */ | ||
136 | pcf50605_write(DCUDC1, 0xe3); /* 1.8V ON */ | ||
137 | |||
138 | /* WM8758 voltage supply (default: 0xf5 = 3.0V ON) */ | ||
139 | /* ECO not allowed as max. current of 5mA is not sufficient */ | ||
140 | pcf50605_write(D1REGC1, 0xf0); /* 2.5V ON */ | ||
141 | |||
142 | /* LCD voltage supply (default: 0xf5 = 3.0V ON) */ | ||
143 | pcf50605_write(D3REGC1, 0xf1); /* 2.6V ON */ | ||
144 | #else | ||
145 | /* keep initialization from svn for other iPods */ | ||
146 | pcf50605_write(D1REGC1, 0xf5); /* 3.0V ON */ | ||
147 | pcf50605_write(D3REGC1, 0xf5); /* 3.0V ON */ | ||
148 | #endif | ||
149 | /* Dock Connector pin 17 (default: OFF) */ | ||
150 | pcf50605_write(D2REGC1, 0xf8); /* 3.3V ON */ | ||
120 | } | 151 | } |