Lines Matching +full:controller +full:- +full:data

1 /* SPDX-License-Identifier: GPL-2.0+ */
59 * enum spi_mem_data_dir - describes the direction of a SPI memory data
60 * transfer from the controller perspective
61 * @SPI_MEM_NO_DATA: no data transferred
62 * @SPI_MEM_DATA_IN: data coming from the SPI memory
63 * @SPI_MEM_DATA_OUT: data sent to the SPI memory
72 * struct spi_mem_op - describes a SPI memory operation
74 * sent MSB-first.
90 * @data.buswidth: number of IO lanes used to send/receive the data
91 * @data.dtr: whether the data should be sent in DTR mode or not
92 * @data.ecc: whether error correction is required or not
93 * @data.dir: direction of the transfer
94 * @data.nbytes: number of data bytes to send/receive. Can be zero if the
95 * operation does not involve transferring data
96 * @data.buf.in: input buffer (must be DMA-able)
97 * @data.buf.out: output buffer (must be DMA-able)
134 } data; member
142 .data = __data, \
146 * struct spi_mem_dirmap_info - Direct mapping information
152 * These information are used by the controller specific implementation to know
156 * direction is directly encoded in the ->op_tmpl.data.dir field.
165 * struct spi_mem_dirmap_desc - Direct mapping descriptor
168 * @nodirmap: set to 1 if the SPI controller does not implement
169 * ->mem_ops->dirmap_create() or when this function returned an
173 * no matter whether the controller supports direct mapping or not
174 * @priv: field pointing to controller specific data
177 * spi_mem_dirmap_create() and controller implementation of ->create_dirmap()
178 * can create/attach direct mapping resources to the descriptor in the ->priv
189 * struct spi_mem - describes a SPI memory device
191 * @drvpriv: spi_mem_driver private data
195 * the controller to properly handle this device should be placed here.
197 * One example would be the device size since some controller expose their SPI
198 * mem devices through a io-mapped region.
207 * struct spi_mem_set_drvdata() - attach driver private data to a SPI mem
210 * @data: data to attach to the memory device
212 static inline void spi_mem_set_drvdata(struct spi_mem *mem, void *data) in spi_mem_set_drvdata() argument
214 mem->drvpriv = data; in spi_mem_set_drvdata()
218 * struct spi_mem_get_drvdata() - get driver private data attached to a SPI mem
222 * Return: the data attached to the mem device.
226 return mem->drvpriv; in spi_mem_get_drvdata()
230 * struct spi_controller_mem_ops - SPI memory operations
231 * @adjust_op_size: shrink the data xfer of an operation to match controller's
234 * @supports_op: check if an operation is supported by the controller
236 * not all driver provides supports_op(), so it can return -EOPNOTSUPP
237 * if the op is not supported by the driver/controller
238 * @get_name: get a custom name for the SPI mem device from the controller.
239 * This might be needed if the controller driver has been ported
244 * have a ->free_name() function.
248 * ->dirmap_create()
249 * @dirmap_read: read data from the memory device using the direct mapping
250 * created by ->dirmap_create(). The function can return less
251 * data than requested (for example when the request is crossing
255 * @dirmap_write: write data to the memory device using the direct mapping
256 * created by ->dirmap_create(). The function can return less
257 * data than requested (for example when the request is crossing
262 * when the timeout has expired. It fills the data buffer with
266 * high-level interface to execute SPI memory operation, which is usually the
269 * Note on ->dirmap_{read,write}(): drivers should avoid accessing the direct
271 * SPI mem transaction to finish, and this will make real-time maintainers
297 * struct spi_controller_mem_caps - SPI memory controller capabilities
307 ((ctlr)->mem_caps && (ctlr)->mem_caps->cap)
310 * struct spi_mem_driver - SPI memory driver
349 return -ENOTSUPP; in spi_controller_dma_map_mem_op_data()