Lines Matching full:slave
26 #define SPI_SLAVE BIT(6) /* slave mode */
64 * This describes a SPI slave, a child device of the SPI bus. To obtain this
66 * dev_get_parent_platdata(slave->dev).
72 * @max_hz: Maximum bus speed that this slave can tolerate
82 * struct spi_slave - Representation of a SPI slave
85 * be accessed using dev_get_parent_priv() on the slave device. The SPI uclass
94 * @dev: SPI slave device
95 * @max_hz: Maximum speed for this slave
96 * @bus: ID of the bus that the slave is attached to. For
99 * @cs: ID of the chip select connected to the slave.
100 * @mode: SPI mode to use for this slave (see SPI mode flags)
141 * spi_do_alloc_slave - Allocate a new SPI slave (internal)
143 * Allocate and zero all fields in the spi slave, and set the bus/chip
146 * @offset: Offset of struct spi_slave within slave structure.
147 * @size: Size of slave structure.
148 * @bus: Bus ID of the slave chip.
149 * @cs: Chip select ID of the slave chip on the specified bus.
155 * spi_alloc_slave - Allocate a new SPI slave
157 * Allocate and zero all fields in the spi slave, and set the bus/chip
161 * This structure must contain a member 'struct spi_slave *slave'.
162 * @bus: Bus ID of the slave chip.
163 * @cs: Chip select ID of the slave chip on the specified bus.
166 spi_do_alloc_slave(offsetof(_struct, slave), \
170 * spi_alloc_slave_base - Allocate a new SPI slave with no private data
172 * Allocate and zero all fields in the spi slave, and set the bus/chip
175 * @bus: Bus ID of the slave chip.
176 * @cs: Chip select ID of the slave chip on the specified bus.
182 * Set up communications parameters for a SPI slave.
184 * This must be called once for each slave. Note that this function
189 * @bus: Bus ID of the slave chip.
190 * @cs: Chip select ID of the slave chip on the specified bus.
201 * Free any memory associated with a SPI slave.
203 * @slave: The SPI slave
205 void spi_free_slave(struct spi_slave *slave);
208 * Claim the bus and prepare it for communication with a given slave.
210 * This must be called before doing any transfers with a SPI slave. It
216 * @slave: The SPI slave
221 int spi_claim_bus(struct spi_slave *slave);
230 * @slave: The SPI slave
232 void spi_release_bus(struct spi_slave *slave);
239 * @slave: The SPI slave
244 int spi_set_wordlen(struct spi_slave *slave, unsigned int wordlen);
259 * @slave: The SPI slave which will be sending/receiving the data.
268 int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
276 * the second transaction as tx or rx based on the need from respective slave.
278 * @slave: The SPI slave device with which opcode/data will be exchanged
287 int spi_write_then_read(struct spi_slave *slave, const u8 *opcode,
310 * to the device identified by "slave".
312 void spi_cs_activate(struct spi_slave *slave);
319 * select to the device identified by "slave".
321 void spi_cs_deactivate(struct spi_slave *slave);
326 * @slave: The SPI slave
329 void spi_set_speed(struct spi_slave *slave, uint hz);
334 * @slave: The SPI slave we're communicating with
341 static inline int spi_w8r8(struct spi_slave *slave, unsigned char byte) in spi_w8r8() argument
350 ret = spi_xfer(slave, 16, dout, din, SPI_XFER_BEGIN | SPI_XFER_END); in spi_w8r8()
375 * The device provided is the slave device. It's parent controller
378 * This must be called before doing any transfers with a SPI slave. It
384 * @dev: The SPI slave
398 * @dev: The SPI slave
407 * @bus: The SPI slave
428 * @dev: The slave device to communicate with
489 * @dev: The SPI flash slave device
506 * works. Here the device is a slave.
515 * @slave: The SPI slave which will be sending/receiving the data.
525 int (*xfer)(struct udevice *slave, unsigned int bitlen,
530 * spi_find_bus_and_cs() - Find bus and slave devices by number
533 * device and slave device. Neither device is activated by this function,
539 * @devp: Return slave device
546 * spi_get_bus_and_cs() - Find and activate bus and slave devices by number
549 * device and slave device.
551 * If no such slave exists, and drv_name is not NULL, then a new slave device
554 * Ths new slave device is probed ready for use with the speed and mode
559 * @speed: SPI speed to use for this slave when not available in platdata
560 * @mode: SPI mode to use for this slave when not available in platdata
564 * @devp: Return slave device
572 * spi_chip_select() - Get the chip select for a slave
574 * @return the chip select this slave is attached to
576 int spi_chip_select(struct udevice *slave);
579 * spi_find_chip_select() - Find the slave attached to chip select
583 * @devp: Returns the slave device if found
592 * This decodes the speed and mode for a slave from a device tree node
618 * sandbox_spi_get_emul() - get an emulator for a SPI slave
621 * slave, so that xfer() operations on the slave will be handled by the
627 * @slave: SPI slave device requesting the emulator
632 struct udevice *bus, struct udevice *slave,
636 * Claim the bus and prepare it for communication with a given slave.
638 * This must be called before doing any transfers with a SPI slave. It
644 * @dev: The SPI slave device
658 * @slave: The SPI slave device
675 * @dev: The SPI slave device which will be sending/receiving the data.
690 * @dev: SPI slave device to check