public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Ravikumar Kattekola <rk@ti.com>
Cc: tony@atomide.com, linux-omap@vger.kernel.org,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC 1/1] drivers: i2c: omap: Add slave support
Date: Thu, 25 Aug 2016 19:14:30 +0200	[thread overview]
Message-ID: <20160825171430.GM2856@katana> (raw)
In-Reply-To: <20160525141119.14486-2-rk@ti.com>

[-- Attachment #1: Type: text/plain, Size: 1235 bytes --]

Hi,

> The omap i2c controller (at least on dra7x devices)
> doesn't have  start/stop (STT/STP) support for slave mode
> so event  #5 is not implemented in the driver.

I think you can deduce that. If a new {READ|WRITE}_REQUESTED slave event
comes in when you had *_PROCESSED events before, there must have been a
STOP on the bus inbetween.

> +		if (stat & OMAP_I2C_STAT_XRDY) {
> +			i2c_slave_event(omap->slave, I2C_SLAVE_READ_REQUESTED,
> +					&value);
> +			omap_i2c_write_reg(omap, OMAP_I2C_DATA_REG, value);
> +			i2c_slave_event(omap->slave, I2C_SLAVE_READ_PROCESSED,
> +					&value);

This looks fishy. READ_REQUESTED is only sent after the address phase.
Have you read the documentation (Documentation/i2c/slave-interface)?
Please say if it was unclear.

> +	/* As of now, We dont need all interrupts be enabled */
> +	omap->iestate = OMAP_I2C_IE_AAS | OMAP_I2C_IE_XRDY | OMAP_I2C_IE_RRDY;

This looks even more fishy. Are you disabling the master interrupts?
That's a no (unless there are HW constraints). Your driver should be
able to switch between master and slave depending on what happens on the
bus.

For more guidance, here is my talk at ELCE 2015:
https://www.youtube.com/watch?v=JdQ21jlwb58

Regards,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-08-25 17:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25 14:11 [RFC 0/1] i2c: omap: Add support for switching to slave mode Ravikumar Kattekola
2016-05-25 14:11 ` [RFC 1/1] drivers: i2c: omap: Add slave support Ravikumar Kattekola
2016-05-26 16:07   ` Manish Badarkhe
2016-08-25 17:14   ` Wolfram Sang [this message]
2016-08-27 13:59     ` Matthijs van Duin
2016-08-27 17:22       ` Wolfram Sang
2016-08-27 23:38         ` Matthijs van Duin
2016-08-28  5:35           ` Wolfram Sang
2016-08-29  3:43             ` Matthijs van Duin
2016-10-14  8:57               ` Ravikumar
2016-10-17  6:15                 ` Matthijs van Duin
2016-10-14  8:03       ` Ravikumar
2016-10-14  7:56     ` Ravikumar

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=20160825171430.GM2856@katana \
    --to=wsa@the-dreams.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rk@ti.com \
    --cc=tony@atomide.com \
    /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