diff options
author | Apurva Nandan <a-nandan@ti.com> | 2023-01-23 23:13:22 +0530 |
---|---|---|
committer | Praneeth Bajjuri <praneeth@ti.com> | 2023-01-25 14:10:19 -0600 |
commit | 863bbccaec436feb7c2d45acd96c9ed461832653 (patch) | |
tree | 9c4afad066f1995d70b3522ee74ef7af27511f72 /include | |
parent | ab9dd1b9846216d3fc703c19963897c7894ff4d5 (diff) |
mtd: spinand: Add change_protocol() in manufacturer_ops
Introduce change_protocol() manufacturer_op to let the vendor
provide the implementation of switching of SPI IO modes.
The method to switch to different SPI IO mode may vary across
manufacturers. For example, for Winbond, Octal DTR is enabled by
writing values to the volatile configuration register. So, let the
manufacturer's code have their own implementation for switching to
any given SPI IO mode. Manufacturer's code need to take care, if
the requested protocol change is allowed/needed and how to apply
it.
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mtd/spinand.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index 6cf6772895..f8df6bf4cc 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -245,6 +245,7 @@ struct spinand_id { * that properties of the NAND chip (spinand->base.memorg and * spinand->base.eccreq) have been filled * @init: initialize a SPI NAND device + * @change_protocol: switch the SPI NAND flash to a specific SPI protocol * @cleanup: cleanup a SPI NAND device * * Each SPI NAND manufacturer driver should implement this interface so that @@ -253,6 +254,8 @@ struct spinand_id { struct spinand_manufacturer_ops { int (*detect)(struct spinand_device *spinand); int (*init)(struct spinand_device *spinand); + int (*change_protocol)(struct spinand_device *spinand, + const enum spinand_protocol protocol); void (*cleanup)(struct spinand_device *spinand); }; |