diff options
author | Olliver Schinagl <oliver@schinagl.nl> | 2018-11-21 20:05:29 +0200 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2018-12-07 22:24:33 +0530 |
commit | 3f7d76a7ed92e75ff30c7e6287eca71f09da0bcf (patch) | |
tree | a8bab77f1f936d2f8fce3654b48410b813477fcc /include/axp209.h | |
parent | f5eebc792559d33ddf973f640f7570d042e3bbe8 (diff) |
power: axp209: Reduce magic values by adding defines for LDO[234]
The AXP209 has a few 'magisc-ish' values that are better served with
clear defines.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Priit Laes <plaes@plaes.org>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Diffstat (limited to 'include/axp209.h')
-rw-r--r-- | include/axp209.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/axp209.h b/include/axp209.h index 43e3873e24..dc27d65a43 100644 --- a/include/axp209.h +++ b/include/axp209.h @@ -34,6 +34,19 @@ enum axp209_reg { #define AXP209_OUTPUT_CTRL_DCDC2 BIT(4) #define AXP209_OUTPUT_CTRL_LDO3 BIT(6) +#define AXP209_LDO24_LDO2_MASK 0xf0 +#define AXP209_LDO24_LDO4_MASK 0x0f +#define AXP209_LDO24_LDO2_SET(reg, cfg) \ + (((reg) & ~AXP209_LDO24_LDO2_MASK) | \ + (((cfg) << 4) & AXP209_LDO24_LDO2_MASK)) +#define AXP209_LDO24_LDO4_SET(reg, cfg) \ + (((reg) & ~AXP209_LDO24_LDO4_MASK) | \ + (((cfg) << 0) & AXP209_LDO24_LDO4_MASK)) + +#define AXP209_LDO3_VOLTAGE_FROM_LDO3IN BIT(7) +#define AXP209_LDO3_VOLTAGE_MASK 0x7f +#define AXP209_LDO3_VOLTAGE_SET(x) ((x) & AXP209_LDO3_VOLTAGE_MASK) + #define AXP209_IRQ5_PEK_UP BIT(6) #define AXP209_IRQ5_PEK_DOWN BIT(5) |