Skip to content

Commit 4c278db

Browse files
Wolfram Sangwsakernel
authored andcommitted
i2c: rcar: use BIT macro consistently
Easier to read and ensures proper types. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 2a250d4 commit 4c278db

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

drivers/i2c/busses/i2c-rcar.c

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -45,44 +45,44 @@
4545
#define ICDMAER 0x3c /* DMA enable (Gen3) */
4646

4747
/* ICSCR */
48-
#define SDBS (1 << 3) /* slave data buffer select */
49-
#define SIE (1 << 2) /* slave interface enable */
50-
#define GCAE (1 << 1) /* general call address enable */
51-
#define FNA (1 << 0) /* forced non acknowledgment */
48+
#define SDBS BIT(3) /* slave data buffer select */
49+
#define SIE BIT(2) /* slave interface enable */
50+
#define GCAE BIT(1) /* general call address enable */
51+
#define FNA BIT(0) /* forced non acknowledgment */
5252

5353
/* ICMCR */
54-
#define MDBS (1 << 7) /* non-fifo mode switch */
55-
#define FSCL (1 << 6) /* override SCL pin */
56-
#define FSDA (1 << 5) /* override SDA pin */
57-
#define OBPC (1 << 4) /* override pins */
58-
#define MIE (1 << 3) /* master if enable */
59-
#define TSBE (1 << 2)
60-
#define FSB (1 << 1) /* force stop bit */
61-
#define ESG (1 << 0) /* enable start bit gen */
54+
#define MDBS BIT(7) /* non-fifo mode switch */
55+
#define FSCL BIT(6) /* override SCL pin */
56+
#define FSDA BIT(5) /* override SDA pin */
57+
#define OBPC BIT(4) /* override pins */
58+
#define MIE BIT(3) /* master if enable */
59+
#define TSBE BIT(2)
60+
#define FSB BIT(1) /* force stop bit */
61+
#define ESG BIT(0) /* enable start bit gen */
6262

6363
/* ICSSR (also for ICSIER) */
64-
#define GCAR (1 << 6) /* general call received */
65-
#define STM (1 << 5) /* slave transmit mode */
66-
#define SSR (1 << 4) /* stop received */
67-
#define SDE (1 << 3) /* slave data empty */
68-
#define SDT (1 << 2) /* slave data transmitted */
69-
#define SDR (1 << 1) /* slave data received */
70-
#define SAR (1 << 0) /* slave addr received */
64+
#define GCAR BIT(6) /* general call received */
65+
#define STM BIT(5) /* slave transmit mode */
66+
#define SSR BIT(4) /* stop received */
67+
#define SDE BIT(3) /* slave data empty */
68+
#define SDT BIT(2) /* slave data transmitted */
69+
#define SDR BIT(1) /* slave data received */
70+
#define SAR BIT(0) /* slave addr received */
7171

7272
/* ICMSR (also for ICMIE) */
73-
#define MNR (1 << 6) /* nack received */
74-
#define MAL (1 << 5) /* arbitration lost */
75-
#define MST (1 << 4) /* sent a stop */
76-
#define MDE (1 << 3)
77-
#define MDT (1 << 2)
78-
#define MDR (1 << 1)
79-
#define MAT (1 << 0) /* slave addr xfer done */
73+
#define MNR BIT(6) /* nack received */
74+
#define MAL BIT(5) /* arbitration lost */
75+
#define MST BIT(4) /* sent a stop */
76+
#define MDE BIT(3)
77+
#define MDT BIT(2)
78+
#define MDR BIT(1)
79+
#define MAT BIT(0) /* slave addr xfer done */
8080

8181
/* ICDMAER */
82-
#define RSDMAE (1 << 3) /* DMA Slave Received Enable */
83-
#define TSDMAE (1 << 2) /* DMA Slave Transmitted Enable */
84-
#define RMDMAE (1 << 1) /* DMA Master Received Enable */
85-
#define TMDMAE (1 << 0) /* DMA Master Transmitted Enable */
82+
#define RSDMAE BIT(3) /* DMA Slave Received Enable */
83+
#define TSDMAE BIT(2) /* DMA Slave Transmitted Enable */
84+
#define RMDMAE BIT(1) /* DMA Master Received Enable */
85+
#define TMDMAE BIT(0) /* DMA Master Transmitted Enable */
8686

8787
/* ICFBSCR */
8888
#define TCYC17 0x0f /* 17*Tcyc delay 1st bit between SDA and SCL */
@@ -97,11 +97,11 @@
9797
#define RCAR_IRQ_RECV (MNR | MAL | MST | MAT | MDR)
9898
#define RCAR_IRQ_STOP (MST)
9999

100-
#define ID_LAST_MSG (1 << 0)
101-
#define ID_DONE (1 << 2)
102-
#define ID_ARBLOST (1 << 3)
103-
#define ID_NACK (1 << 4)
104-
#define ID_EPROTO (1 << 5)
100+
#define ID_LAST_MSG BIT(0)
101+
#define ID_DONE BIT(2)
102+
#define ID_ARBLOST BIT(3)
103+
#define ID_NACK BIT(4)
104+
#define ID_EPROTO BIT(5)
105105
/* persistent flags */
106106
#define ID_P_HOST_NOTIFY BIT(28)
107107
#define ID_P_REP_AFTER_RD BIT(29)

0 commit comments

Comments
 (0)