Re: [PATCH 3/4] i2c-s3c2410: use exponential back off while polling for bus idle

2012-11-20 Thread Daniel Kurtz
Hi Mark, On Tue, Nov 20, 2012 at 12:49 PM, Mark Brown broo...@opensource.wolfsonmicro.com wrote: On Thu, Nov 15, 2012 at 05:43:32PM +0530, Naveen Krishna Chatradhi wrote: + iicstat = readl(i2c-regs + S3C2410_IICSTAT); + delay = 1; + while ((iicstat S3C2410_IICSTAT_START)

Re: [PATCH 3/4] i2c-s3c2410: use exponential back off while polling for bus idle

2012-11-19 Thread Mark Brown
On Thu, Nov 15, 2012 at 05:43:32PM +0530, Naveen Krishna Chatradhi wrote: + iicstat = readl(i2c-regs + S3C2410_IICSTAT); + delay = 1; + while ((iicstat S3C2410_IICSTAT_START) +ktime_us_delta(now, start) S3C2410_IDLE_TIMEOUT) { + usleep_range(delay, 2 *

[PATCH 3/4] i2c-s3c2410: use exponential back off while polling for bus idle

2012-11-15 Thread Naveen Krishna Chatradhi
From: Daniel Kurtz djku...@chromium.org Usually, the i2c controller has finished emitting the i2c STOP before the driver reaches the bus idle polling loop. Optimize for this most common case by reading IICSTAT first and potentially skipping the loop. If the cpu is faster than the hardware, we