summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-09-10 04:32:35 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-09-10 04:32:35 +0000
commitc3b147598ce81fe39b4d0d13b9282da896cec640 (patch)
treed65d0b970619a0ddf00f5a42a064d2a96f889f56 /firmware
parent5ffd3aeb4d8ed098dea890ce121463c3f382d39f (diff)
downloadrockbox-c3b147598ce81fe39b4d0d13b9282da896cec640.tar.gz
rockbox-c3b147598ce81fe39b4d0d13b9282da896cec640.zip
More PMU madness for x5-- a better, more paranoid sequence for enabling GPI0 IMHO
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10913 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/coldfire/iaudio/x5/pcf50606-x5.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/pcf50606-x5.c b/firmware/target/coldfire/iaudio/x5/pcf50606-x5.c
index 79d98acd6d..f0e11f088d 100644
--- a/firmware/target/coldfire/iaudio/x5/pcf50606-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/pcf50606-x5.c
@@ -166,19 +166,20 @@ void pcf50606_init(void)
166 166
167 i2c_add_node(&pcf50606_i2c); 167 i2c_add_node(&pcf50606_i2c);
168 168
169 /* make sure GPI0 interrupt is off before unmasking anything */
170 and_l(~0xF, &INTPRI5); /* INT32 - Priority 0 (Off) */
171
169 /* unmask ONKEY1S - ONKEY held low for 1 second */ 172 /* unmask ONKEY1S - ONKEY held low for 1 second */
170 pcf50606_write(0x05, ~0x04); 173 pcf50606_write(0x05, ~0x04);
171 /* clear INT1-3 as these are left set after standby */ 174 /* clear INT1-3 as these are left set after standby */
172 pcf50606_read_multiple(0x02, read, 3); 175 pcf50606_read_multiple(0x02, read, 3);
173 176
174 set_voltages(); 177 /* Set to read pcf50606 INT but keep GPI0 off until init completes */
175
176 /* enable GPI0 interrupts (pcf50606 IRQ) */
177 and_l(~0x00000001, &GPIO_ENABLE); 178 and_l(~0x00000001, &GPIO_ENABLE);
178 or_l(0x00000001, &GPIO_FUNCTION); 179 or_l(0x00000001, &GPIO_FUNCTION);
179 or_l(0x00000100, &GPIO_INT_EN); /* GPI0 H-L */ 180 or_l(0x00000100, &GPIO_INT_EN); /* GPI0 H-L */
180 and_l(~0xF, &INTPRI5); /* INT32 - Priority 6 */ 181
181 or_l(0x6, &INTPRI5); 182 set_voltages();
182 183
183 pcf50606_write(0x39, 0x00); /* GPOOD0 = green led OFF */ 184 pcf50606_write(0x39, 0x00); /* GPOOD0 = green led OFF */
184 pcf50606_write(0x3a, 0x00); /* GPOOD1 = red led OFF */ 185 pcf50606_write(0x3a, 0x00); /* GPOOD1 = red led OFF */
@@ -196,6 +197,9 @@ void pcf50606_init(void)
196 /* Keep backlight on when changing to firmware */ 197 /* Keep backlight on when changing to firmware */
197 pcf50606_write(0x38, 0xb0); /* Backlight ON, GPO1INV=1, GPO1ACT=011 */ 198 pcf50606_write(0x38, 0xb0); /* Backlight ON, GPO1INV=1, GPO1ACT=011 */
198#endif 199#endif
200
201 /* allow GPI0 interrupts from PMU now */
202 or_l(0x6, &INTPRI5); /* INT32 - Priority 6 */
199} 203}
200 204
201/* Handles interrupts generated by the pcf50606 */ 205/* Handles interrupts generated by the pcf50606 */