Lines Matching +full:slave +full:- +full:kernel

2 Linux I2C slave interface description
5 by Wolfram Sang <wsa@sang-engineering.com> in 2014-15
7 Linux can also be an I2C slave if the I2C controller in use has slave
8 functionality. For that to work, one needs slave support in the bus driver plus
10 example for the latter is the slave-eeprom driver, which acts as a dual memory
12 EEPROM, the Linux I2C slave can access the content via sysfs and handle data as
16 use a character device, be in-kernel only, or something completely different::
19 e.g. sysfs I2C slave events I/O registers
20 +-----------+ v +---------+ v +--------+ v +------------+
21 | Userspace +........+ Backend +-----------+ Driver +-----+ Controller |
22 +-----------+ +---------+ +--------+ +------------+
24 ----------------------------------------------------------------+-- I2C
25 --------------------------------------------------------------+---- Bus
34 I2C slave backends behave like standard I2C clients. So, you can instantiate
35 them as described in the document instantiating-devices.rst. The only
36 difference is that i2c slave backends have their own address space. So, you
38 instantiating the slave-eeprom driver from userspace at the 7 bit address 0x64
41 # echo slave-24c02 0x1064 > /sys/bus/i2c/devices/i2c-1/new_device
55 I2C slave events
56 ----------------
62 'client' describes the I2C slave device. 'event' is one of the special event
131 -----------------
136 * write the slave_callback which handles the above slave events
140 Check the i2c-slave-eeprom driver as an example.
144 ------------------
146 If you want to add slave support to the bus driver:
148 * implement calls to register/unregister the slave and add those to the
150 slave address and enable slave specific interrupts. If you use runtime pm, you
152 powered on always to be able to detect its slave address. When unregistering,
155 * Catch the slave interrupts and send appropriate i2c_slave_events to the backend.
157 Note that most hardware supports being master _and_ slave on the same bus. So,
159 well. In almost all cases, slave support does not need to disable the master
162 Check the i2c-rcar driver as an example.
166 --------------
172 automatically ACK when detecting their slave addresses, so there is no option
176 Currently, there is no slave event to report if the master did ACK or NACK a
184 -------------
190 * Buffers should be opt-in and backend drivers will always have to support
191 byte-based transactions as the ultimate fallback anyhow because this is how
201 error-prone.