Skip to content

Commit 288df43

Browse files
committed
mtd: spi-nor: core: Update name and description of micron_st_nor_set_4byte_addr_mode
Rename method to spi_nor_set_4byte_addr_mode_wren_en4b_ex4b and extend its description. This method is described in JESD216 BFPT[SFDP_DWORD(16)], BIT(30) and BIT(22). Reviewed-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/r/20230331074606.3559258-3-tudor.ambarus@linaro.org Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
1 parent 076aa4e commit 288df43

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

drivers/mtd/spi-nor/core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,15 +539,16 @@ int spi_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
539539
}
540540

541541
/**
542-
* micron_st_nor_set_4byte_addr_mode() - Set 4-byte address mode for ST and
543-
* Micron flashes.
542+
* spi_nor_set_4byte_addr_mode_wren_en4b_ex4b() - Set 4-byte address mode using
543+
* SPINOR_OP_WREN followed by SPINOR_OP_EN4B or SPINOR_OP_EX4B. Typically used
544+
* by ST and Micron flashes.
544545
* @nor: pointer to 'struct spi_nor'.
545546
* @enable: true to enter the 4-byte address mode, false to exit the 4-byte
546547
* address mode.
547548
*
548549
* Return: 0 on success, -errno otherwise.
549550
*/
550-
int micron_st_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
551+
int spi_nor_set_4byte_addr_mode_wren_en4b_ex4b(struct spi_nor *nor, bool enable)
551552
{
552553
int ret;
553554

drivers/mtd/spi-nor/core.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,8 @@ void spi_nor_spimem_setup_op(const struct spi_nor *nor,
648648
int spi_nor_write_enable(struct spi_nor *nor);
649649
int spi_nor_write_disable(struct spi_nor *nor);
650650
int spi_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable);
651-
int micron_st_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable);
651+
int spi_nor_set_4byte_addr_mode_wren_en4b_ex4b(struct spi_nor *nor,
652+
bool enable);
652653
int spi_nor_wait_till_ready(struct spi_nor *nor);
653654
int spi_nor_global_block_unlock(struct spi_nor *nor);
654655
int spi_nor_prep_and_lock(struct spi_nor *nor);

drivers/mtd/spi-nor/micron-st.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ static void micron_st_nor_default_init(struct spi_nor *nor)
425425
nor->flags |= SNOR_F_HAS_LOCK;
426426
nor->flags &= ~SNOR_F_HAS_16BIT_SR;
427427
nor->params->quad_enable = NULL;
428-
nor->params->set_4byte_addr_mode = micron_st_nor_set_4byte_addr_mode;
428+
nor->params->set_4byte_addr_mode = spi_nor_set_4byte_addr_mode_wren_en4b_ex4b;
429429
}
430430

431431
static void micron_st_nor_late_init(struct spi_nor *nor)

0 commit comments

Comments
 (0)