summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMiquel Raynal <[email protected]>2025-09-30 03:21:05 +0300
committerMichael Trimarchi <[email protected]>2025-10-05 20:26:27 +0200
commit1e103284a51fae91e73bb2014221f53c53435341 (patch)
treeefcda0d54dd2d135325ec73a9791d73d06871d15 /include/linux
parentf61362c24f5d827005cca5b46887400625faf540 (diff)
mtd: spinand: Add a ->configure_chip() hook
There is already a manufacturer hook, which is manufacturer specific but not chip specific. We no longer have access to the actual NAND identity at this stage so let's add a per-chip configuration hook to align the chip configuration (if any) with the core's setting. This is a port of linux commit da55809ebb45 ("mtd: spinand: Add a ->configure_chip() hook") Signed-off-by: Miquel Raynal <[email protected]> Signed-off-by: Mikhail Kshevetskiy <[email protected]> # U-Boot port Reviewed-by: Frieder Schrempf <[email protected]> Signed-off-by: Michael Trimarchi <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/spinand.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index adfb5f3ffbc..94f324741e0 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -398,6 +398,7 @@ struct spinand_user_otp {
* @op_variants.update_cache: variants of the update-cache operation
* @select_target: function used to select a target/die. Required only for
* multi-die chips
+ * @configure_chip: Align the chip configuration with the core settings
* @set_cont_read: enable/disable continuous cached reads
* @fact_otp: SPI NAND factory OTP info.
* @user_otp: SPI NAND user OTP info.
@@ -421,6 +422,7 @@ struct spinand_info {
} op_variants;
int (*select_target)(struct spinand_device *spinand,
unsigned int target);
+ int (*configure_chip)(struct spinand_device *spinand);
int (*set_cont_read)(struct spinand_device *spinand,
bool enable);
struct spinand_fact_otp fact_otp;
@@ -453,6 +455,9 @@ struct spinand_info {
#define SPINAND_SELECT_TARGET(__func) \
.select_target = __func,
+#define SPINAND_CONFIGURE_CHIP(__configure_chip) \
+ .configure_chip = __configure_chip
+
#define SPINAND_CONT_READ(__set_cont_read) \
.set_cont_read = __set_cont_read,
@@ -521,6 +526,7 @@ struct spinand_dirmap {
* passed in spi_mem_op be DMA-able, so we can't based the bufs on
* the stack
* @manufacturer: SPI NAND manufacturer information
+ * @configure_chip: Align the chip configuration with the core settings
* @cont_read_possible: Field filled by the core once the whole system
* configuration is known to tell whether continuous reads are
* suitable to use or not in general with this chip/configuration.
@@ -569,6 +575,7 @@ struct spinand_device {
u8 last_wait_status;
+ int (*configure_chip)(struct spinand_device *spinand);
bool cont_read_possible;
int (*set_cont_read)(struct spinand_device *spinand,
bool enable);