Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1520237
| From | Nicolae Rosia <Nicolae_Rosia@mentor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/4] regulator: twl-regulator: rework fixed regulator definition |
| Date | 2016-11-12 13:50 +0100 |
| Message-ID | <sCFUS-27N-11@gated-at.bofh.it> (permalink) |
| References | <sCFUR-27N-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
TWL603X and TWL4030 are different and have different code logic.
Rework the regulator definition method so we can split the file
easily in twl4030 and twl6030.
Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
---
drivers/regulator/twl-regulator.c | 38 ++++++++++++++++++++++++--------------
1 file changed, 24 insertions(+), 14 deletions(-)
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index e0d81f8..3f9f53d 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -873,15 +873,6 @@ static struct regulator_ops twlsmps_ops = {
/*----------------------------------------------------------------------*/
-#define TWL4030_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \
- remap_conf) \
- TWL_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \
- remap_conf, TWL4030, twl4030fixed_ops, \
- twl4030reg_map_mode)
-#define TWL6030_FIXED_LDO(label, offset, mVolts, turnon_delay) \
- TWL_FIXED_LDO(label, offset, mVolts, 0x0, turnon_delay, \
- 0x0, TWL6030, twl6030fixed_ops, NULL)
-
#define TWL4030_ADJUSTABLE_LDO(label, offset, num, turnon_delay, remap_conf) \
static const struct twlreg_info TWL4030_INFO_##label = { \
.base = offset, \
@@ -958,8 +949,27 @@ static const struct twlreg_info TWL6032_INFO_##label = { \
}, \
}
-#define TWL_FIXED_LDO(label, offset, mVolts, num, turnon_delay, remap_conf, \
- family, operations, map_mode) \
+#define TWL6030_FIXED_LDO(label, offset, mVolts, turnon_delay) \
+static const struct twlreg_info TWLFIXED_INFO_##label = { \
+ .base = offset, \
+ .id = 0, \
+ .min_mV = mVolts, \
+ .remap = 0, \
+ .desc = { \
+ .name = #label, \
+ .id = TWL6030##_REG_##label, \
+ .n_voltages = 1, \
+ .ops = &twl6030fixed_ops, \
+ .type = REGULATOR_VOLTAGE, \
+ .owner = THIS_MODULE, \
+ .min_uV = mVolts * 1000, \
+ .enable_time = turnon_delay, \
+ .of_map_mode = NULL, \
+ }, \
+ }
+
+#define TWL4030_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \
+ remap_conf) \
static const struct twlreg_info TWLFIXED_INFO_##label = { \
.base = offset, \
.id = num, \
@@ -967,14 +977,14 @@ static const struct twlreg_info TWLFIXED_INFO_##label = { \
.remap = remap_conf, \
.desc = { \
.name = #label, \
- .id = family##_REG_##label, \
+ .id = TWL4030##_REG_##label, \
.n_voltages = 1, \
- .ops = &operations, \
+ .ops = &twl4030fixed_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
.min_uV = mVolts * 1000, \
.enable_time = turnon_delay, \
- .of_map_mode = map_mode, \
+ .of_map_mode = twl4030reg_map_mode, \
}, \
}
--
2.5.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/4] regulator: twl: preparation for TWL6032 support Nicolae Rosia <Nicolae_Rosia@mentor.com> - 2016-11-12 13:50 +0100
[PATCH 1/4] regulator: twl: make driver DT only Nicolae Rosia <Nicolae_Rosia@mentor.com> - 2016-11-12 13:50 +0100
Applied "regulator: twl: make driver DT only" to the regulator tree Mark Brown <broonie@kernel.org> - 2016-11-18 13:10 +0100
[PATCH 3/4] regulator: twl-regulator: rework fixed regulator definition Nicolae Rosia <Nicolae_Rosia@mentor.com> - 2016-11-12 13:50 +0100
Applied "regulator: twl-regulator: rework fixed regulator definition" to the regulator tree Mark Brown <broonie@kernel.org> - 2016-11-18 13:10 +0100
csiph-web