Browse Source

Use the standard BIT() macro to define BITS.

Merlijn Wajer 4 years ago
parent
commit
e540c9fd9b
1 changed files with 18 additions and 16 deletions
  1. 18 16
      include/axp209.h

+ 18 - 16
include/axp209.h

@@ -3,6 +3,8 @@
3 3
  * (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
4 4
  */
5 5
 
6
+#include <linux/bitops.h>
7
+
6 8
 enum axp209_reg {
7 9
 	AXP209_POWER_STATUS = 0x00,
8 10
 	AXP209_CHIP_VERSION = 0x03,
@@ -20,29 +22,29 @@ enum axp209_reg {
20 22
 	AXP209_SHUTDOWN = 0x32,
21 23
 };
22 24
 
23
-#define AXP209_POWER_STATUS_ON_BY_DC	(1 << 0)
24
-#define AXP209_POWER_STATUS_VBUS_USABLE	(1 << 4)
25
+#define AXP209_POWER_STATUS_ON_BY_DC	BIT(0)
26
+#define AXP209_POWER_STATUS_VBUS_USABLE	BIT(4)
25 27
 
26
-#define AXP209_OUTPUT_CTRL_EXTEN	(1 << 0)
27
-#define AXP209_OUTPUT_CTRL_DCDC3	(1 << 1)
28
-#define AXP209_OUTPUT_CTRL_LDO2		(1 << 2)
29
-#define AXP209_OUTPUT_CTRL_LDO4		(1 << 3)
30
-#define AXP209_OUTPUT_CTRL_DCDC2	(1 << 4)
31
-#define AXP209_OUTPUT_CTRL_LDO3		(1 << 6)
28
+#define AXP209_OUTPUT_CTRL_EXTEN	BIT(0)
29
+#define AXP209_OUTPUT_CTRL_DCDC3	BIT(1)
30
+#define AXP209_OUTPUT_CTRL_LDO2		BIT(2)
31
+#define AXP209_OUTPUT_CTRL_LDO4		BIT(3)
32
+#define AXP209_OUTPUT_CTRL_DCDC2	BIT(4)
33
+#define AXP209_OUTPUT_CTRL_LDO3		BIT(6)
32 34
 
33
-#define AXP209_IRQ5_PEK_UP		(1 << 6)
34
-#define AXP209_IRQ5_PEK_DOWN		(1 << 5)
35
+#define AXP209_IRQ5_PEK_UP		BIT(6)
36
+#define AXP209_IRQ5_PEK_DOWN		BIT(5)
35 37
 
36
-#define AXP209_POWEROFF			(1 << 7)
38
+#define AXP209_POWEROFF			BIT(7)
37 39
 
38 40
 /* For axp_gpio.c */
39 41
 #define AXP_POWER_STATUS		0x00
40
-#define AXP_POWER_STATUS_VBUS_PRESENT		(1 << 5)
42
+#define AXP_POWER_STATUS_VBUS_PRESENT	BIT(5)
41 43
 #define AXP_GPIO0_CTRL			0x90
42 44
 #define AXP_GPIO1_CTRL			0x92
43 45
 #define AXP_GPIO2_CTRL			0x93
44
-#define AXP_GPIO_CTRL_OUTPUT_LOW		0x00 /* Drive pin low */
45
-#define AXP_GPIO_CTRL_OUTPUT_HIGH		0x01 /* Drive pin high */
46
-#define AXP_GPIO_CTRL_INPUT			0x02 /* Input */
46
+#define AXP_GPIO_CTRL_OUTPUT_LOW	0x00 /* Drive pin low */
47
+#define AXP_GPIO_CTRL_OUTPUT_HIGH	0x01 /* Drive pin high */
48
+#define AXP_GPIO_CTRL_INPUT		0x02 /* Input */
47 49
 #define AXP_GPIO_STATE			0x94
48
-#define AXP_GPIO_STATE_OFFSET			4
50
+#define AXP_GPIO_STATE_OFFSET		4