Re: [PATCH 2/2] DT: i2c: Add binding document for IMG I2C SCB

2014-10-29 Thread James Hogan
Hi, On Wed, Oct 29, 2014 at 04:32:59PM -0700, Andrew Bresticker wrote: diff --git a/Documentation/devicetree/bindings/i2c/i2c-img-scb.txt b/Documentation/devicetree/bindings/i2c/i2c-img-scb.txt @@ -0,0 +1,14 @@ +IMG Serial Control Bus (SCB) I2C Controller + +Required Properties:

Re: [PATCH 1/2] i2c: Add Imagination Technologies I2C SCB driver

2014-10-31 Thread James Hogan
Hi Andrew, On Fri, Oct 31, 2014 at 02:17:31PM -0700, Andrew Bresticker wrote: + /* +* To avoid slave event interrupts in automatic mode, use a timer to +* poll the abort condition if we don't get an interrupt for too long. +*/ Why would polling be

Re: [PATCH] i2c: img-scb: Allow building for MIPS

2014-11-18 Thread James Hogan
...@chromium.org Looks good to me. Acked-by: James Hogan james.ho...@imgtec.com Cheers James --- Based on i2c/for-next --- drivers/i2c/busses/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index

Re: [PATCH v2] i2c: img-scb: fixup of wait_for_completion_timeout return handling

2015-02-09 Thread James Hogan
On 09/02/15 15:15, Nicholas Mc Guire wrote: Return type of wait_for_completion_timeout is unsigned long not int. Appropriately typed/named variable are added and assignment fixed up. Signed-off-by: Nicholas Mc Guire hof...@osadl.org v2 also: Acked-by: James Hogan james.ho...@imgtec.com

Re: [PATCH] i2c: img-scb: match return type of wait_for_completion_timeout

