diff mbox

[U-Boot,V2,01/25] mxc_i2c: fix i2c_imx_stop

Message ID 1341518043-26191-1-git-send-email-troy.kisky@boundarydevices.com
State Superseded
Delegated to: Heiko Schocher
Headers show

Commit Message

Troy Kisky July 5, 2012, 7:53 p.m. UTC
Instead of clearing 2 bits, all the other
bits were set because '|=' was used instead
of '&='.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Acked-by: Marek Vasut <marex@denx.de>
Acked-by: Stefano Babic <sbabic@denx.de>

---
V2: add acks
---
 drivers/i2c/mxc_i2c.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Troy Kisky July 5, 2012, 8:02 p.m. UTC | #1
On 7/5/2012 12:53 PM, Troy Kisky wrote:
> Instead of clearing 2 bits, all the other
> bits were set because '|=' was used instead
> of '&='.
>
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> Acked-by: Marek Vasut <marex@denx.de>
> Acked-by: Stefano Babic <sbabic@denx.de>
>
> ---
> V2: add acks
> ---
>   drivers/i2c/mxc_i2c.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
> index fc68062..c0c45fd 100644
> --- a/drivers/i2c/mxc_i2c.c
> +++ b/drivers/i2c/mxc_i2c.c
> @@ -264,7 +264,7 @@ void i2c_imx_stop(void)
>   
>   	/* Stop I2C transaction */
>   	temp = readb(&i2c_regs->i2cr);
> -	temp |= ~(I2CR_MSTA | I2CR_MTX);
> +	temp &= ~(I2CR_MSTA | I2CR_MTX);
>   	writeb(temp, &i2c_regs->i2cr);
>   
>   	i2c_imx_bus_busy(0);
This series was tested on a sabrelite and a i.mx51 board

Thanks
Troy
Marek Vasut July 6, 2012, 6:50 a.m. UTC | #2
Dear Troy Kisky,

> On 7/5/2012 12:53 PM, Troy Kisky wrote:
> > Instead of clearing 2 bits, all the other
> > bits were set because '|=' was used instead
> > of '&='.
> > 
> > Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> > Acked-by: Marek Vasut <marex@denx.de>
> > Acked-by: Stefano Babic <sbabic@denx.de>
> > 
> > ---
> > V2: add acks
> > ---
> > 
> >   drivers/i2c/mxc_i2c.c |    2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
> > index fc68062..c0c45fd 100644
> > --- a/drivers/i2c/mxc_i2c.c
> > +++ b/drivers/i2c/mxc_i2c.c
> > @@ -264,7 +264,7 @@ void i2c_imx_stop(void)
> > 
> >   	/* Stop I2C transaction */
> >   	temp = readb(&i2c_regs->i2cr);
> > 
> > -	temp |= ~(I2CR_MSTA | I2CR_MTX);
> > +	temp &= ~(I2CR_MSTA | I2CR_MTX);
> > 
> >   	writeb(temp, &i2c_regs->i2cr);
> >   	
> >   	i2c_imx_bus_busy(0);
> 
> This series was tested on a sabrelite and a i.mx51 board

Sigh, I should test it on the efikamx board. It has some i2c chip that's hard to 
talk to since it's quite sensitive to the behavior of the bus. But since I'm 
dead busy now, I'll just trust you. I'm glad you found it, Troy :)

> Thanks
> Troy

Best regards,
Marek Vasut
Troy Kisky July 6, 2012, 5:38 p.m. UTC | #3
On 7/5/2012 11:50 PM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> On 7/5/2012 12:53 PM, Troy Kisky wrote:
>>> Instead of clearing 2 bits, all the other
>>> bits were set because '|=' was used instead
>>> of '&='.
>>>
>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>> Acked-by: Marek Vasut <marex@denx.de>
>>> Acked-by: Stefano Babic <sbabic@denx.de>
>>>
>>> ---
>>> V2: add acks
>>> ---
>>>
>>>    drivers/i2c/mxc_i2c.c |    2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
>>> index fc68062..c0c45fd 100644
>>> --- a/drivers/i2c/mxc_i2c.c
>>> +++ b/drivers/i2c/mxc_i2c.c
>>> @@ -264,7 +264,7 @@ void i2c_imx_stop(void)
>>>
>>>    	/* Stop I2C transaction */
>>>    	temp = readb(&i2c_regs->i2cr);
>>>
>>> -	temp |= ~(I2CR_MSTA | I2CR_MTX);
>>> +	temp &= ~(I2CR_MSTA | I2CR_MTX);
>>>
>>>    	writeb(temp, &i2c_regs->i2cr);
>>>    	
>>>    	i2c_imx_bus_busy(0);
>> This series was tested on a sabrelite and a i.mx51 board
> Sigh, I should test it on the efikamx board. It has some i2c chip that's hard to
> talk to since it's quite sensitive to the behavior of the bus. But since I'm
> dead busy now, I'll just trust you. I'm glad you found it, Troy :)
>
>
I'd rather have your verification than trust :-)
Thanks for the reviews.

