Lines Matching full:slave
25 #define SPI_SLAVE BIT(6) /* slave mode */
48 * This describes a SPI slave, a child device of the SPI bus. To obtain this
50 * dev_get_parent_platdata(slave->dev).
56 * @max_hz: Maximum bus speed that this slave can tolerate
68 * struct spi_slave - Representation of a SPI slave
71 * be accessed using dev_get_parent_priv() on the slave device. The SPI uclass
80 * @dev: SPI slave device
81 * @max_hz: Maximum speed for this slave
84 * @bus: ID of the bus that the slave is attached to. For
87 * @cs: ID of the chip select connected to the slave.
88 * @mode: SPI mode to use for this slave (see SPI mode flags)
121 * spi_do_alloc_slave - Allocate a new SPI slave (internal)
123 * Allocate and zero all fields in the spi slave, and set the bus/chip
126 * @offset: Offset of struct spi_slave within slave structure.
127 * @size: Size of slave structure.
128 * @bus: Bus ID of the slave chip.
129 * @cs: Chip select ID of the slave chip on the specified bus.
135 * spi_alloc_slave - Allocate a new SPI slave
137 * Allocate and zero all fields in the spi slave, and set the bus/chip
141 * This structure must contain a member 'struct spi_slave *slave'.
142 * @bus: Bus ID of the slave chip.
143 * @cs: Chip select ID of the slave chip on the specified bus.
146 spi_do_alloc_slave(offsetof(_struct, slave), \
150 * spi_alloc_slave_base - Allocate a new SPI slave with no private data
152 * Allocate and zero all fields in the spi slave, and set the bus/chip
155 * @bus: Bus ID of the slave chip.
156 * @cs: Chip select ID of the slave chip on the specified bus.
162 * Set up communications parameters for a SPI slave.
164 * This must be called once for each slave. Note that this function
169 * @bus: Bus ID of the slave chip.
170 * @cs: Chip select ID of the slave chip on the specified bus.
181 * Free any memory associated with a SPI slave.
183 * @slave: The SPI slave
185 void spi_free_slave(struct spi_slave *slave);
188 * Claim the bus and prepare it for communication with a given slave.
190 * This must be called before doing any transfers with a SPI slave. It
196 * @slave: The SPI slave
201 int spi_claim_bus(struct spi_slave *slave);
210 * @slave: The SPI slave
212 void spi_release_bus(struct spi_slave *slave);
219 * @slave: The SPI slave
224 int spi_set_wordlen(struct spi_slave *slave, unsigned int wordlen);
239 * @slave: The SPI slave which will be sending/receiving the data.
248 int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
270 * to the device identified by "slave".
272 void spi_cs_activate(struct spi_slave *slave);
279 * select to the device identified by "slave".
281 void spi_cs_deactivate(struct spi_slave *slave);
286 * @slave: The SPI slave
289 void spi_set_speed(struct spi_slave *slave, uint hz);
294 * @slave: The SPI slave we're communicating with
301 static inline int spi_w8r8(struct spi_slave *slave, unsigned char byte) in spi_w8r8() argument
310 ret = spi_xfer(slave, 16, dout, din, SPI_XFER_BEGIN | SPI_XFER_END); in spi_w8r8()
335 * The device provided is the slave device. It's parent controller
338 * This must be called before doing any transfers with a SPI slave. It
344 * @dev: The SPI slave
358 * @dev: The SPI slave
367 * @bus: The SPI slave
388 * @dev: The slave device to communicate with
456 * works. Here the device is a slave.
465 * @slave: The SPI slave which will be sending/receiving the data.
475 int (*xfer)(struct udevice *slave, unsigned int bitlen,
480 * spi_find_bus_and_cs() - Find bus and slave devices by number
483 * device and slave device. Neither device is activated by this function,
489 * @devp: Return slave device
496 * spi_get_bus_and_cs() - Find and activate bus and slave devices by number
499 * device and slave device.
501 * If no such slave exists, and drv_name is not NULL, then a new slave device
504 * Ths new slave device is probed ready for use with the given speed and mode.
508 * @speed: SPI speed to use for this slave
509 * @mode: SPI mode to use for this slave
513 * @devp: Return slave device
521 * spi_chip_select() - Get the chip select for a slave
523 * @return the chip select this slave is attached to
525 int spi_chip_select(struct udevice *slave);
528 * spi_find_chip_select() - Find the slave attached to chip select
532 * @devp: Returns the slave device if found
540 * This decodes the speed and mode for a slave from a device tree node
566 * sandbox_spi_get_emul() - get an emulator for a SPI slave
569 * slave, so that xfer() operations on the slave will be handled by the
575 * @slave: SPI slave device requesting the emulator
580 struct udevice *bus, struct udevice *slave,
584 * Claim the bus and prepare it for communication with a given slave.
586 * This must be called before doing any transfers with a SPI slave. It
592 * @dev: The SPI slave device
606 * @slave: The SPI slave device
623 * @dev: The SPI slave device which will be sending/receiving the data.