Lines Matching +full:on +full:- +full:chip
1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Common SPI Interface: Controller-specific definitions
22 #define SPI_LSB_FIRST BIT(3) /* per-word bits-on-wire */
46 * struct dm_spi_platdata - platform data for all SPI slaves
50 * dev_get_parent_platdata(slave->dev).
55 * @cs: Chip select number (0..n-1)
68 * struct spi_slave - Representation of a SPI slave
70 * For driver model this is the per-child data used by the SPI bus. It can
71 * be accessed using dev_get_parent_priv() on the slave device. The SPI uclass
78 * controller-specific data.
86 * bus (bus->seq) so does not need to be stored
87 * @cs: ID of the chip select connected to the slave.
90 * @max_read_size: If non-zero, the maximum number of bytes which can
92 * @max_write_size: If non-zero, the maximum number of bytes which can
94 * @memory_map: Address of read-only SPI flash access.
99 struct udevice *dev; /* struct spi_slave is dev->parentdata */
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
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
142 * @bus: Bus ID of the slave chip.
143 * @cs: Chip select ID of the slave chip on the specified bus.
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.
169 * @bus: Bus ID of the slave chip.
170 * @cs: Chip select ID of the slave chip on the specified bus.
222 * Returns: 0 on success, -1 on failure.
246 * Returns: 0 on success, not 0 on failure
256 * This function is provided by the board if the low-level SPI driver
259 * Returns: 1 if bus:cs identifies a valid chip on this board, 0
269 * common/soft_spi.c). When called, it should activate the chip select
278 * common/soft_spi.c). When called, it should deactivate the chip
297 * Returns: The value that was read, or a negative value on error.
317 * struct spi_cs_info - Information about a bus chip select
326 * struct struct dm_spi_ops - Driver model SPI operations
370 * Returns: 0 on success, -ve on failure.
395 * Returns: 0 on success, not -1 on failure
401 * Optimized handlers for SPI memory-like operations.
414 * @return 0 if OK, -ve on error
426 * @return 0 if OK, -ve on error
431 * Get information on a chip select
434 * chip select, i.e. it has no attached device. It gives the driver
435 * a chance to allow activity on that chip select even so.
438 * @cs: The chip select (0..n-1)
439 * @info: Returns information about the chip select, if valid.
440 * On entry info->dev is NULL
441 * @return 0 if OK (and @info is set up), -ENODEV if the chip select
442 * is invalid, other -ve value on error
473 * Returns: 0 on success, not -1 on failure
480 * spi_find_bus_and_cs() - Find bus and slave devices by number
482 * Given a bus number and chip select, this finds the corresponding bus
487 * @cs: Chip select to look for
490 * @return 0 if found, -ENODEV on error
496 * spi_get_bus_and_cs() - Find and activate bus and slave devices by number
498 * Given a bus number and chip select, this finds the corresponding bus
502 * is automatically bound on this chip select.
507 * @cs: Chip select to look for
510 * @drv_name: Name of driver to attach to this chip select
514 * @return 0 if found, -ve on error
521 * spi_chip_select() - Get the chip select for a slave
523 * @return the chip select this slave is attached to
528 * spi_find_chip_select() - Find the slave attached to chip select
531 * @cs: Chip select to look for
533 * @return 0 if found, -ENODEV on error
538 * spi_slave_ofdata_to_platdata() - decode standard SPI platform data
550 * spi_cs_info() - Check information on a chip select
552 * This checks a particular chip select on a bus to see if it has a device
556 * @cs: The chip select (0..n-1)
557 * @info: Returns information about the chip select, if valid
558 * @return 0 if OK (and @info is set up), -ENODEV if the chip select
559 * is invalid, other -ve value on error
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
570 * emulator. If a emulator already exists on that chip select it is returned.
577 * @return 0 if OK, -ve on error
630 * Returns: 0 on success, not 0 on failure
636 #define spi_get_ops(dev) ((struct dm_spi_ops *)(dev)->driver->ops)
637 #define spi_emul_get_ops(dev) ((struct dm_spi_emul_ops *)(dev)->driver->ops)