All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: linux-i2c@vger.kernel.org, SH-Linux <linux-sh@vger.kernel.org>
Subject: rcar-i2c: always reads a byte
Date: Tue, 11 Mar 2014 16:15:02 +0000	[thread overview]
Message-ID: <531F3686.7050808@codethink.co.uk> (raw)

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

             reply	other threads:[~2014-03-11 16:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11 16:15 Ben Dooks [this message]
2014-03-11 16:40 ` rcar-i2c: always reads a byte Wolfram Sang
2014-03-11 16:40   ` Wolfram Sang
2014-03-11 16:41   ` Ben Dooks
2014-03-11 16:47     ` Wolfram Sang
2014-03-11 16:47       ` Wolfram Sang
2014-03-11 17:10     ` Ben Dooks
2014-05-05 15:51       ` Wolfram Sang
2014-05-05 15:51         ` Wolfram Sang
2014-03-11 17:24   ` Wolfram Sang
2014-03-11 17:24     ` Wolfram Sang
2014-03-11 17:31     ` Ben Dooks
2014-03-11 17:46       ` Wolfram Sang
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:27     ` Michael Lawnick
2014-03-12  8:39     ` Paul Carpenter
2014-03-12  9:00       ` Michael Lawnick
2014-03-12  9:00         ` Michael Lawnick
     [not found]     ` <53201A83.7040605-Mmb7MZpHnFY@public.gmane.org>
2014-05-05 13:21       ` Wolfram Sang
2014-05-05 13:21         ` Wolfram Sang

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=531F3686.7050808@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-sh@vger.kernel.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.