linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rcar-i2c: always reads a byte
@ 2014-03-11 16:15 Ben Dooks
  2014-03-11 16:40 ` Wolfram Sang
       [not found] ` <531F3686.7050808-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
  0 siblings, 2 replies; 13+ messages in thread
From: Ben Dooks @ 2014-03-11 16:15 UTC (permalink / raw)
  To: linux-i2c, SH-Linux

I have noticed the following behaviour with the i2c-rcar driver
with the following single i2c_msg structure:

	msg[0].addr = 0x12;
	msg[0].flags = I2C_M_RD;
	msg[0].len = 0;
	msg[0].buf = data;

The system issues an address transaction followed by a single byte
read.

I have tried changing the code to not ack the read after the address
interrupt, however this causes the i2c block to hang forever.

i2c_recv_irq():

	if (priv->pos + 1 >= msg->len) {
		rcar_i2c_bus_phase(priv, RCAR_BUS_PHASE_STOP);
		if (msg->len != 0)
			rcar_i2c_status_bit_clear(priv, MAT | MDR);
		else
			rcar_i2c_status_bit_clear(priv, MAT);
	} else {
		rcar_i2c_bus_phase(priv, RCAR_BUS_PHASE_DATA);
		rcar_i2c_recv_restart(priv);
	}

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-05-05 15:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-11 16:15 rcar-i2c: always reads a byte Ben Dooks
2014-03-11 16:40 ` Wolfram Sang
2014-03-11 16:41   ` Ben Dooks
2014-03-11 16:47     ` Wolfram Sang
2014-03-11 17:10     ` Ben Dooks
2014-05-05 15:51       ` Wolfram Sang
2014-03-11 17:24   ` Wolfram Sang
2014-03-11 17:31     ` Ben Dooks
2014-03-11 17:46       ` Wolfram Sang
     [not found] ` <531F3686.7050808-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
2014-03-12  8:27   ` Michael Lawnick
2014-03-12  8:39     ` Paul Carpenter
2014-03-12  9:00       ` Michael Lawnick
     [not found]     ` <53201A83.7040605-Mmb7MZpHnFY@public.gmane.org>
2014-05-05 13:21       ` Wolfram Sang

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).