Lines Matching +full:spi +full:- +full:device
1 /* SPDX-License-Identifier: GPL-2.0+ */
14 #include <linux/spi/spi.h>
59 * enum spi_mem_data_dir - describes the direction of a SPI memory data
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.
95 * @data.buf.in: input buffer (must be DMA-able)
96 * @data.buf.out: output buffer (must be DMA-able)
140 * struct spi_mem_dirmap_info - Direct mapping information
142 * the memory device is accessed
148 * be used to access the device.
150 * direction is directly encoded in the ->op_tmpl.data.dir field.
159 * struct spi_mem_dirmap_desc - Direct mapping descriptor
160 * @mem: the SPI memory device this direct mapping is attached to
162 * @nodirmap: set to 1 if the SPI controller does not implement
163 * ->mem_ops->dirmap_create() or when this function returned an
171 * spi_mem_dirmap_create() and controller implementation of ->create_dirmap()
172 * can create/attach direct mapping resources to the descriptor in the ->priv
183 * struct spi_mem - describes a SPI memory device
184 * @spi: the underlying SPI device
186 * @name: name of the SPI memory device
188 * Extra information that describe the SPI memory device and may be needed by
189 * the controller to properly handle this device should be placed here.
191 * One example would be the device size since some controller expose their SPI
192 * mem devices through a io-mapped region.
195 struct spi_device *spi; member
201 * struct spi_mem_set_drvdata() - attach driver private data to a SPI mem
202 * device
203 * @mem: memory device
204 * @data: data to attach to the memory device
208 mem->drvpriv = data; in spi_mem_set_drvdata()
212 * struct spi_mem_get_drvdata() - get driver private data attached to a SPI mem
213 * device
214 * @mem: memory device
216 * Return: the data attached to the mem device.
220 return mem->drvpriv; in spi_mem_get_drvdata()
224 * struct spi_controller_mem_ops - SPI memory operations
229 * @exec_op: execute a SPI memory operation
230 * @get_name: get a custom name for the SPI mem device from the controller.
232 * to use the SPI mem layer and a custom name is used to keep
236 * have a ->free_name() function.
238 * access the memory device. This method is optional
240 * ->dirmap_create()
241 * @dirmap_read: read data from the memory device using the direct mapping
242 * created by ->dirmap_create(). The function can return less
247 * @dirmap_write: write data to the memory device using the direct mapping
248 * created by ->dirmap_create(). The function can return less
254 * This interface should be implemented by SPI controllers providing an
255 * high-level interface to execute SPI memory operation, which is usually the
258 * Note on ->dirmap_{read,write}(): drivers should avoid accessing the direct
260 * SPI mem transaction to finish, and this will make real-time maintainers
280 * struct spi_mem_driver - SPI memory driver
281 * @spidrv: inherit from a SPI driver
282 * @probe: probe a SPI memory. Usually where detection/initialization takes
284 * @remove: remove a SPI memory
291 * SPI controllers know more about the SPI memory they interact with, and
320 return -ENOTSUPP; in spi_controller_dma_map_mem_op_data()
358 devm_spi_mem_dirmap_create(struct device *dev, struct spi_mem *mem,
360 void devm_spi_mem_dirmap_destroy(struct device *dev,