]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sunxi: axp209: Disable interrupts when intializing the axp209
authorHans de Goede <hdegoede@redhat.com>
Sat, 17 Jan 2015 15:39:20 +0000 (16:39 +0100)
committerHans de Goede <hdegoede@redhat.com>
Thu, 22 Jan 2015 11:34:55 +0000 (12:34 +0100)
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>
drivers/power/axp209.c

index 3b1a6a73aed8ecfd8f748c1ffc37db8fff747e2e..4565398b0bf37d70b55e7f403aef4c3e70877cc3 100644 (file)
@@ -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;
 }