summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iaudio/x5/pcf50606-x5.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/iaudio/x5/pcf50606-x5.c')
-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 */