From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Date: Sat, 08 Nov 2014 10:14:28 +0000 Subject: [U-Boot] [PATCH v3 01/11] sun6i: Add new p2wi controller driver In-Reply-To: <1415389629-1298-2-git-send-email-hdegoede@redhat.com> References: <1415389629-1298-1-git-send-email-hdegoede@redhat.com> <1415389629-1298-2-git-send-email-hdegoede@redhat.com> Message-ID: <1415441668.2030.7.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 Fri, 2014-11-07 at 20:46 +0100, Hans de Goede wrote: > From: Oliver Schinagl > > The A31 uses a new push-pull two wire interface, which features higher > transfer speeds (upto 6 MHz) in theory. While the hardware can burst 8 > bytes each time, this driver will only see very little use and thus is > limited to single byte transmission only. > > Signed-off-by: Oliver Schinagl > Signed-off-by: Hans de Goede Acked-by: Ian Campbell One question: > +int p2wi_change_to_p2wi_mode(u8 slave_addr, u8 ctrl_reg, u8 init_data) > +{ > + struct sunxi_p2wi_reg *p2wi = (struct sunxi_p2wi_reg *)SUNXI_P2WI_BASE; > + unsigned long tmo = timer_get_us() + 1000000; > + > + writel(P2WI_PM_DEV_ADDR(slave_addr) | > + P2WI_PM_CTRL_ADDR(ctrl_reg) | > + P2WI_PM_INIT_DATA(init_data) | > + P2WI_PM_INIT_SEND, > + &p2wi->pm); > + > + while ((readl(&p2wi->pm) & P2WI_PM_INIT_SEND)) { > + if (timer_get_us() > tmo) > + return -EFAULT; You don't mean ETIME(DOUT) or something here, do you? EFAULT seems a bit odd. Ian.