2015-02-09 Thread James Hogan
and assignment fixed up. Signed-off-by: Nicholas Mc Guire hof...@osadl.org Looks good to me, Acked-by: James Hogan james.ho...@imgtec.com Thanks James --- Patch was compile tested with x86_64_defconfig + CONFIG_COMPILE_TEST=y CONFIG_I2C_IMG=m Patch is against 3.19.0-rc7 (localversion-next

Re: [PATCH v2 6/7] i2c: img-scb: Clear line and interrupt status before starting a transfer

2015-08-19 Thread James Hogan
in the transfer or between transfers, but it does look safe and reasonable, so: Acked-by: James Hogan james.ho...@imgtec.com Cheers James --- drivers/i2c/busses/i2c-img-scb.c |9 + 1 file changed, 9 insertions(+) diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c

Re: [PATCH v2 5/7] i2c: img-scb: remove start bit detected status after handling

2015-08-19 Thread James Hogan
On Fri, Aug 14, 2015 at 04:50:22PM +0100, Sifan Naeem wrote: Remove start bit detected status after it is handled, doing so will prevent this condition being hit for every interrupt on a particular transfer. Fixes: commit 27bce457d588 (i2c: img-scb: Add Imagination Technologies I2C SCB

Re: [PATCH v2 7/7] i2c: img-scb: verify support for requested bit rate

2015-08-19 Thread James Hogan
be more correct for both. Otherwise: Acked-by: James Hogan james.ho...@imgtec.com Wolfram: are you happy to fix the %u thing when applying it, or would you prefer me to submit a fixed patch (Sifan is off for a few weeks I believe). (Still need to look at the other changes...) Cheers James

Re: [PATCH 7/7] i2c: img-scb: add handle for Master halt interrupt

2015-07-29 Thread James Hogan
On 27/07/15 12:56, Sifan Naeem wrote: Master halt is issued after each byte of a transaction is processed in IP version 3.3. Master halt will stall the bus by holding the SCK line low until the halt bit in the scb_general_control is cleared. After the last byte of a transfer is processed we

Re: [PATCH 6/7] i2c: img-scb: add handle for stop detected interrupt

2015-07-29 Thread James Hogan
On 27/07/15 12:56, Sifan Naeem wrote: Stop Detected interrupt is triggered when a Stop bit is detected on the bus, which indicates the end of the current transfer. When the end of a transfer is indicated by the Stop bit interrupt, drain the FIFO and signal completion for the transaction. But

Re: [PATCH 5/7] i2c: img-scb: remove fifo EMPTYING interrupts handle

2015-07-29 Thread James Hogan
On 27/07/15 12:56, Sifan Naeem wrote: This interrupt could have been useful for repeated start transfers as the current transfer could be marked as complete while it's processing the final byte of the transfer. But having to use the transaction halt interrupt to safely control repeated start

Re: [PATCH 6/8] i2c: img-scb: remove start bit detected status after handling

2015-07-28 Thread James Hogan
On 27/07/15 12:47, Sifan Naeem wrote: Remove start bit detected status after it is handled, doing so will prevent this condition being hit for every interrupt on a particular transfer. Fixes: 27bce4 (i2c: img-scb: Add Imagination Technologies I2C SCB driver) Signed-off-by: Sifan Naeem

Re: [PATCH 6/7] i2c: img-scb: add handle for stop detected interrupt

2015-07-29 Thread James Hogan
On Wed, Jul 29, 2015 at 06:06:24PM +0100, Sifan Naeem wrote: Hi James, -Original Message- From: James Hogan Sent: 29 July 2015 16:34 To: Sifan Naeem; Wolfram Sang; linux-i2c@vger.kernel.org Subject: Re: [PATCH 6/7] i2c: img-scb: add handle for stop detected interrupt

Re: [PATCH 3/8] i2c: img-scb: use DIV_ROUND_UP to round divisor values

2015-07-28 Thread James Hogan
kernel (v3.19+) sta...@vger.kernel.org Acked-by: James Hogan james.ho...@imgtec.com Cheers James --- drivers/i2c/busses/i2c-img-scb.c |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c index

Re: [PATCH 4/8] i2c: img-scb: fix LOW and HIGH period values for the SCL clock

2015-07-28 Thread James Hogan
; too much indentation here. Otherwise looks good to me. Acked-by: James Hogan james.ho...@imgtec.com Cheers James - if (tckh 0) - data = tckh - 1; - else - data = 0; + /* Adjust TCKH and TCKL values */ + data = DIV_ROUND_UP(timing.tckl, clk_period

Re: [PATCH 5/8] i2c: img-scb: reset interrupts in img_i2c_soft_reset

2015-07-28 Thread James Hogan
On 27/07/15 12:47, Sifan Naeem wrote: Reset interrupt enable register and clear any generated interrupts to make sure of a clean slate after a soft reset. Not doing so might leave unhandle line status or generated interrupts which can cause issues when handling new transfers. That already

Re: [PATCH 8/8] i2c: img-scb: verify support for requested bit rate

2015-07-29 Thread James Hogan
On 27/07/15 12:47, Sifan Naeem wrote: The requested bit rate can be outside the range supported by the driver. The maximum bit rate this driver supports at the moment is 400Khz. Return -EINVAL if the bit rate is larger than 400khz. Maximum speed supported by the driver can be increased to

Re: [PATCH 7/8] i2c: img-scb: improve transaction complete handle

2015-07-29 Thread James Hogan
Hi Sifan, On 27/07/15 12:47, Sifan Naeem wrote: Clear line status and all interrupts when transaction is complete, as not doing so might leave unserviced interrupts that might be Do you have a specific example of when this might happen, and whether it could occur after

Re: [PATCH 3/7] i2c: img-scb: mark transaction as complete when all data is read

2015-07-29 Thread James Hogan
On 27/07/15 12:55, Sifan Naeem wrote: We can mark the transfer as complete without waiting for the stop bit. This is important when handling repeated start transfers as we have to start the next transfer without the stop bit being issued. Signed-off-by: Sifan Naeem sifan.na...@imgtec.com

Re: [PATCH 2/7] i2c: img-scb: support repeated starts on IP v3.3

2015-07-29 Thread James Hogan
Hi Sifan, On 27/07/15 12:55, Sifan Naeem wrote: In version 3.3 of the IP when transaction halt is set, an interrupt will be generated after each byte of a transfer instead of after every transfer but before the stop bit. Due to this behaviour we have to be careful that every time we release

Re: [PATCH 1/7] i2c: img-scb: support I2C_M_IGNORE_NAK

2015-07-29 Thread James Hogan
simply in treating NAKs as ACKs. Signed-off-by: Sifan Naeem sifan.na...@imgtec.com Looks good, Acked-by: James Hogan james.ho...@imgtec.com Thanks! James --- drivers/i2c/busses/i2c-img-scb.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/i2c

Re: [PATCH 4/7] i2c: img-scb: mark transaction as complete when no more data to write

2015-07-29 Thread James Hogan
On 27/07/15 12:55, Sifan Naeem wrote: We can mark the transfer as complete without waiting for the stop bit. This is important when handling repeated start transfers as we have to start the next transfer without the stop bit being issued. This doesn't affect the older versions of the IP.

Re: [PATCH v2 3/5] i2c: img-scb: add handle for stop detected interrupt

2015-09-02 Thread James Hogan
On 14/08/15 16:50, Sifan Naeem wrote: > Stop Detected interrupt is triggered when a Stop bit is detected on > the bus, which indicates the end of the current transfer. > > When the end of a transfer is indicated by the Stop Detected interrupt, > drain the FIFO and signal completion for the

Re: [PATCH v2 5/5] i2c: img-scb: support repeated starts on IP v3.3

2015-09-03 Thread James Hogan
c *i2c, > /* Enable transaction halt on start bit */ > if (line_status & LINESTAT_START_BIT_DET) { > if (!i2c->last_msg) { > - img_i2c_transaction_halt(i2c, true); > + img_i2c_transaction_halt(i2c, !i2c->last_msg); This hunk seems pointles

Re: [PATCH v3 5/7] i2c: img-scb: use line_status instead of i2c->line_status

2015-09-14 Thread James Hogan
instead of i2c->line_status. > > Signed-off-by: Sifan Naeem <sifan.na...@imgtec.com> > Reviewed-by: James Hartley <james.hart...@imgtec.com> Acked-by: James Hogan <james.ho...@imgtec.com> Thanks James > --- > drivers/i2c/busses/i2c-img-scb.c |2 +- > 1 file