1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Michael Sevakis 2006-09-10 04:32:35 +00:00
parent 5ffd3aeb4d
commit c3b147598c

View file

@ -166,19 +166,20 @@ void pcf50606_init(void)
i2c_add_node(&pcf50606_i2c);
/* make sure GPI0 interrupt is off before unmasking anything */
and_l(~0xF, &INTPRI5); /* INT32 - Priority 0 (Off) */
/* unmask ONKEY1S - ONKEY held low for 1 second */
pcf50606_write(0x05, ~0x04);
/* clear INT1-3 as these are left set after standby */
pcf50606_read_multiple(0x02, read, 3);
set_voltages();
/* enable GPI0 interrupts (pcf50606 IRQ) */
/* Set to read pcf50606 INT but keep GPI0 off until init completes */
and_l(~0x00000001, &GPIO_ENABLE);
or_l(0x00000001, &GPIO_FUNCTION);
or_l(0x00000100, &GPIO_INT_EN); /* GPI0 H-L */
and_l(~0xF, &INTPRI5); /* INT32 - Priority 6 */
or_l(0x6, &INTPRI5);
set_voltages();
pcf50606_write(0x39, 0x00); /* GPOOD0 = green led OFF */
pcf50606_write(0x3a, 0x00); /* GPOOD1 = red led OFF */
@ -196,6 +197,9 @@ void pcf50606_init(void)
/* Keep backlight on when changing to firmware */
pcf50606_write(0x38, 0xb0); /* Backlight ON, GPO1INV=1, GPO1ACT=011 */
#endif
/* allow GPI0 interrupts from PMU now */
or_l(0x6, &INTPRI5); /* INT32 - Priority 6 */
}
/* Handles interrupts generated by the pcf50606 */