All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/9] sunxi: axp209: Disable interrupts when intializing the axp209
@ 2015-01-18 12:23 Hans de Goede
  2015-01-18 12:23 ` [U-Boot] [PATCH 2/9] sunxi: ba10_tv_box_defconfig: Fix USB not working Hans de Goede
                   ` (8 more replies)
  0 siblings, 9 replies; 26+ messages in thread
From: Hans de Goede @ 2015-01-18 12:23 UTC (permalink / raw)
  To: u-boot

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 to 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>
---
 drivers/power/axp209.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/power/axp209.c b/drivers/power/axp209.c
index 3b1a6a7..4565398 100644
--- a/drivers/power/axp209.c
+++ b/drivers/power/axp209.c
@@ -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;
 }
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-01-20  8:51 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-18 12:23 [U-Boot] [PATCH 1/9] sunxi: axp209: Disable interrupts when intializing the axp209 Hans de Goede
2015-01-18 12:23 ` [U-Boot] [PATCH 2/9] sunxi: ba10_tv_box_defconfig: Fix USB not working Hans de Goede
2015-01-18 16:15   ` Ian Campbell
2015-01-18 12:23 ` [U-Boot] [PATCH 3/9] sunxi: Stop differentiating between 512M and 1G variants of the same board Hans de Goede
2015-01-18 16:22   ` Ian Campbell
2015-01-18 16:45     ` Hans de Goede
2015-01-18 21:46   ` Siarhei Siamashka
2015-01-19 14:35     ` Hans de Goede
2015-01-20  8:51       ` Ian Campbell
2015-01-18 12:23 ` [U-Boot] [PATCH 4/9] sunxi: Convert Linksprite_pcDuino_defconfig to use auto dram configuration Hans de Goede
2015-01-18 16:24   ` Ian Campbell
2015-01-18 16:26     ` Ian Campbell
2015-01-18 16:48       ` Hans de Goede
2015-01-18 16:47     ` Hans de Goede
2015-01-18 12:23 ` [U-Boot] [PATCH 5/9] sunxi: Convert sun4i boards " Hans de Goede
2015-01-18 16:28   ` Ian Campbell
2015-01-18 12:23 ` [U-Boot] [PATCH 6/9] sunxi: Remove CONFIG_TARGET_FOO for sun4i, sun6i and sun8i boards Hans de Goede
2015-01-18 16:31   ` Ian Campbell
2015-01-18 16:33     ` Ian Campbell
2015-01-18 16:58     ` Hans de Goede
2015-01-18 12:23 ` [U-Boot] [PATCH 7/9] sunxi: Add mk802 board / defconfig Hans de Goede
2015-01-18 16:34   ` Ian Campbell
2015-01-19 19:57     ` Hans de Goede
2015-01-18 12:23 ` [U-Boot] [PATCH 8/9] sunxi: Add mk802ii " Hans de Goede
2015-01-18 12:23 ` [U-Boot] [PATCH 9/9] sunxi: Add mk802_a10s " Hans de Goede
2015-01-18 16:15 ` [U-Boot] [PATCH 1/9] sunxi: axp209: Disable interrupts when intializing the axp209 Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.