Message ID | 1253620242-18461-1-git-send-email-Joakim.Tjernlund@transmode.se (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Grant Likely |
Headers | show |
Joakim Tjernlund wrote: > The driver always ends a read with a STOP condition which > breaks subsequent I2C reads/writes in the same transaction as > these expect to do a repeated START(ReSTART). > > This will also help I2C multimaster as the bus will not be released > after the first read, but when the whole transaction ends. > > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Tested-by: Wolfgang Grandegger <wg@grandegger.com> on a MPC8548 board with an up-to-date kernel. I did not realize any problems. Wolfgang.
Jean, I just noticed you pull request for i2c on LKML but I didn't see this patch nor have I got any feedback from you. What is your view? Jocke Wolfgang Grandegger <wg@grandegger.com> wrote on 25/09/2009 12:01:17: > > Joakim Tjernlund wrote: > > The driver always ends a read with a STOP condition which > > breaks subsequent I2C reads/writes in the same transaction as > > these expect to do a repeated START(ReSTART). > > > > This will also help I2C multimaster as the bus will not be released > > after the first read, but when the whole transaction ends. > > > > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> > Tested-by: Wolfgang Grandegger <wg@grandegger.com> > > on a MPC8548 board with an up-to-date kernel. I did not realize any > problems. > > Wolfgang. >
On Mon, 28 Sep 2009 00:26:54 +0200, Joakim Tjernlund wrote: > Jean, I just noticed you pull request for i2c on LKML but I didn't see this > patch nor have I got any feedback from you. What is your view? My view is that i2c-mpc is nor under my jurisdiction, so I did not, and will not, pay any attention to it.
Jean Delvare <khali@linux-fr.org> wrote on 28/09/2009 09:28:09: > > On Mon, 28 Sep 2009 00:26:54 +0200, Joakim Tjernlund wrote: > > Jean, I just noticed you pull request for i2c on LKML but I didn't see this > > patch nor have I got any feedback from you. What is your view? > > My view is that i2c-mpc is nor under my jurisdiction, so I did not, and > will not, pay any attention to it. Ah, that explains it. Who then will look after i2c-mpc? Kumar?
>>>>> "Joakim" == Joakim Tjernlund <joakim.tjernlund@transmode.se> writes:
Hi,
Joakim> Ah, that explains it. Who then will look after i2c-mpc? Kumar?
Ben Dooks (embedded i2c maintainer). He's afaik coming home today, so
give him a few days to catch up on mails.
On Mon, 28 Sep 2009 09:30:32 +0200, Joakim Tjernlund wrote: > Jean Delvare <khali@linux-fr.org> wrote on 28/09/2009 09:28:09: > > > > On Mon, 28 Sep 2009 00:26:54 +0200, Joakim Tjernlund wrote: > > > Jean, I just noticed you pull request for i2c on LKML but I didn't see this > > > patch nor have I got any feedback from you. What is your view? > > > > My view is that i2c-mpc is nor under my jurisdiction, so I did not, and > > will not, pay any attention to it. > > Ah, that explains it. Who then will look after i2c-mpc? Kumar? What does MAINTAINERS say?
Jean Delvare <khali@linux-fr.org> wrote on 28/09/2009 09:34:34: > > On Mon, 28 Sep 2009 09:30:32 +0200, Joakim Tjernlund wrote: > > Jean Delvare <khali@linux-fr.org> wrote on 28/09/2009 09:28:09: > > > > > > On Mon, 28 Sep 2009 00:26:54 +0200, Joakim Tjernlund wrote: > > > > Jean, I just noticed you pull request for i2c on LKML but I didn't see this > > > > patch nor have I got any feedback from you. What is your view? > > > > > > My view is that i2c-mpc is nor under my jurisdiction, so I did not, and > > > will not, pay any attention to it. > > > > Ah, that explains it. Who then will look after i2c-mpc? Kumar? > > What does MAINTAINERS say? I did a grep for i2c-mpc and nothing turned up. Now that someone mentioned Ben Dooks I found it.
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index cdb1858..88ae582 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c @@ -369,9 +369,6 @@ static int mpc_write(struct mpc_i2c *i2c, int target, unsigned timeout = i2c->adap.timeout; u32 flags = restart ? CCR_RSTA : 0; - /* Start with MEN */ - if (!restart) - writeccr(i2c, CCR_MEN); /* Start as master */ writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_MTX | flags); /* Write target byte */ @@ -400,9 +397,6 @@ static int mpc_read(struct mpc_i2c *i2c, int target, int i, result; u32 flags = restart ? CCR_RSTA : 0; - /* Start with MEN */ - if (!restart) - writeccr(i2c, CCR_MEN); /* Switch to read - restart */ writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_MTX | flags); /* Write target address byte - this time with the read flag set */ @@ -429,9 +423,9 @@ static int mpc_read(struct mpc_i2c *i2c, int target, /* Generate txack on next to last byte */ if (i == length - 2) writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_TXAK); - /* Generate stop on last byte */ + /* Do not generate stop on last byte */ if (i == length - 1) - writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_TXAK); + writeccr(i2c, CCR_MIEN | CCR_MEN | CCR_MSTA | CCR_MTX); data[i] = readb(i2c->base + MPC_I2C_DR); }