mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
sunxi: axp209: Disable interrupts when intializing the axp209
We do not use the axp209 interrupt, and at least in my mini-x (which does not have a power button) the pwr-button pin and the irq pin are soldered together, so if the axp209 keeps it irq asserted too long it will see a 10s pwr-button press and hard power off the board, disabling the irqs fixes this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
This commit is contained in:
parent
daf22636c2
commit
9dcf68fac8
1 changed files with 13 additions and 1 deletions
|
@ -16,6 +16,11 @@ enum axp209_reg {
|
|||
AXP209_DCDC3_VOLTAGE = 0x27,
|
||||
AXP209_LDO24_VOLTAGE = 0x28,
|
||||
AXP209_LDO3_VOLTAGE = 0x29,
|
||||
AXP209_IRQ_ENABLE1 = 0x40,
|
||||
AXP209_IRQ_ENABLE2 = 0x41,
|
||||
AXP209_IRQ_ENABLE3 = 0x42,
|
||||
AXP209_IRQ_ENABLE4 = 0x43,
|
||||
AXP209_IRQ_ENABLE5 = 0x44,
|
||||
AXP209_IRQ_STATUS5 = 0x4c,
|
||||
AXP209_SHUTDOWN = 0x32,
|
||||
AXP209_GPIO0_CTRL = 0x90,
|
||||
|
@ -143,7 +148,7 @@ int axp209_set_ldo4(int mvolt)
|
|||
int axp209_init(void)
|
||||
{
|
||||
u8 ver;
|
||||
int rc;
|
||||
int i, rc;
|
||||
|
||||
rc = axp209_read(AXP209_CHIP_VERSION, &ver);
|
||||
if (rc)
|
||||
|
@ -155,6 +160,13 @@ int axp209_init(void)
|
|||
if (ver != 0x1)
|
||||
return -1;
|
||||
|
||||
/* Mask all interrupts */
|
||||
for (i = AXP209_IRQ_ENABLE1; i <= AXP209_IRQ_ENABLE5; i++) {
|
||||
rc = axp209_write(i, 0);
|
||||
if (rc)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue