From 86f162c91f274e0d8a0c440d7a991230f6ac7725 Mon Sep 17 00:00:00 2001 From: Adam Ward Date: Mon, 30 Nov 2020 16:59:06 +0000 Subject: 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 Link: https://lore.kernel.org/r/3527d84448d1e6ddc0fcb883ae564880f75a6cb0.1606755367.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown --- drivers/regulator/da9121-regulator.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'drivers/regulator/da9121-regulator.c') 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 #include #include - -#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 */ -- cgit v1.2.3