From: Hans de Goede Date: Mon, 12 Sep 2016 15:24:19 +0200 Subject: [U-Boot] [PATCH] sunxi: axp2xx: disable ldoio0/1 at boot In-Reply-To: <1473684103.28111.66.camel@hellion.org.uk> References: <20160912075533.30299-1-hdegoede@redhat.com> <1473684103.28111.66.camel@hellion.org.uk> Message-ID: <97779f9f-24fb-d837-0a50-a78d5f4f6487@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 12-09-16 14:41, Ian Campbell wrote: > On Mon, 2016-09-12 at 09:55 +0200, Hans de Goede wrote: >> @@ -223,7 +223,14 @@ int axp_init(void) >>> if (!(axp_chip_id == 0x6 || axp_chip_id == 0x7 || axp_chip_id == 0x17)) >>> return -ENODEV; >> >>> - return 0; >>> + /* >>> + * Turn off LDOIO regulators / tri-state GPIO pins, when rebooting >>> + * from android these are sometimes on. >>> + */ >>> + ret |= pmic_bus_write(AXP_GPIO0_CTRL, AXP_GPIO_CTRL_INPUT); >>> + ret |= pmic_bus_write(AXP_GPIO1_CTRL, AXP_GPIO_CTRL_INPUT); > > If ret values are errno's (as the context suggests by containing > -ENODEV) then or-ing them together could result in corruption from > combining two distinct errno values. True, v2 coming up ... Regards, Hans