linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Haibo Chen <haibo.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	B38611-KZfg59tc24xl57MIdRCFDg@public.gmane.org
Subject: Re: [PATCH] i2c: imx: Add arbitration lost check
Date: Tue, 2 Sep 2014 12:43:24 +0200	[thread overview]
Message-ID: <20140902104323.GD1266@katana> (raw)
In-Reply-To: <1409561920-9939-1-git-send-email-haibo.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

> --- 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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      parent reply	other threads:[~2014-09-02 10:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01  8:58 [PATCH] i2c: imx: Add arbitration lost check Haibo Chen
     [not found] ` <1409561920-9939-1-git-send-email-haibo.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-09-02  2:53   ` fugang.duan-KZfg59tc24xl57MIdRCFDg
2014-09-02 10:43   ` Wolfram Sang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140902104323.GD1266@katana \
    --to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
    --cc=B38611-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=haibo.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).