Troy
Marek Vasut July 6, 2012, 5:46 p.m. UTC | #4
Dear Troy Kisky,

> On 7/5/2012 11:50 PM, Marek Vasut wrote:
> > Dear Troy Kisky,
> > 
> >> On 7/5/2012 12:53 PM, Troy Kisky wrote:
> >>> Instead of clearing 2 bits, all the other
> >>> bits were set because '|=' was used instead
> >>> of '&='.
> >>> 
> >>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> >>> Acked-by: Marek Vasut <marex@denx.de>
> >>> Acked-by: Stefano Babic <sbabic@denx.de>
> >>> 
> >>> ---
> >>> V2: add acks
> >>> ---
> >>> 
> >>>    drivers/i2c/mxc_i2c.c |    2 +-
> >>>    1 file changed, 1 insertion(+), 1 deletion(-)
> >>> 
> >>> diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
> >>> index fc68062..c0c45fd 100644
> >>> --- a/drivers/i2c/mxc_i2c.c
> >>> +++ b/drivers/i2c/mxc_i2c.c
> >>> @@ -264,7 +264,7 @@ void i2c_imx_stop(void)
> >>> 
> >>>    	/* Stop I2C transaction */
> >>>    	temp = readb(&i2c_regs->i2cr);
> >>> 
> >>> -	temp |= ~(I2CR_MSTA | I2CR_MTX);
> >>> +	temp &= ~(I2CR_MSTA | I2CR_MTX);
> >>> 
> >>>    	writeb(temp, &i2c_regs->i2cr);
> >>>    	
> >>>    	i2c_imx_bus_busy(0);
> >> 
> >> This series was tested on a sabrelite and a i.mx51 board
> > 
> > Sigh, I should test it on the efikamx board. It has some i2c chip that's
> > hard to talk to since it's quite sensitive to the behavior of the bus.
> > But since I'm dead busy now, I'll just trust you. I'm glad you found it,
> > Troy :)
> 
> I'd rather have your verification than trust :-)
> Thanks for the reviews.

Hmm, lemme see.

> Troy

Best regards,
Marek Vasut
Marek Vasut July 6, 2012, 11:08 p.m. UTC | #5
Dear Troy Kisky,

> Instead of clearing 2 bits, all the other
> bits were set because '|=' was used instead
> of '&='.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> Acked-by: Marek Vasut <marex@denx.de>
> Acked-by: Stefano Babic <sbabic@denx.de>
> 

Troy, do you have some repo for these please?

Best regards,
Marek Vasut
Troy Kisky July 7, 2012, 1:52 a.m. UTC | #6
On 7/6/2012 4:08 PM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> Instead of clearing 2 bits, all the other
>> bits were set because '|=' was used instead
>> of '&='.
>>
>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>> Acked-by: Marek Vasut <marex@denx.de>
>> Acked-by: Stefano Babic <sbabic@denx.de>
>>
> Troy, do you have some repo for these please?
>
> Best regards,
> Marek Vasut
>
git://github.com/boundarydevices/u-boot-imx6.git i2c_testing
diff mbox

Patch

diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c
index fc68062..c0c45fd 100644
--- a/drivers/i2c/mxc_i2c.c
+++ b/drivers/i2c/mxc_i2c.c
@@ -264,7 +264,7 @@  void i2c_imx_stop(void)
 
 	/* Stop I2C transaction */
 	temp = readb(&i2c_regs->i2cr);
-	temp |= ~(I2CR_MSTA | I2CR_MTX);
+	temp &= ~(I2CR_MSTA | I2CR_MTX);
 	writeb(temp, &i2c_regs->i2cr);
 
 	i2c_imx_bus_busy(0);