Lines Matching +full:spi +full:- +full:base
1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2016-2017 Micron Technology, Inc.
17 #include <linux/spi/spi.h>
18 #include <linux/spi/spi-mem.h>
21 #include <spi.h>
22 #include <spi-mem.h>
27 * Standard SPI NAND flash operations
121 * Standard SPI NAND flash commands
152 * struct spinand_id - SPI NAND id structure
157 * struct_spinand_id->data contains all bytes returned after a READ_ID command,
160 * struct_manufacurer_ops->detect().
168 * struct manufacurer_ops - SPI NAND manufacturer specific operations
169 * @detect: detect a SPI NAND device. Every time a SPI NAND device is probed
170 * the core calls the struct_manufacurer_ops->detect() hook of each
173 * in struct_spinand_device->id matches the manufacturer whose
174 * ->detect() hook has been called. Should return 1 if there's a
177 * that properties of the NAND chip (spinand->base.memorg and
178 * spinand->base.eccreq) have been filled
179 * @init: initialize a SPI NAND device
180 * @cleanup: cleanup a SPI NAND device
182 * Each SPI NAND manufacturer driver should implement this interface so that
192 * struct spinand_manufacturer - SPI NAND manufacturer instance
203 /* SPI NAND manufacturers */
210 * struct spinand_op_variants - SPI NAND operation variants
214 * Some operations like read-from-cache/write-to-cache have several variants
217 * by a chip and let the core pick the best one based on the SPI mem controller
233 * spinand_ecc_info - description of the on-die ECC implemented by a SPI NAND
237 * -EBADMSG if there are uncorrectable errors. I can also return
240 * @ooblayout: the OOB layout used by the on-die ECC implementation
250 * struct spinand_info - Structure used to describe SPI NAND chips
253 * @flags: OR-ing of the SPINAND_XXX flags
256 * @eccinfo: on-die ECC info
258 * @op_variants.read_cache: variants of the read-cache operation
259 * @op_variants.write_cache: variants of the write-cache operation
260 * @op_variants.update_cache: variants of the update-cache operation
262 * multi-die chips
264 * Each SPI NAND manufacturer driver should have a spinand_info table
312 * struct spinand_device - SPI NAND device instance
313 * @base: NAND device instance
314 * @slave: pointer to the SPI slave object
318 * @op_templates: various SPI mem op templates
326 * @eccinfo: on-die ECC information
331 * because the spi-mem interface explicitly requests that buffers
332 * passed in spi_mem_op be DMA-able, so we can't based the bufs on
334 * @manufacturer: SPI NAND manufacturer information
338 struct nand_device base; member
369 * mtd_to_spinand() - Get the SPI NAND device attached to an MTD instance
372 * Return: the SPI NAND device attached to @mtd.
376 return container_of(mtd_to_nanddev(mtd), struct spinand_device, base); in mtd_to_spinand()
380 * spinand_to_mtd() - Get the MTD device embedded in a SPI NAND device
381 * @spinand: SPI NAND device
387 return nanddev_to_mtd(&spinand->base); in spinand_to_mtd()
391 * nand_to_spinand() - Get the SPI NAND device embedding an NAND object
394 * Return: the SPI NAND device embedding @nand.
398 return container_of(nand, struct spinand_device, base); in nand_to_spinand()
402 * spinand_to_nand() - Get the NAND device embedded in a SPI NAND object
403 * @spinand: SPI NAND device
410 return &spinand->base; in spinand_to_nand()
414 * spinand_set_of_node - Attach a DT node to a SPI NAND device
415 * @spinand: SPI NAND device
418 * Attach a DT node to a SPI NAND device.
423 nanddev_set_of_node(&spinand->base, np); in spinand_set_of_node()