All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Linux I2C" <linux-i2c@vger.kernel.org>,
	"Linux-sh list" <linux-sh@vger.kernel.org>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	"Simon Horman" <horms@verge.net.au>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH v2 2/4] Documentation: i2c: describe the new slave mode
Date: Thu, 2 Apr 2015 05:38:19 +0200	[thread overview]
Message-ID: <20150402033815.GA1429@katana> (raw)
In-Reply-To: <CAMuHMdVVLVXmbtan1rKtDrSrJ_nKO_K5Xx4jAjcb5ow_ChDVhg@mail.gmail.com>

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

On Wed, Apr 01, 2015 at 02:17:47PM +0200, Geert Uytterhoeven wrote:
> Hi Wolfram,
> 
> On Mon, Mar 23, 2015 at 9:26 AM, Wolfram Sang <wsa@the-dreams.de> wrote:
> > --- /dev/null
> > +++ b/Documentation/i2c/slave-interface
> 
> > +I2C slave events
> > +----------------
> > +
> > +The bus driver sends an event to the backend using the following function:
> > +
> > +       ret = i2c_slave_event(client, event, &val)
> > +
> > +'client' describes the i2c slave device. 'event' is one of the special event
> > +types described hereafter. 'val' holds an u8 value for the data byte to be
> > +read/written and is thus bidirectional. The pointer to val must always be
> > +provided even if val is not used for an event, i.e. don't use NULL here. 'ret'
> > +is the return value from the backend. Mandatory events must be provided by the
> > +bus drivers and must be checked for by backend drivers.
> > +
> > +Event types:
> > +
> > +* I2C_SLAVE_WRITE_REQUESTED (mandatory)
> > +
> > +'val': unused
> > +'ret': always 0
> > +
> > +Another I2C master wants to write data to us. This event should be sent once
> > +our own address and the write bit was detected. The data did not arrive yet, so
> > +there is nothing to process or return. Wakeup or initialization probably needs
> > +to be done, though.
> > +
> > +* I2C_SLAVE_READ_REQUESTED (mandatory)
> 
> I'm wondering whether these should be called I2C_SLAVE_READ_FIRST...

I considered that but decided against it. The difference to WRITE was
one reason. I think there was another I found when implementing the
update, but that one I can't recall right now :(


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

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa@the-dreams.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Linux I2C" <linux-i2c@vger.kernel.org>,
	"Linux-sh list" <linux-sh@vger.kernel.org>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	"Simon Horman" <horms@verge.net.au>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH v2 2/4] Documentation: i2c: describe the new slave mode
Date: Thu, 02 Apr 2015 03:38:19 +0000	[thread overview]
Message-ID: <20150402033815.GA1429@katana> (raw)
In-Reply-To: <CAMuHMdVVLVXmbtan1rKtDrSrJ_nKO_K5Xx4jAjcb5ow_ChDVhg@mail.gmail.com>

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

On Wed, Apr 01, 2015 at 02:17:47PM +0200, Geert Uytterhoeven wrote:
> Hi Wolfram,
> 
> On Mon, Mar 23, 2015 at 9:26 AM, Wolfram Sang <wsa@the-dreams.de> wrote:
> > --- /dev/null
> > +++ b/Documentation/i2c/slave-interface
> 
> > +I2C slave events
> > +----------------
> > +
> > +The bus driver sends an event to the backend using the following function:
> > +
> > +       ret = i2c_slave_event(client, event, &val)
> > +
> > +'client' describes the i2c slave device. 'event' is one of the special event
> > +types described hereafter. 'val' holds an u8 value for the data byte to be
> > +read/written and is thus bidirectional. The pointer to val must always be
> > +provided even if val is not used for an event, i.e. don't use NULL here. 'ret'
> > +is the return value from the backend. Mandatory events must be provided by the
> > +bus drivers and must be checked for by backend drivers.
> > +
> > +Event types:
> > +
> > +* I2C_SLAVE_WRITE_REQUESTED (mandatory)
> > +
> > +'val': unused
> > +'ret': always 0
> > +
> > +Another I2C master wants to write data to us. This event should be sent once
> > +our own address and the write bit was detected. The data did not arrive yet, so
> > +there is nothing to process or return. Wakeup or initialization probably needs
> > +to be done, though.
> > +
> > +* I2C_SLAVE_READ_REQUESTED (mandatory)
> 
> I'm wondering whether these should be called I2C_SLAVE_READ_FIRST...

I considered that but decided against it. The difference to WRITE was
one reason. I think there was another I found when implementing the
update, but that one I can't recall right now :(


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

  reply	other threads:[~2015-04-02  3:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23  8:26 [PATCH v2 0/4] i2c: slave: API updates Wolfram Sang
2015-03-23  8:26 ` Wolfram Sang
2015-03-23  8:26 ` [PATCH v2 1/4] i2c: slave: rework the slave API Wolfram Sang
2015-03-23  8:26   ` Wolfram Sang
     [not found] ` <1427099199-3628-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2015-03-23  8:26   ` [PATCH v2 2/4] Documentation: i2c: describe the new slave mode Wolfram Sang
2015-03-23  8:26     ` Wolfram Sang
     [not found]     ` <1427099199-3628-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2015-03-23  8:45       ` Uwe Kleine-König
2015-03-23  8:45         ` Uwe Kleine-König
     [not found]         ` <20150323084510.GL5664-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-03-23  9:04           ` Wolfram Sang
2015-03-23  9:04             ` Wolfram Sang
2015-04-01 12:17       ` Geert Uytterhoeven
2015-04-01 12:17         ` Geert Uytterhoeven
2015-04-02  3:38         ` Wolfram Sang [this message]
2015-04-02  3:38           ` Wolfram Sang
2015-03-23  8:26   ` [PATCH v2 3/4] i2c: slave: add documentation for i2c-slave-eeprom Wolfram Sang
2015-03-23  8:26     ` Wolfram Sang
2015-03-23  8:26   ` [PATCH v2 4/4] i2c: slave-eeprom: add more info when to increase the pointer Wolfram Sang
2015-03-23  8:26     ` Wolfram Sang
     [not found]     ` <1427099199-3628-5-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2015-03-23  8:32       ` Uwe Kleine-König
2015-03-23  8:32         ` Uwe Kleine-König
2015-03-27  8:55   ` [PATCH v2 0/4] i2c: slave: API updates Wolfram Sang
2015-03-27  8:55     ` 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=20150402033815.GA1429@katana \
    --to=wsa@the-dreams.de \
    --cc=geert@linux-m68k.org \
    --cc=horms@verge.net.au \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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.