From: Jagan Teki <jteki@openedev.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 22/23] spi: tegra: Use GENMASK
Date: Sat, 24 Oct 2015 09:09:09 +0530 [thread overview]
Message-ID: <1445657950-7117-23-git-send-email-jteki@openedev.com> (raw)
In-Reply-To: <1445657950-7117-1-git-send-email-jteki@openedev.com>
Replace numeric mask hexcodes with GENMASK macro
in tegra*.c
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Tom Warren <twarren@nvidia.com>
Signed-off-by: Jagan Teki <jteki@openedev.com>
---
drivers/spi/tegra114_spi.c | 12 ++++++------
drivers/spi/tegra20_sflash.c | 2 +-
drivers/spi/tegra20_slink.c | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/spi/tegra114_spi.c b/drivers/spi/tegra114_spi.c
index d9edd11..98a062c 100644
--- a/drivers/spi/tegra114_spi.c
+++ b/drivers/spi/tegra114_spi.c
@@ -35,9 +35,9 @@ DECLARE_GLOBAL_DATA_PTR;
/* COMMAND1 */
#define SPI_CMD1_GO BIT(31)
#define SPI_CMD1_M_S BIT(30)
-#define SPI_CMD1_MODE_MASK 0x3
+#define SPI_CMD1_MODE_MASK GENMASK(1, 0)
#define SPI_CMD1_MODE_SHIFT 28
-#define SPI_CMD1_CS_SEL_MASK 0x3
+#define SPI_CMD1_CS_SEL_MASK GENMASK(1, 0)
#define SPI_CMD1_CS_SEL_SHIFT 26
#define SPI_CMD1_CS_POL_INACTIVE3 BIT(25)
#define SPI_CMD1_CS_POL_INACTIVE2 BIT(24)
@@ -45,7 +45,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define SPI_CMD1_CS_POL_INACTIVE0 BIT(22)
#define SPI_CMD1_CS_SW_HW BIT(21)
#define SPI_CMD1_CS_SW_VAL BIT(20)
-#define SPI_CMD1_IDLE_SDA_MASK 0x3
+#define SPI_CMD1_IDLE_SDA_MASK GENMASK(1, 0)
#define SPI_CMD1_IDLE_SDA_SHIFT 18
#define SPI_CMD1_BIDIR BIT(17)
#define SPI_CMD1_LSBI_FE BIT(16)
@@ -55,14 +55,14 @@ DECLARE_GLOBAL_DATA_PTR;
#define SPI_CMD1_RX_EN BIT(12)
#define SPI_CMD1_TX_EN BIT(11)
#define SPI_CMD1_PACKED BIT(5)
-#define SPI_CMD1_BIT_LEN_MASK 0x1F
+#define SPI_CMD1_BIT_LEN_MASK GENMASK(4, 0)
#define SPI_CMD1_BIT_LEN_SHIFT 0
/* COMMAND2 */
#define SPI_CMD2_TX_CLK_TAP_DELAY BIT(6)
-#define SPI_CMD2_TX_CLK_TAP_DELAY_MASK (0x3F << 6)
+#define SPI_CMD2_TX_CLK_TAP_DELAY_MASK GENMASK(11, 6)
#define SPI_CMD2_RX_CLK_TAP_DELAY BIT(0)
-#define SPI_CMD2_RX_CLK_TAP_DELAY_MASK (0x3F << 0)
+#define SPI_CMD2_RX_CLK_TAP_DELAY_MASK GENMASK(5, 0)
/* TRANSFER STATUS */
#define SPI_XFER_STS_RDY BIT(30)
diff --git a/drivers/spi/tegra20_sflash.c b/drivers/spi/tegra20_sflash.c
index 5dc196b..6888a96 100644
--- a/drivers/spi/tegra20_sflash.c
+++ b/drivers/spi/tegra20_sflash.c
@@ -37,7 +37,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define SPI_CMD_CS1_EN BIT(6)
#define SPI_CMD_CS0_EN BIT(5)
#define SPI_CMD_BIT_LENGTH BIT(4)
-#define SPI_CMD_BIT_LENGTH_MASK 0x0000001F
+#define SPI_CMD_BIT_LENGTH_MASK GENMASK(4, 0)
#define SPI_STAT_BSY BIT(31)
#define SPI_STAT_RDY BIT(30)
diff --git a/drivers/spi/tegra20_slink.c b/drivers/spi/tegra20_slink.c
index d1abac2..43054f1 100644
--- a/drivers/spi/tegra20_slink.c
+++ b/drivers/spi/tegra20_slink.c
@@ -46,13 +46,13 @@ DECLARE_GLOBAL_DATA_PTR;
#define SLINK_CMD_CS_VAL BIT(12)
#define SLINK_CMD_CS_SOFT BIT(11)
#define SLINK_CMD_BIT_LENGTH BIT(4)
-#define SLINK_CMD_BIT_LENGTH_MASK 0x0000001F
+#define SLINK_CMD_BIT_LENGTH_MASK GENMASK(4, 0)
/* COMMAND2 */
#define SLINK_CMD2_TXEN BIT(30)
#define SLINK_CMD2_RXEN BIT(31)
#define SLINK_CMD2_SS_EN BIT(18)
#define SLINK_CMD2_SS_EN_SHIFT 18
-#define SLINK_CMD2_SS_EN_MASK 0x000C0000
+#define SLINK_CMD2_SS_EN_MASK GENMASK(19, 18)
#define SLINK_CMD2_CS_ACTIVE_BETWEEN BIT(17)
/* STATUS */
#define SLINK_STAT_BSY BIT(31)
--
1.9.1
next prev parent reply other threads:[~2015-10-24 3:39 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-24 3:38 [U-Boot] [PATCH v5 00/23] spi: Use BIT and GENMASK Jagan Teki
2015-10-24 3:38 ` [U-Boot] [PATCH v5 01/23] spi: zynq_[q]spi: Use BIT macro Jagan Teki
2015-10-26 4:45 ` Siva Durga Prasad Paladugu
2015-10-24 3:38 ` [U-Boot] [PATCH v5 02/23] spi: zynq_[q]spi: Use GENMASK macro Jagan Teki
2015-10-26 4:45 ` Siva Durga Prasad Paladugu
2015-10-24 3:38 ` [U-Boot] [PATCH v5 03/23] spi: altera_spi: Use BIT macro Jagan Teki
2015-10-27 2:45 ` Thomas Chou
2015-10-24 3:38 ` [U-Boot] [PATCH v5 04/23] spi: atmel_spi: " Jagan Teki
2015-10-24 3:38 ` [U-Boot] [PATCH v5 05/23] spi: bfin_spi6xx: " Jagan Teki
2015-10-24 3:38 ` [U-Boot] [PATCH v5 06/23] spi: cadence_qspi_apb: " Jagan Teki
2015-10-24 3:38 ` [U-Boot] [PATCH v5 07/23] spi: designware_spi: " Jagan Teki
2015-10-24 23:24 ` Tom Rini
2015-10-24 3:38 ` [U-Boot] [PATCH v5 08/23] spi: fsl: " Jagan Teki
2015-10-24 3:38 ` [U-Boot] [PATCH v5 09/23] spi: ich: " Jagan Teki
2015-10-26 14:08 ` Simon Glass
2015-10-24 3:38 ` [U-Boot] [PATCH v5 10/23] spi: mpc8xxx_spi: " Jagan Teki
2015-10-24 3:38 ` [U-Boot] [PATCH v5 11/23] spi: omap3_spi: " Jagan Teki
2015-10-24 3:38 ` [U-Boot] [PATCH v5 12/23] spi: sh_qspi: " Jagan Teki
2015-10-24 3:39 ` [U-Boot] [PATCH v5 13/23] spi: tegra: " Jagan Teki
2015-10-24 3:39 ` [U-Boot] [PATCH v5 14/23] spi: ti_qspi: " Jagan Teki
2015-10-26 10:59 ` Vignesh R
2015-10-24 3:39 ` [U-Boot] [PATCH v5 15/23] spi: xilinx_spi: " Jagan Teki
2015-10-24 3:39 ` [U-Boot] [PATCH v5 16/23] spi: atmel_spi: Use GENMASK Jagan Teki
2015-10-24 3:39 ` [U-Boot] [PATCH v5 17/23] spi: cadence_qspi_apb: " Jagan Teki
2015-10-24 12:41 ` Marek Vasut
2015-10-24 21:51 ` Tom Rini
2015-10-24 22:13 ` Marek Vasut
2015-10-24 22:25 ` Tom Rini
2015-10-24 23:02 ` Marek Vasut
2015-10-26 5:54 ` Stefan Roese
2015-10-26 7:21 ` Jagan Teki
2015-10-26 7:29 ` Stefan Roese
2015-10-26 7:39 ` Jagan Teki
2015-10-24 3:39 ` [U-Boot] [PATCH v5 18/23] spi: designware_spi: " Jagan Teki
2015-10-24 3:39 ` [U-Boot] [PATCH v5 19/23] spi: fsl_qspi: " Jagan Teki
2015-10-24 3:39 ` [U-Boot] [PATCH v5 20/23] spi: mxs_spi: " Jagan Teki
2015-10-24 12:40 ` Marek Vasut
2015-10-24 13:42 ` Jagan Teki
2015-10-24 13:48 ` Marek Vasut
2015-10-24 21:49 ` Tom Rini
2015-10-24 22:12 ` Marek Vasut
2015-10-24 22:26 ` Tom Rini
2015-10-24 3:39 ` [U-Boot] [PATCH v5 21/23] spi: omap3_spi: " Jagan Teki
2015-10-24 3:39 ` Jagan Teki [this message]
2015-10-24 3:39 ` [U-Boot] [PATCH v5 23/23] spi: xilinx_spi: " Jagan Teki
2015-10-25 6:59 ` [U-Boot] [PATCH v5 00/23] spi: Use BIT and GENMASK Jagan Teki
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=1445657950-7117-23-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.