Skip to content

Commit 60ab7f4

Browse files
M-Vaittinenbroonie
authored andcommitted
regulator: use linear_ranges helper
Change the regulator helpers to use common linear_ranges code. Signed-off-by: Matti Vaittinen <[email protected]> Reviewed-by: Mark Brown <[email protected]> Acked-by: Charles Keepax <[email protected]> Acked-by: Adam Thomson <[email protected]> Link: https://lore.kernel.org/r/64f01d5e381b8631a271616b7790f9d5640974fb.1588944082.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <[email protected]>
1 parent de824cc commit 60ab7f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+229
-261
lines changed

drivers/regulator/88pg86x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ static const struct regulator_ops pg86x_ops = {
1111
.list_voltage = regulator_list_voltage_linear_range,
1212
};
1313

14-
static const struct regulator_linear_range pg86x_buck1_ranges[] = {
14+
static const struct linear_range pg86x_buck1_ranges[] = {
1515
REGULATOR_LINEAR_RANGE( 0, 0, 10, 0),
1616
REGULATOR_LINEAR_RANGE(1000000, 11, 34, 25000),
1717
REGULATOR_LINEAR_RANGE(1600000, 35, 47, 50000),
1818
};
1919

20-
static const struct regulator_linear_range pg86x_buck2_ranges[] = {
20+
static const struct linear_range pg86x_buck2_ranges[] = {
2121
REGULATOR_LINEAR_RANGE( 0, 0, 15, 0),
2222
REGULATOR_LINEAR_RANGE(1000000, 16, 39, 25000),
2323
REGULATOR_LINEAR_RANGE(1600000, 40, 52, 50000),

drivers/regulator/88pm800-regulator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ struct pm800_regulator_info {
134134
}
135135

136136
/* Ranges are sorted in ascending order. */
137-
static const struct regulator_linear_range buck1_volt_range[] = {
137+
static const struct linear_range buck1_volt_range[] = {
138138
REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500),
139139
REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x54, 50000),
140140
};
141141

142142
/* BUCK 2~5 have same ranges. */
143-
static const struct regulator_linear_range buck2_5_volt_range[] = {
143+
static const struct linear_range buck2_5_volt_range[] = {
144144
REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500),
145145
REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x72, 50000),
146146
};

drivers/regulator/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
menuconfig REGULATOR
33
bool "Voltage and Current Regulator Support"
4+
select LINEAR_RANGES
45
help
56
Generic Voltage and Current Regulator support.
67

drivers/regulator/act8865-regulator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,13 @@ static const struct regmap_config act8865_regmap_config = {
220220
.val_bits = 8,
221221
};
222222

223-
static const struct regulator_linear_range act8865_voltage_ranges[] = {
223+
static const struct linear_range act8865_voltage_ranges[] = {
224224
REGULATOR_LINEAR_RANGE(600000, 0, 23, 25000),
225225
REGULATOR_LINEAR_RANGE(1200000, 24, 47, 50000),
226226
REGULATOR_LINEAR_RANGE(2400000, 48, 63, 100000),
227227
};
228228

229-
static const struct regulator_linear_range act8600_sudcdc_voltage_ranges[] = {
229+
static const struct linear_range act8600_sudcdc_voltage_ranges[] = {
230230
REGULATOR_LINEAR_RANGE(3000000, 0, 63, 0),
231231
REGULATOR_LINEAR_RANGE(3000000, 64, 159, 100000),
232232
REGULATOR_LINEAR_RANGE(12600000, 160, 191, 200000),

drivers/regulator/act8945a-regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct act8945a_pmic {
7373
u32 op_mode[ACT8945A_ID_MAX];
7474
};
7575

76-
static const struct regulator_linear_range act8945a_voltage_ranges[] = {
76+
static const struct linear_range act8945a_voltage_ranges[] = {
7777
REGULATOR_LINEAR_RANGE(600000, 0, 23, 25000),
7878
REGULATOR_LINEAR_RANGE(1200000, 24, 47, 50000),
7979
REGULATOR_LINEAR_RANGE(2400000, 48, 63, 100000),

drivers/regulator/arizona-ldo1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static const struct regulator_ops arizona_ldo1_hc_ops = {
8787
.set_bypass = regulator_set_bypass_regmap,
8888
};
8989

90-
static const struct regulator_linear_range arizona_ldo1_hc_ranges[] = {
90+
static const struct linear_range arizona_ldo1_hc_ranges[] = {
9191
REGULATOR_LINEAR_RANGE(900000, 0, 0x6, 50000),
9292
REGULATOR_LINEAR_RANGE(1800000, 0x7, 0x7, 0),
9393
};

drivers/regulator/arizona-micsupp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static const struct regulator_ops arizona_micsupp_ops = {
125125
.set_bypass = arizona_micsupp_set_bypass,
126126
};
127127

128-
static const struct regulator_linear_range arizona_micsupp_ranges[] = {
128+
static const struct linear_range arizona_micsupp_ranges[] = {
129129
REGULATOR_LINEAR_RANGE(1700000, 0, 0x1e, 50000),
130130
REGULATOR_LINEAR_RANGE(3300000, 0x1f, 0x1f, 0),
131131
};
@@ -152,7 +152,7 @@ static const struct regulator_desc arizona_micsupp = {
152152
.owner = THIS_MODULE,
153153
};
154154

155-
static const struct regulator_linear_range arizona_micsupp_ext_ranges[] = {
155+
static const struct linear_range arizona_micsupp_ext_ranges[] = {
156156
REGULATOR_LINEAR_RANGE(900000, 0, 0x14, 25000),
157157
REGULATOR_LINEAR_RANGE(1500000, 0x15, 0x27, 100000),
158158
};

drivers/regulator/as3711-regulator.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,18 @@ static const struct regulator_ops as3711_dldo_ops = {
103103
.map_voltage = regulator_map_voltage_linear_range,
104104
};
105105

106-
static const struct regulator_linear_range as3711_sd_ranges[] = {
106+
static const struct linear_range as3711_sd_ranges[] = {
107107
REGULATOR_LINEAR_RANGE(612500, 0x1, 0x40, 12500),
108108
REGULATOR_LINEAR_RANGE(1425000, 0x41, 0x70, 25000),
109109
REGULATOR_LINEAR_RANGE(2650000, 0x71, 0x7f, 50000),
110110
};
111111

112-
static const struct regulator_linear_range as3711_aldo_ranges[] = {
112+
static const struct linear_range as3711_aldo_ranges[] = {
113113
REGULATOR_LINEAR_RANGE(1200000, 0, 0xf, 50000),
114114
REGULATOR_LINEAR_RANGE(1800000, 0x10, 0x1f, 100000),
115115
};
116116

117-
static const struct regulator_linear_range as3711_dldo_ranges[] = {
117+
static const struct linear_range as3711_dldo_ranges[] = {
118118
REGULATOR_LINEAR_RANGE(900000, 0, 0x10, 50000),
119119
REGULATOR_LINEAR_RANGE(1750000, 0x20, 0x3f, 50000),
120120
};

drivers/regulator/as3722-regulator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ static const struct regulator_ops as3722_ldo6_extcntrl_ops = {
389389
.set_bypass = regulator_set_bypass_regmap,
390390
};
391391

392-
static const struct regulator_linear_range as3722_ldo_ranges[] = {
392+
static const struct linear_range as3722_ldo_ranges[] = {
393393
REGULATOR_LINEAR_RANGE(0, 0x00, 0x00, 0),
394394
REGULATOR_LINEAR_RANGE(825000, 0x01, 0x24, 25000),
395395
REGULATOR_LINEAR_RANGE(1725000, 0x40, 0x7F, 25000),
@@ -487,7 +487,7 @@ static bool as3722_sd0_is_low_voltage(struct as3722_regulators *as3722_regs)
487487
return false;
488488
}
489489

490-
static const struct regulator_linear_range as3722_sd2345_ranges[] = {
490+
static const struct linear_range as3722_sd2345_ranges[] = {
491491
REGULATOR_LINEAR_RANGE(0, 0x00, 0x00, 0),
492492
REGULATOR_LINEAR_RANGE(612500, 0x01, 0x40, 12500),
493493
REGULATOR_LINEAR_RANGE(1425000, 0x41, 0x70, 25000),

drivers/regulator/axp20x-regulator.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ static const struct regulator_ops axp20x_ops_sw = {
510510
.is_enabled = regulator_is_enabled_regmap,
511511
};
512512

513-
static const struct regulator_linear_range axp20x_ldo4_ranges[] = {
513+
static const struct linear_range axp20x_ldo4_ranges[] = {
514514
REGULATOR_LINEAR_RANGE(1250000,
515515
AXP20X_LDO4_V_OUT_1250mV_START,
516516
AXP20X_LDO4_V_OUT_1250mV_END,
@@ -638,7 +638,7 @@ static const struct regulator_desc axp22x_drivevbus_regulator = {
638638
};
639639

640640
/* DCDC ranges shared with AXP813 */
641-
static const struct regulator_linear_range axp803_dcdc234_ranges[] = {
641+
static const struct linear_range axp803_dcdc234_ranges[] = {
642642
REGULATOR_LINEAR_RANGE(500000,
643643
AXP803_DCDC234_500mV_START,
644644
AXP803_DCDC234_500mV_END,
@@ -649,7 +649,7 @@ static const struct regulator_linear_range axp803_dcdc234_ranges[] = {
649649
20000),
650650
};
651651

652-
static const struct regulator_linear_range axp803_dcdc5_ranges[] = {
652+
static const struct linear_range axp803_dcdc5_ranges[] = {
653653
REGULATOR_LINEAR_RANGE(800000,
654654
AXP803_DCDC5_800mV_START,
655655
AXP803_DCDC5_800mV_END,
@@ -660,7 +660,7 @@ static const struct regulator_linear_range axp803_dcdc5_ranges[] = {
660660
20000),
661661
};
662662

663-
static const struct regulator_linear_range axp803_dcdc6_ranges[] = {
663+
static const struct linear_range axp803_dcdc6_ranges[] = {
664664
REGULATOR_LINEAR_RANGE(600000,
665665
AXP803_DCDC6_600mV_START,
666666
AXP803_DCDC6_600mV_END,
@@ -672,7 +672,7 @@ static const struct regulator_linear_range axp803_dcdc6_ranges[] = {
672672
};
673673

674674
/* AXP806's CLDO2 and AXP809's DLDO1 share the same range */
675-
static const struct regulator_linear_range axp803_dldo2_ranges[] = {
675+
static const struct linear_range axp803_dldo2_ranges[] = {
676676
REGULATOR_LINEAR_RANGE(700000,
677677
AXP803_DLDO2_700mV_START,
678678
AXP803_DLDO2_700mV_END,
@@ -758,7 +758,7 @@ static const struct regulator_desc axp803_regulators[] = {
758758
AXP_DESC_FIXED(AXP803, RTC_LDO, "rtc-ldo", "ips", 3000),
759759
};
760760

761-
static const struct regulator_linear_range axp806_dcdca_ranges[] = {
761+
static const struct linear_range axp806_dcdca_ranges[] = {
762762
REGULATOR_LINEAR_RANGE(600000,
763763
AXP806_DCDCA_600mV_START,
764764
AXP806_DCDCA_600mV_END,
@@ -769,7 +769,7 @@ static const struct regulator_linear_range axp806_dcdca_ranges[] = {
769769
20000),
770770
};
771771

772-
static const struct regulator_linear_range axp806_dcdcd_ranges[] = {
772+
static const struct linear_range axp806_dcdcd_ranges[] = {
773773
REGULATOR_LINEAR_RANGE(600000,
774774
AXP806_DCDCD_600mV_START,
775775
AXP806_DCDCD_600mV_END,
@@ -834,7 +834,7 @@ static const struct regulator_desc axp806_regulators[] = {
834834
AXP806_PWR_OUT_CTRL2, AXP806_PWR_OUT_SW_MASK),
835835
};
836836

837-
static const struct regulator_linear_range axp809_dcdc4_ranges[] = {
837+
static const struct linear_range axp809_dcdc4_ranges[] = {
838838
REGULATOR_LINEAR_RANGE(600000,
839839
AXP809_DCDC4_600mV_START,
840840
AXP809_DCDC4_600mV_END,

0 commit comments

Comments
 (0)