From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Mon, 09 Apr 2012 15:01:41 -0600 Subject: [U-Boot] [PATCH v3 04/23] i2c: Add TPS6586X driver In-Reply-To: <1333408743-28720-5-git-send-email-sjg@chromium.org> References: <1333408743-28720-1-git-send-email-sjg@chromium.org> <1333408743-28720-5-git-send-email-sjg@chromium.org> Message-ID: <4F834E35.1040404@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04/02/2012 05:18 PM, Simon Glass wrote: > This power management chip supports battery charging and a large number > of power supplies. This initial driver only provides the ability to adjust > the two synchronous buck converters SM0 and SM1 in a stepwise manner. > > Signed-off-by: Simon Glass > +#define MAX_I2C_RETRY 3 > +int tps6586x_read(int reg) ... > + for (i = 0; i < MAX_I2C_RETRY; ++i) { > + if (!i2c_read(I2C_ADDRESS, reg, 1, &data, 1)) { > + retval = (int)data; > + goto exit; > + } > + > + /* i2c access failed, retry */ > + udelay(100); > + } Why do we need this retry logic; the kernel driver doesn't appear to have this.