summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/da9121-regulator.c
diff options
context:
space:
mode:
authorAdam Ward <Adam.Ward.opensource@diasemi.com>2020-11-30 17:59:06 +0100
committerMark Brown <broonie@kernel.org>2020-12-01 13:17:56 +0100
commit86f162c91f274e0d8a0c440d7a991230f6ac7725 (patch)
treeac29667311a71161e7962ba70c2474963f845a1a /drivers/regulator/da9121-regulator.c
parentregulator: Update DA9121 dt-bindings (diff)
downloadlinux-86f162c91f274e0d8a0c440d7a991230f6ac7725.tar.xz
linux-86f162c91f274e0d8a0c440d7a991230f6ac7725.zip
regulator: da9121: Add header file
Add header file for Dialog Semiconductor DA9121 regulator and related devices, mostly autogenerated from the chip design databases, and update driver to replace local defines with those from header. Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/3527d84448d1e6ddc0fcb883ae564880f75a6cb0.1606755367.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/da9121-regulator.c')
-rw-r--r--drivers/regulator/da9121-regulator.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c
index 66bdfd1979c0..c11fe046345f 100644
--- a/drivers/regulator/da9121-regulator.c
+++ b/drivers/regulator/da9121-regulator.c
@@ -9,12 +9,7 @@
#include <linux/regmap.h>
#include <linux/err.h>
#include <linux/i2c.h>
-
-#define DA9121_BUCK_BUCK1_0 0x20
-#define DA9121_BUCK_BUCK1_0_CH1_EN BIT(0)
-
-#define DA9121_BUCK_BUCK1_5 0x25
-#define DA9121_BUCK_BUCK1_5_CH1_A_VOUT GENMASK(7, 0)
+#include "da9121-regulator.h"
#define DA9121_MIN_MV 300
#define DA9121_MAX_MV 1900
@@ -47,10 +42,10 @@ static const struct regulator_desc da9121_reg = {
.min_uV = DA9121_MIN_MV * 1000,
.uV_step = DA9121_STEP_MV * 1000,
.linear_min_sel = DA9121_MIN_SEL,
- .vsel_reg = DA9121_BUCK_BUCK1_5,
- .vsel_mask = DA9121_BUCK_BUCK1_5_CH1_A_VOUT,
- .enable_reg = DA9121_BUCK_BUCK1_0,
- .enable_mask = DA9121_BUCK_BUCK1_0_CH1_EN,
+ .vsel_reg = DA9121_REG_BUCK_BUCK1_5,
+ .vsel_mask = DA9121_MASK_BUCK_BUCKx_5_CHx_A_VOUT,
+ .enable_reg = DA9121_REG_BUCK_BUCK1_0,
+ .enable_mask = DA9121_MASK_BUCK_BUCKx_0_CHx_EN,
/* Default value of BUCK_BUCK1_0.CH1_SRC_DVC_UP */
.ramp_delay = 20000,
/* tBUCK_EN */