Lines Matching +full:data +full:- +full:bits
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).
52 * This data is immuatable. Each time the device is probed, @max_hz and @mode
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
73 * driver should not override it. Two platform data fields (max_hz and mode)
75 * them to be changed, since we should never change platform data in drivers.
78 * controller-specific data.
86 * bus (bus->seq) so does not need to be stored
89 * @wordlen: Size of SPI word in number of bits
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)
135 * spi_alloc_slave - Allocate a new SPI slave
150 * spi_alloc_slave_base - Allocate a new SPI slave with no private data
217 * Set the word length (number of bits per word) for SPI transactions.
220 * @wordlen: The number of bits in a word
222 * Returns: 0 on success, -1 on failure.
229 * This writes "bitlen" bits out the SPI MOSI port and simultaneously clocks
230 * "bitlen" bits in the SPI MISO port. That's just the way SPI works.
232 * The source of the outgoing bits is the "dout" parameter and the
233 * destination of the input bits is the "din" parameter. Note that "dout"
235 * input data overwrites the output data (since both are buffered by
239 * @slave: The SPI slave which will be sending/receiving the data.
240 * @bitlen: How many bits to write and read.
241 * @dout: Pointer to a string of bits to send out. The bits are
243 * @din: Pointer to a string of bits that will be filled in.
251 /* Copy memory mapped data */
252 void spi_flash_copy_mmap(void *data, void *offset, size_t len);
256 * This function is provided by the board if the low-level SPI driver
293 * Write 8 bits, then read 8 bits.
317 * struct spi_cs_info - Information about a bus chip select
326 * struct struct dm_spi_ops - Driver model SPI operations
365 * Set the word length (number of bits per word) for SPI transactions.
368 * @wordlen: The number of bits in a word
370 * Returns: 0 on success, -ve on failure.
377 * This writes "bitlen" bits out the SPI MOSI port and simultaneously
378 * clocks "bitlen" bits in the SPI MISO port. That's just the way SPI
381 * The source of the outgoing bits is the "dout" parameter and the
382 * destination of the input bits is the "din" parameter. Note that
384 * case the input data overwrites the output data (since both are
389 * @bitlen: How many bits to write and read.
390 * @dout: Pointer to a string of bits to send out. The bits are
392 * @din: Pointer to a string of bits that will be filled in.
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
438 * @cs: The chip select (0..n-1)
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
454 * This writes "bitlen" bits out the SPI MOSI port and simultaneously
455 * clocks "bitlen" bits in the SPI MISO port. That's just the way SPI
458 * The source of the outgoing bits is the "dout" parameter and the
459 * destination of the input bits is the "din" parameter. Note that
461 * case the input data overwrites the output data (since both are
465 * @slave: The SPI slave which will be sending/receiving the data.
466 * @bitlen: How many bits to write and read.
467 * @dout: Pointer to a string of bits sent to the device. The
468 * bits are held in a byte array and are sent MSB first.
469 * @din: Pointer to a string of bits that will be sent back to
473 * Returns: 0 on success, not -1 on failure
480 * spi_find_bus_and_cs() - Find bus and slave devices by number
490 * @return 0 if found, -ENODEV on error
496 * spi_get_bus_and_cs() - Find and activate bus and slave devices by number
514 * @return 0 if found, -ve on error
521 * spi_chip_select() - Get the chip select for a slave
528 * spi_find_chip_select() - Find the slave attached to chip select
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
556 * @cs: The chip select (0..n-1)
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
577 * @return 0 if OK, -ve on error
613 * This writes "bitlen" bits out the SPI MOSI port and simultaneously clocks
614 * "bitlen" bits in the SPI MISO port. That's just the way SPI works.
616 * The source of the outgoing bits is the "dout" parameter and the
617 * destination of the input bits is the "din" parameter. Note that "dout"
619 * input data overwrites the output data (since both are buffered by
623 * @dev: The SPI slave device which will be sending/receiving the data.
624 * @bitlen: How many bits to write and read.
625 * @dout: Pointer to a string of bits to send out. The bits are
627 * @din: Pointer to a string of bits that will be filled in.
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)