Commit f5eebc79 authored by Olliver Schinagl's avatar Olliver Schinagl Committed by Jagan Teki

power: axp209: Define the chip version mask

Use a define for the chip version mask on the axp209.
Signed-off-by: default avatarOlliver Schinagl <oliver@schinagl.nl>
Signed-off-by: default avatarPriit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard's avatarMaxime Ripard <maxime.ripard@bootlin.com>
parent 048447ce
......@@ -153,10 +153,7 @@ int axp_init(void)
if (rc)
return rc;
/* Low 4 bits is chip version */
ver &= 0x0f;
if (ver != 0x1)
if ((ver & AXP209_CHIP_VERSION_MASK) != 0x1)
return -EINVAL;
/* Mask all interrupts */
......
......@@ -25,6 +25,8 @@ enum axp209_reg {
#define AXP209_POWER_STATUS_ON_BY_DC BIT(0)
#define AXP209_POWER_STATUS_VBUS_USABLE BIT(4)
#define AXP209_CHIP_VERSION_MASK 0x0f
#define AXP209_OUTPUT_CTRL_EXTEN BIT(0)
#define AXP209_OUTPUT_CTRL_DCDC3 BIT(1)
#define AXP209_OUTPUT_CTRL_LDO2 BIT(2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment