Skip to content

Commit 1259869

Browse files
tpetazzoniWolfram Sang
authored andcommitted
i2c: mv64xxx: use BIT() macro for register value definitions
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
1 parent 603ba7e commit 1259869

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

drivers/i2c/busses/i2c-mv64xxx.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
#define MV64XXX_I2C_BAUD_DIV_N(val) (val & 0x7)
3131
#define MV64XXX_I2C_BAUD_DIV_M(val) ((val & 0xf) << 3)
3232

33-
#define MV64XXX_I2C_REG_CONTROL_ACK 0x00000004
34-
#define MV64XXX_I2C_REG_CONTROL_IFLG 0x00000008
35-
#define MV64XXX_I2C_REG_CONTROL_STOP 0x00000010
36-
#define MV64XXX_I2C_REG_CONTROL_START 0x00000020
37-
#define MV64XXX_I2C_REG_CONTROL_TWSIEN 0x00000040
38-
#define MV64XXX_I2C_REG_CONTROL_INTEN 0x00000080
33+
#define MV64XXX_I2C_REG_CONTROL_ACK BIT(2)
34+
#define MV64XXX_I2C_REG_CONTROL_IFLG BIT(3)
35+
#define MV64XXX_I2C_REG_CONTROL_STOP BIT(4)
36+
#define MV64XXX_I2C_REG_CONTROL_START BIT(5)
37+
#define MV64XXX_I2C_REG_CONTROL_TWSIEN BIT(6)
38+
#define MV64XXX_I2C_REG_CONTROL_INTEN BIT(7)
3939

4040
/* Ctlr status values */
4141
#define MV64XXX_I2C_STATUS_BUS_ERR 0x00
@@ -68,16 +68,16 @@
6868
#define MV64XXX_I2C_REG_BRIDGE_TIMING 0xe0
6969

7070
/* Bridge Control values */
71-
#define MV64XXX_I2C_BRIDGE_CONTROL_WR 0x00000001
72-
#define MV64XXX_I2C_BRIDGE_CONTROL_RD 0x00000002
71+
#define MV64XXX_I2C_BRIDGE_CONTROL_WR BIT(0)
72+
#define MV64XXX_I2C_BRIDGE_CONTROL_RD BIT(1)
7373
#define MV64XXX_I2C_BRIDGE_CONTROL_ADDR_SHIFT 2
74-
#define MV64XXX_I2C_BRIDGE_CONTROL_ADDR_EXT 0x00001000
74+
#define MV64XXX_I2C_BRIDGE_CONTROL_ADDR_EXT BIT(12)
7575
#define MV64XXX_I2C_BRIDGE_CONTROL_TX_SIZE_SHIFT 13
7676
#define MV64XXX_I2C_BRIDGE_CONTROL_RX_SIZE_SHIFT 16
77-
#define MV64XXX_I2C_BRIDGE_CONTROL_ENABLE 0x00080000
77+
#define MV64XXX_I2C_BRIDGE_CONTROL_ENABLE BIT(19)
7878

7979
/* Bridge Status values */
80-
#define MV64XXX_I2C_BRIDGE_STATUS_ERROR 0x00000001
80+
#define MV64XXX_I2C_BRIDGE_STATUS_ERROR BIT(0)
8181
#define MV64XXX_I2C_STATUS_OFFLOAD_ERROR 0xf0000001
8282
#define MV64XXX_I2C_STATUS_OFFLOAD_OK 0xf0000000
8383

0 commit comments

Comments
 (0)