All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jagan Teki <jteki@openedev.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 08/10] sf: Fix few naming convention for read modes
Date: Thu, 31 Dec 2015 14:52:03 +0530	[thread overview]
Message-ID: <1451553724-1098-9-git-send-email-jteki@openedev.com> (raw)
In-Reply-To: <1451553724-1098-1-git-send-email-jteki@openedev.com>

spi_read_cmds =>  read_mode
e_rd_cmd => flash_read
spi_read_cmds_array => flash_read_cmd

All these are flash specific notation used in spi_flash
core hence renamed to proper naming conventions related
to flash.

Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Tested-by: Mugunthan V N <mugunthanvnm@ti.com>
Tested-by: Jagan Teki <jteki@openedev.com>
Signed-off-by: Jagan Teki <jteki@openedev.com>
---
 drivers/mtd/spi/sf_internal.h |  2 +-
 drivers/mtd/spi/spi_flash.c   | 22 +++++++++++-----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 75513b0..89176db 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -21,7 +21,7 @@ enum spi_dual_flash {
 };
 
 /* Enum list - Full read commands */
-enum spi_read_cmds {
+enum read_mode {
 	ARRAY_SLOW		= BIT(0),
 	ARRAY_FAST		= BIT(1),
 	DUAL_OUTPUT_FAST	= BIT(2),
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 2a7983c..2644cee 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -43,8 +43,8 @@ struct flash_info {
 	u16		page_size;
 	u16		addr_width;
 
-	/* Enum list for read commands */
-	enum spi_read_cmds e_rd_cmd;
+	/* Enum list for read modes */
+	enum read_mode	flash_read;
 
 	u16		flags;
 #define	SECT_4K			0x01	/* SPINOR_OP_BE_4K works uniformly */
@@ -868,7 +868,7 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len)
 #endif
 
 /* Used when the "_ext_id" is two bytes at most */
-#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _e_rd_cmd, _flags)	\
+#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flash_read, _flags)	\
 		.id = {							\
 			((_jedec_id) >> 16) & 0xff,			\
 			((_jedec_id) >> 8) & 0xff,			\
@@ -880,10 +880,10 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len)
 		.sector_size = (_sector_size),				\
 		.n_sectors = (_n_sectors),				\
 		.page_size = 256,					\
-		.e_rd_cmd = _e_rd_cmd,					\
+		.flash_read = _flash_read,					\
 		.flags = (_flags),
 
-#define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors, _e_rd_cmd, _flags)	\
+#define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors, _flash_read, _flags)	\
 		.id = {							\
 			((_jedec_id) >> 16) & 0xff,			\
 			((_jedec_id) >> 8) & 0xff,			\
@@ -896,15 +896,15 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len)
 		.sector_size = (_sector_size),				\
 		.n_sectors = (_n_sectors),				\
 		.page_size = 256,					\
-		.e_rd_cmd = _e_rd_cmd,					\
+		.flash_read = _flash_read,					\
 		.flags = (_flags),
 
-#define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_width, _e_rd_cmd, _flags)	\
+#define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_width, _flash_read, _flags)	\
 		.sector_size = (_sector_size),				\
 		.n_sectors = (_n_sectors),				\
 		.page_size = (_page_size),				\
 		.addr_width = (_addr_width),				\
-		.e_rd_cmd = _e_rd_cmd,					\
+		.flash_read = _flash_read,					\
 		.flags = (_flags),
 
 /* NOTE: double check command sets and memory organization when you add
@@ -1297,7 +1297,7 @@ int spi_flash_scan(struct spi_flash *flash)
 {
 	struct spi_slave *spi = flash->spi;
 	const struct flash_info *info = NULL;
-	static u8 spi_read_cmds_array[] = {
+	static u8 flash_read_cmd[] = {
 		CMD_READ_ARRAY_SLOW,
 		CMD_READ_ARRAY_FAST,
 		CMD_READ_DUAL_OUTPUT_FAST,
@@ -1397,9 +1397,9 @@ int spi_flash_scan(struct spi_flash *flash)
 	flash->sector_size = flash->erase_size;
 
 	/* Look for the fastest read cmd */
-	cmd = fls(info->e_rd_cmd & spi->mode_rx);
+	cmd = fls(info->flash_read & spi->mode_rx);
 	if (cmd) {
-		cmd = spi_read_cmds_array[cmd - 1];
+		cmd = flash_read_cmd[cmd - 1];
 		flash->read_cmd = cmd;
 	} else {
 		/* Go for default supported read cmd */
-- 
1.9.1

  parent reply	other threads:[~2015-12-31  9:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-31  9:21 [U-Boot] [PATCH v3 00/10] sf: Add flash_ids inside Core Jagan Teki
2015-12-31  9:21 ` [U-Boot] [PATCH v3 01/10] sf: Add spi_flash_ids local to core Jagan Teki
2015-12-31  9:21 ` [U-Boot] [PATCH v3 02/10] sf: Rename SST_WR to SST_WRITE Jagan Teki
2015-12-31  9:21 ` [U-Boot] [PATCH v3 03/10] sf: Remove SPI_NOR_DUAL|QUAD_READ Jagan Teki
2015-12-31  9:21 ` [U-Boot] [PATCH v3 04/10] sf: Use sf_params in sandbox Jagan Teki
2016-01-11 16:59   ` Simon Glass
2015-12-31  9:22 ` [U-Boot] [PATCH v3 05/10] sf: Remove SECT_32K Jagan Teki
2015-12-31  9:22 ` [U-Boot] [PATCH v3 06/10] sf: Add SECT_4K_PMC Jagan Teki
2015-12-31  9:22 ` [U-Boot] [PATCH v3 07/10] sf: Use CONFIG_SPI_FLASH_USE_4K_SECTORS Jagan Teki
2015-12-31  9:22 ` Jagan Teki [this message]
2015-12-31  9:22 ` [U-Boot] [PATCH v3 09/10] sf: sandbox: Move spi_flash_params_table Jagan Teki
2016-01-06 14:33 ` [U-Boot] [PATCH v3 00/10] sf: Add flash_ids inside Core Jagan Teki
2016-01-09  7:11   ` Jagan Teki
2016-01-09 14:21   ` Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451553724-1098-9-git-send-email-jteki@openedev.com \
    --to=jteki@openedev.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.