From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Date: Mon, 12 Sep 2016 13:41:43 +0100 Subject: [U-Boot] [PATCH] sunxi: axp2xx: disable ldoio0/1 at boot In-Reply-To: <20160912075533.30299-1-hdegoede@redhat.com> References: <20160912075533.30299-1-hdegoede@redhat.com> Message-ID: <1473684103.28111.66.camel@hellion.org.uk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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. Ian.