public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Darius <augulis.darius-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH V9] I2C driver for IMX
Date: Wed, 16 Jul 2008 12:50:51 +0300	[thread overview]
Message-ID: <g5kgl6$sva$1@ger.gmane.org> (raw)
In-Reply-To: <20080715163734.GK30539-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>

Ben Dooks wrote:

> 
> I'll need a reasonable header/description in place of the
> changelog before this can be merged.

I'll send it with patch final release, ok?

> 
> I'm not going to step on RMK's toes unless he gives me explicit
> acknowledgement to merge arch/arm/mach-imx/mx1ads.c 

I can split this patch into two separate patches: one with I2C driver only, second with MX1ADS support for this driver only.
Should I do so?

>> +	/* wait for bus not busy */
>> +	for (i = 0; i < I2C_IMX_TIME_BUSY; i++) {
>> +		if (!(readb(i2c_imx->base + IMX_I2C_I2SR) & (I2SR_IBB | I2SR_IAL)))
>> +			return 0;
>> +		udelay(1);
>> +	}
>> +	dev_dbg(&i2c_imx->adapter.dev, "<%s> I2C bus is busy!\n", __func__);
>> +	return -EBUSY;
>> +}
> 
> out of interest, do you really want to be busy-looping here and
> not allowing the task to sleep?

Really not. I see that i2c-mpc driver handles this bit different.
Maybe it's a good idea to make the same in i2c-imx driver, because I2C controller itself is the same in MPC and in IMX.


>> +static int i2c_imx_acked(struct imx_i2c_struct *i2c_imx)
>> +{
>> +	unsigned int i = 0;
>> +
>> +	for (i = 0; i < I2C_IMX_TIME_ACK; i++) {
>> +		if (!(readb(i2c_imx->base + IMX_I2C_I2SR) & I2SR_RXAK)) {
>> +			dev_dbg(&i2c_imx->adapter.dev,
>> +				"<%s> ACK received\n", __func__);
>> +			return 0;
>> +		}
>> +		udelay(1);
>> +	}
>> +	dev_dbg(&i2c_imx->adapter.dev, "<%s> No ACK!\n", __func__);
>> +	return -EIO;   /* No ACK */
>> +}

btw, with this function is similar situation like in previous one.
I'll change it in the same way.


> My only comments are:
> 
> 1) over-use of () where they are not needed
> 2) you need to insert spaces in expressions.

already fixed.


_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  parent reply	other threads:[~2008-07-16  9:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-11  6:29 [PATCH V9] I2C driver for IMX Darius
2008-07-15 11:52 ` Jean Delvare
     [not found]   ` <20080715135231.491c41bb-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-07-15 16:38     ` Ben Dooks
2008-07-15 16:37 ` Ben Dooks
     [not found]   ` <20080715163734.GK30539-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-07-16  9:50     ` Darius [this message]
2008-07-17 15:22       ` Ben Dooks

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='g5kgl6$sva$1@ger.gmane.org' \
    --to=augulis.darius-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@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