Re: [PATCH] i2c: imx: Add arbitration lost check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -268,6 +268,14 @@ static int i2c_imx_bus_busy(struct imx_i2c_struct *i2c_imx, int for_busy)
>  
>  	while (1) {
>  		temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR);
> +
> +		/** check for arbitration lost **/

One '*' is enough on each side.

> +		if (temp & I2SR_IAL) {
> +			temp &= ~I2SR_IAL;
> +			imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2SR);
> +			return -EIO;

Documentation/i2c/fault-codes defines 'EAGAIN' for arbitration lost.

> +		}
> +
>  		if (for_busy && (temp & I2SR_IBB))
>  			break;
>  		if (!for_busy && !(temp & I2SR_IBB))
> -- 
> 1.9.1
> 

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux