From: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
To: Darius <augulis.darius-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH V9] I2C driver for IMX
Date: Thu, 17 Jul 2008 16:22:36 +0100 [thread overview]
Message-ID: <20080717152236.GN30539@fluff.org.uk> (raw)
In-Reply-To: <g5kgl6$sva$1@ger.gmane.org>
On Wed, Jul 16, 2008 at 12:50:51PM +0300, Darius wrote:
> 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?
This is the best plan, merging across trees is difficult.
> >> + /* 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.
I think calling schedule() here (or similar) is a better use of the
cpu cycles, simply sitting and spinning isn't doing anybody much good.
> >> +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.
yep.
if you can post a new version in the next day or so
I will try and put it in my next pull request.
--
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
prev parent reply other threads:[~2008-07-17 15:22 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
2008-07-17 15:22 ` Ben Dooks [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=20080717152236.GN30539@fluff.org.uk \
--to=ben-linux-elnmno+kys3ytjvyw6ydsg@public.gmane.org \
--cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.