Lines Matching +full:spi +full:- +full:device
1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2016-2017 Micron Technology, Inc.
13 #include <linux/device.h>
16 #include <linux/spi/spi.h>
17 #include <linux/spi/spi-mem.h>
20 * Standard SPI NAND flash operations
144 * Standard SPI NAND flash commands
175 * struct spinand_id - SPI NAND id structure
192 * struct spinand_devid - SPI NAND device id structure
193 * @id: device id of current chip
194 * @len: number of bytes in device id
200 * read_id opcode + 1-byte address.
211 * struct manufacurer_ops - SPI NAND manufacturer specific operations
212 * @init: initialize a SPI NAND device
213 * @cleanup: cleanup a SPI NAND device
215 * Each SPI NAND manufacturer driver should implement this interface so that
224 * struct spinand_manufacturer - SPI NAND manufacturer instance
227 * @devid_len: number of bytes in device ID
228 * @chips: supported SPI NANDs under current manufacturer
229 * @nchips: number of SPI NANDs available in chips array
240 /* SPI NAND manufacturers */
263 * struct spinand_op_variants - SPI NAND operation variants
267 * Some operations like read-from-cache/write-to-cache have several variants
270 * by a chip and let the core pick the best one based on the SPI mem controller
286 * spinand_ecc_info - description of the on-die ECC implemented by a SPI NAND
290 * -EBADMSG if there are uncorrectable errors. I can also return
293 * @ooblayout: the OOB layout used by the on-die ECC implementation
304 * struct spinand_ondie_ecc_conf - private SPI-NAND on-die ECC engine structure
306 * ->get_status() is not populated by the spinand device.
313 * struct spinand_info - Structure used to describe SPI NAND chips
315 * @devid: device ID
316 * @flags: OR-ing of the SPINAND_XXX flags
319 * @eccinfo: on-die ECC info
321 * @op_variants.read_cache: variants of the read-cache operation
322 * @op_variants.write_cache: variants of the write-cache operation
323 * @op_variants.update_cache: variants of the update-cache operation
325 * multi-die chips
327 * Each SPI NAND manufacturer driver should have a spinand_info table
387 * struct spinand_device - SPI NAND device instance
388 * @base: NAND device instance
389 * @spimem: pointer to the SPI mem object
393 * @op_templates: various SPI mem op templates
401 * @eccinfo: on-die ECC information
406 * because the spi-mem interface explicitly requests that buffers
407 * passed in spi_mem_op be DMA-able, so we can't based the bufs on
409 * @manufacturer: SPI NAND manufacturer information
442 * mtd_to_spinand() - Get the SPI NAND device attached to an MTD instance
445 * Return: the SPI NAND device attached to @mtd.
453 * spinand_to_mtd() - Get the MTD device embedded in a SPI NAND device
454 * @spinand: SPI NAND device
456 * Return: the MTD device embedded in @spinand.
460 return nanddev_to_mtd(&spinand->base); in spinand_to_mtd()
464 * nand_to_spinand() - Get the SPI NAND device embedding an NAND object
467 * Return: the SPI NAND device embedding @nand.
475 * spinand_to_nand() - Get the NAND device embedded in a SPI NAND object
476 * @spinand: SPI NAND device
478 * Return: the NAND device embedded in @spinand.
483 return &spinand->base; in spinand_to_nand()
487 * spinand_set_of_node - Attach a DT node to a SPI NAND device
488 * @spinand: SPI NAND device
491 * Attach a DT node to a SPI NAND device.
496 nanddev_set_of_node(&spinand->base, np); in spinand_set_of_node()