Lines Matching +full:on +full:- +full:chip

2  * Common SPI Interface: Controller-specific definitions
7 * SPDX-License-Identifier: GPL-2.0+
23 #define SPI_LSB_FIRST BIT(3) /* per-word bits-on-wire */
44 * struct dm_spi_bus - SPI bus info
62 * struct dm_spi_platdata - platform data for all SPI slaves
66 * dev_get_parent_platdata(slave->dev).
71 * @cs: Chip select number (0..n-1)
82 * struct spi_slave - Representation of a SPI slave
84 * For driver model this is the per-child data used by the SPI bus. It can
85 * be accessed using dev_get_parent_priv() on the slave device. The SPI uclass
92 * controller-specific data.
98 * bus (bus->seq) so does not need to be stored
99 * @cs: ID of the chip select connected to the slave.
102 * @max_read_size: If non-zero, the maximum number of bytes which can
104 * @max_write_size: If non-zero, the maximum number of bytes which can
106 * @memory_map: Address of read-only SPI flash access.
111 struct udevice *dev; /* struct spi_slave is dev->parentdata */
134 * Initialization, must be called once on start up.
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
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
162 * @bus: Bus ID of the slave chip.
163 * @cs: Chip select ID of the slave chip on the specified bus.
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.
189 * @bus: Bus ID of the slave chip.
190 * @cs: Chip select ID of the slave chip on the specified bus.
242 * Returns: 0 on success, -1 on failure.
266 * Returns: 0 on success, not 0 on failure
272 * spi_write_then_read - SPI synchronous write followed by read
275 * is to send the opcode and if the length of buf is non-zero then it start
276 * the second transaction as tx or rx based on the need from respective slave.
285 * Returns: 0 on success, not 0 on failure
296 * This function is provided by the board if the low-level SPI driver
299 * Returns: 1 if bus:cs identifies a valid chip on this board, 0
309 * common/soft_spi.c). When called, it should activate the chip select
318 * common/soft_spi.c). When called, it should deactivate the chip
337 * Returns: The value that was read, or a negative value on error.
357 * struct spi_cs_info - Information about a bus chip select
366 * struct struct dm_spi_ops - Driver model SPI operations
410 * Returns: 0 on success, -ve on failure.
435 * Returns: 0 on success, not -1 on failure
441 * Optimized handlers for SPI memory-like operations.
454 * @return 0 if OK, -ve on error
466 * @return 0 if OK, -ve on error
471 * Get information on a chip select
474 * chip select, i.e. it has no attached device. It gives the driver
475 * a chance to allow activity on that chip select even so.
478 * @cs: The chip select (0..n-1)
479 * @info: Returns information about the chip select, if valid.
480 * On entry info->dev is NULL
481 * @return 0 if OK (and @info is set up), -ENODEV if the chip select
482 * is invalid, other -ve value on error
487 * get_mmap() - Get memory-mapped SPI
494 * @return 0 if OK, -EFAULT if memory mapping is not available
523 * Returns: 0 on success, not -1 on failure
530 * spi_find_bus_and_cs() - Find bus and slave devices by number
532 * Given a bus number and chip select, this finds the corresponding bus
537 * @cs: Chip select to look for
540 * @return 0 if found, -ENODEV on error
546 * spi_get_bus_and_cs() - Find and activate bus and slave devices by number
548 * Given a bus number and chip select, this finds the corresponding bus
552 * is automatically bound on this chip select with requested speed and mode.
558 * @cs: Chip select to look for
561 * @drv_name: Name of driver to attach to this chip select
565 * @return 0 if found, -ve on error
572 * spi_chip_select() - Get the chip select for a slave
574 * @return the chip select this slave is attached to
579 * spi_find_chip_select() - Find the slave attached to chip select
582 * @cs: Chip select to look for
584 * @return 0 if found, -EINVAL if cs is invalid, -ENODEV if no device attached,
585 * other -ve value on error
590 * spi_slave_ofdata_to_platdata() - decode standard SPI platform data
602 * spi_cs_info() - Check information on a chip select
604 * This checks a particular chip select on a bus to see if it has a device
608 * @cs: The chip select (0..n-1)
609 * @info: Returns information about the chip select, if valid
610 * @return 0 if OK (and @info is set up), -ENODEV if the chip select
611 * is invalid, other -ve value on error
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
622 * emulator. If a emulator already exists on that chip select it is returned.
629 * @return 0 if OK, -ve on error
682 * Returns: 0 on success, not 0 on failure
688 * spi_get_mmap() - Get memory-mapped SPI
695 * @return 0 if OK, -ENOSYS if no operation, -EFAULT if memory mapping is not
702 #define spi_get_ops(dev) ((struct dm_spi_ops *)(dev)->driver->ops)
703 #define spi_emul_get_ops(dev) ((struct dm_spi_emul_ops *)(dev)->driver->ops)