Skip to content

Commit 0094d6b

Browse files
prabhakarladWolfram Sang
authored andcommitted
i2c: riic: Use BIT macro consistently
Easier to read and ensures proper types. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
1 parent 279c83d commit 0094d6b

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

drivers/i2c/busses/i2c-riic.c

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
* Also check the comments in the interrupt routines for some gory details.
3535
*/
3636

37+
#include <linux/bits.h>
3738
#include <linux/clk.h>
3839
#include <linux/completion.h>
3940
#include <linux/err.h>
@@ -46,32 +47,32 @@
4647
#include <linux/pm_runtime.h>
4748
#include <linux/reset.h>
4849

49-
#define ICCR1_ICE 0x80
50-
#define ICCR1_IICRST 0x40
51-
#define ICCR1_SOWP 0x10
50+
#define ICCR1_ICE BIT(7)
51+
#define ICCR1_IICRST BIT(6)
52+
#define ICCR1_SOWP BIT(4)
5253

53-
#define ICCR2_BBSY 0x80
54-
#define ICCR2_SP 0x08
55-
#define ICCR2_RS 0x04
56-
#define ICCR2_ST 0x02
54+
#define ICCR2_BBSY BIT(7)
55+
#define ICCR2_SP BIT(3)
56+
#define ICCR2_RS BIT(2)
57+
#define ICCR2_ST BIT(1)
5758

5859
#define ICMR1_CKS_MASK 0x70
59-
#define ICMR1_BCWP 0x08
60+
#define ICMR1_BCWP BIT(3)
6061
#define ICMR1_CKS(_x) ((((_x) << 4) & ICMR1_CKS_MASK) | ICMR1_BCWP)
6162

62-
#define ICMR3_RDRFS 0x20
63-
#define ICMR3_ACKWP 0x10
64-
#define ICMR3_ACKBT 0x08
63+
#define ICMR3_RDRFS BIT(5)
64+
#define ICMR3_ACKWP BIT(4)
65+
#define ICMR3_ACKBT BIT(3)
6566

66-
#define ICFER_FMPE 0x80
67+
#define ICFER_FMPE BIT(7)
6768

68-
#define ICIER_TIE 0x80
69-
#define ICIER_TEIE 0x40
70-
#define ICIER_RIE 0x20
71-
#define ICIER_NAKIE 0x10
72-
#define ICIER_SPIE 0x08
69+
#define ICIER_TIE BIT(7)
70+
#define ICIER_TEIE BIT(6)
71+
#define ICIER_RIE BIT(5)
72+
#define ICIER_NAKIE BIT(4)
73+
#define ICIER_SPIE BIT(3)
7374

74-
#define ICSR2_NACKF 0x10
75+
#define ICSR2_NACKF BIT(4)
7576

7677
#define ICBR_RESERVED 0xe0 /* Should be 1 on writes */
7778

0 commit comments

Comments
 (0)