Lines Matching refs:to
7 functionality. For that to work, one needs slave support in the bus driver plus
35 is that i2c slave backends have their own address space. So, you have to add
36 0x1000 to the address you would originally request. An example for
42 Each backend should come with separate documentation to describe its specific
57 The bus driver sends an event to the backend using the following function:
62 types described hereafter. 'val' holds an u8 value for the data byte to be
63 read/written and is thus bidirectional. The pointer to val must always be
75 Another I2C master wants to write data to us. This event should be sent once
77 there is nothing to process or return. Wakeup or initialization probably needs
78 to be done, though.
82 'val': backend returns first byte to be sent
85 Another I2C master wants to read data from us. This event should be sent once
94 Another I2C master has sent a byte to us which needs to be set in 'val'. If 'ret'
100 'val': backend returns next byte to be sent
103 The bus driver requests the next byte to be sent to another I2C master in
105 only means that the previous byte is shifted out to the bus! To ensure seamless
109 needs to be sent again on the next I2C_SLAVE_READ_REQUEST, depending a bit on
118 reset its state machine for I2C transfers to be able to receive new requests.
124 If you want to write a software backend:
137 If you want to add slave support to the bus driver:
139 * implement calls to register/unregister the slave and add those to the
140 struct i2c_algorithm. When registering, you probably need to set the i2c
142 should use pm_runtime_forbid() because your device usually needs to be powered
143 on always to be able to detect its slave address. When unregistering, do the
146 * Catch the slave interrupts and send appropriate i2c_slave_events to the backend.
154 It is good behaviour to always ACK the address phase, so the master knows if a
155 device is basically present or if it mysteriously disappeared. Using NACK to
156 state being busy is troublesome. SMBus demands to always ACK the address phase,
159 to NACK them. For those reasons, this API does not support NACK in the address
162 Currently, there is no slave event to report if the master did ACK or NACK a
165 to send STOP after that and we have an event for that. Also, keep in mind not
166 all I2C controllers have the possibility to report that event.
174 this time of writing. Some points to keep in mind when using buffers:
176 * Buffers should be opt-in and slave drivers will always have to support
185 means additional code to handle this exception. Such code tends to be