mtd: spi-nor: core: Update name and description of spi_nor_set_4byte_addr_mode
authorTudor Ambarus <tudor.ambarus@linaro.org>
Fri, 31 Mar 2023 07:46:00 +0000 (07:46 +0000)
committerTudor Ambarus <tudor.ambarus@linaro.org>
Tue, 4 Apr 2023 06:43:49 +0000 (09:43 +0300)
Rename method to spi_nor_set_4byte_addr_mode_en4b_ex4b and extend its
description. This method is described in JESD216 BFPT[SFDP_DWORD(16)],
BIT(31) and BIT(23).

Reviewed-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20230331074606.3559258-5-tudor.ambarus@linaro.org
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
drivers/mtd/spi-nor/core.c
drivers/mtd/spi-nor/core.h
drivers/mtd/spi-nor/macronix.c
drivers/mtd/spi-nor/winbond.c

index b868a06c6902a9f7375c4fabd4093b460f235177..0cc34f4f3899affce99a362751bbab97b74f3091 100644 (file)
@@ -508,14 +508,16 @@ int spi_nor_read_cr(struct spi_nor *nor, u8 *cr)
 }
 
 /**
- * spi_nor_set_4byte_addr_mode() - Enter/Exit 4-byte address mode.
+ * spi_nor_set_4byte_addr_mode_en4b_ex4b() - Enter/Exit 4-byte address mode
+ *                     using SPINOR_OP_EN4B/SPINOR_OP_EX4B. Typically used by
+ *                     Winbond and Macronix.
  * @nor:       pointer to 'struct spi_nor'.
  * @enable:    true to enter the 4-byte address mode, false to exit the 4-byte
  *             address mode.
  *
  * Return: 0 on success, -errno otherwise.
  */
-int spi_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
+int spi_nor_set_4byte_addr_mode_en4b_ex4b(struct spi_nor *nor, bool enable)
 {
        int ret;
 
@@ -556,7 +558,7 @@ int spi_nor_set_4byte_addr_mode_wren_en4b_ex4b(struct spi_nor *nor, bool enable)
        if (ret)
                return ret;
 
-       ret = spi_nor_set_4byte_addr_mode(nor, enable);
+       ret = spi_nor_set_4byte_addr_mode_en4b_ex4b(nor, enable);
        if (ret)
                return ret;
 
index d8e3fd60d6ee18fcaf8efcfc25536c41c44d2dba..067945c100233c3d5b1b5ca67774b451c8aab884 100644 (file)
@@ -647,7 +647,7 @@ void spi_nor_spimem_setup_op(const struct spi_nor *nor,
                             const enum spi_nor_protocol proto);
 int spi_nor_write_enable(struct spi_nor *nor);
 int spi_nor_write_disable(struct spi_nor *nor);
-int spi_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable);
+int spi_nor_set_4byte_addr_mode_en4b_ex4b(struct spi_nor *nor, bool enable);
 int spi_nor_set_4byte_addr_mode_wren_en4b_ex4b(struct spi_nor *nor,
                                               bool enable);
 int spi_nor_wait_till_ready(struct spi_nor *nor);
index 7db1a1a6a1fbcc4f569e6d447dc0646f337c76ea..1cd55ba6c0167394ad02ffe00434d3f2fcae6424 100644 (file)
@@ -108,7 +108,7 @@ static const struct flash_info macronix_nor_parts[] = {
 static void macronix_nor_default_init(struct spi_nor *nor)
 {
        nor->params->quad_enable = spi_nor_sr1_bit6_quad_enable;
-       nor->params->set_4byte_addr_mode = spi_nor_set_4byte_addr_mode;
+       nor->params->set_4byte_addr_mode = spi_nor_set_4byte_addr_mode_en4b_ex4b;
 }
 
 static const struct spi_nor_fixups macronix_nor_fixups = {
index ca39acf4112c831bfe42486fa149c5f5506ebf2b..9cea241c204bac92fe5263e37958c72f4c52db0c 100644 (file)
@@ -188,7 +188,7 @@ static int winbond_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
 {
        int ret;
 
-       ret = spi_nor_set_4byte_addr_mode(nor, enable);
+       ret = spi_nor_set_4byte_addr_mode_en4b_ex4b(nor, enable);
        if (ret || enable)
                return ret;