Browse Source

Use a define for the chip version mask on the axp209.

Merlijn Wajer 4 years ago
parent
commit
58f680a47e
2 changed files with 5 additions and 0 deletions
  1. 3 0
      drivers/power/axp209.c
  2. 2 0
      include/axp209.h

+ 3 - 0
drivers/power/axp209.c

@@ -153,10 +153,13 @@ int axp_init(void)
153 153
 	if (rc)
154 154
 		return rc;
155 155
 
156
+#if 0
156 157
 	/* Low 4 bits is chip version */
157 158
 	ver &= 0x0f;
158 159
 
159 160
 	if (ver != 0x1)
161
+#endif
162
+	if ((ver & AXP209_CHIP_VERSION_MASK) != 0x1)
160 163
 		return -EINVAL;
161 164
 
162 165
 	/* Mask all interrupts */

+ 2 - 0
include/axp209.h

@@ -25,6 +25,8 @@ enum axp209_reg {
25 25
 #define AXP209_POWER_STATUS_ON_BY_DC	BIT(0)
26 26
 #define AXP209_POWER_STATUS_VBUS_USABLE	BIT(4)
27 27
 
28
+#define AXP209_CHIP_VERSION_MASK	0x0f
29
+
28 30
 #define AXP209_OUTPUT_CTRL_EXTEN	BIT(0)
29 31
 #define AXP209_OUTPUT_CTRL_DCDC3	BIT(1)
30 32
 #define AXP209_OUTPUT_CTRL_LDO2		BIT(2)