Re: [PATCH v2 2/4] Documentation: i2c: describe the new slave mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx> 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: signature.asc
Description: Digital signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux