blob: 745cfe7c8d5c88d1301aa40c9efbd68fc93f91a5 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/*
Duy Truong790f06d2013-02-13 16:38:12 -08002 * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#define pr_fmt(fmt) "%s: " fmt, __func__
15
David Collins6f032ba2011-08-31 14:08:15 -070016#include "rpm-regulator-private.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070017
David Collins6f032ba2011-08-31 14:08:15 -070018/* RPM regulator request formats */
19static struct rpm_vreg_parts ldo_parts = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070020 .request_len = 2,
21 .uV = REQUEST_MEMBER(0, 0x007FFFFF, 0),
22 .pd = REQUEST_MEMBER(0, 0x00800000, 23),
David Collinsd0903892011-07-14 16:08:30 -070023 .pc = REQUEST_MEMBER(0, 0x0F000000, 24),
24 .pf = REQUEST_MEMBER(0, 0xF0000000, 28),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070025 .ip = REQUEST_MEMBER(1, 0x000003FF, 0),
David Collinsd0903892011-07-14 16:08:30 -070026 .ia = REQUEST_MEMBER(1, 0x000FFC00, 10),
27 .fm = REQUEST_MEMBER(1, 0x00700000, 20),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070028};
29
David Collins6f032ba2011-08-31 14:08:15 -070030static struct rpm_vreg_parts smps_parts = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070031 .request_len = 2,
32 .uV = REQUEST_MEMBER(0, 0x007FFFFF, 0),
33 .pd = REQUEST_MEMBER(0, 0x00800000, 23),
David Collinsd0903892011-07-14 16:08:30 -070034 .pc = REQUEST_MEMBER(0, 0x0F000000, 24),
35 .pf = REQUEST_MEMBER(0, 0xF0000000, 28),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070036 .ip = REQUEST_MEMBER(1, 0x000003FF, 0),
David Collinsd0903892011-07-14 16:08:30 -070037 .ia = REQUEST_MEMBER(1, 0x000FFC00, 10),
38 .fm = REQUEST_MEMBER(1, 0x00700000, 20),
39 .pm = REQUEST_MEMBER(1, 0x00800000, 23),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040 .freq = REQUEST_MEMBER(1, 0x1F000000, 24),
41 .freq_clk_src = REQUEST_MEMBER(1, 0x60000000, 29),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070042};
43
David Collins6f032ba2011-08-31 14:08:15 -070044static struct rpm_vreg_parts switch_parts = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070045 .request_len = 1,
46 .enable_state = REQUEST_MEMBER(0, 0x00000001, 0),
47 .pd = REQUEST_MEMBER(0, 0x00000002, 1),
48 .pc = REQUEST_MEMBER(0, 0x0000003C, 2),
49 .pf = REQUEST_MEMBER(0, 0x000003C0, 6),
50 .hpm = REQUEST_MEMBER(0, 0x00000C00, 10),
51};
52
David Collins6f032ba2011-08-31 14:08:15 -070053static struct rpm_vreg_parts ncp_parts = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070054 .request_len = 1,
55 .uV = REQUEST_MEMBER(0, 0x007FFFFF, 0),
56 .enable_state = REQUEST_MEMBER(0, 0x00800000, 23),
57 .comp_mode = REQUEST_MEMBER(0, 0x01000000, 24),
58 .freq = REQUEST_MEMBER(0, 0x3E000000, 25),
59};
60
David Collins6f032ba2011-08-31 14:08:15 -070061/* Physically available PMIC regulator voltage setpoint ranges */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070062static struct vreg_range pldo_ranges[] = {
63 VOLTAGE_RANGE( 750000, 1487500, 12500),
64 VOLTAGE_RANGE(1500000, 3075000, 25000),
65 VOLTAGE_RANGE(3100000, 4900000, 50000),
66};
67
68static struct vreg_range nldo_ranges[] = {
69 VOLTAGE_RANGE( 750000, 1537500, 12500),
70};
71
72static struct vreg_range nldo1200_ranges[] = {
73 VOLTAGE_RANGE( 375000, 743750, 6250),
74 VOLTAGE_RANGE( 750000, 1537500, 12500),
75};
76
David Collins31a9fcd2012-08-31 12:07:27 -070077static struct vreg_range ln_ldo_ranges[] = {
78 VOLTAGE_RANGE( 690000, 1110000, 60000),
79 VOLTAGE_RANGE(1380000, 2220000, 120000),
80};
81
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070082static struct vreg_range smps_ranges[] = {
83 VOLTAGE_RANGE( 375000, 737500, 12500),
84 VOLTAGE_RANGE( 750000, 1487500, 12500),
85 VOLTAGE_RANGE(1500000, 3075000, 25000),
86};
87
88static struct vreg_range ftsmps_ranges[] = {
89 VOLTAGE_RANGE( 350000, 650000, 50000),
90 VOLTAGE_RANGE( 700000, 1400000, 12500),
91 VOLTAGE_RANGE(1500000, 3300000, 50000),
92};
93
94static struct vreg_range ncp_ranges[] = {
95 VOLTAGE_RANGE(1500000, 3050000, 50000),
96};
97
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070098static struct vreg_set_points pldo_set_points = SET_POINTS(pldo_ranges);
99static struct vreg_set_points nldo_set_points = SET_POINTS(nldo_ranges);
100static struct vreg_set_points nldo1200_set_points = SET_POINTS(nldo1200_ranges);
David Collins31a9fcd2012-08-31 12:07:27 -0700101static struct vreg_set_points ln_ldo_set_points = SET_POINTS(ln_ldo_ranges);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700102static struct vreg_set_points smps_set_points = SET_POINTS(smps_ranges);
103static struct vreg_set_points ftsmps_set_points = SET_POINTS(ftsmps_ranges);
104static struct vreg_set_points ncp_set_points = SET_POINTS(ncp_ranges);
105
David Collins6f032ba2011-08-31 14:08:15 -0700106static struct vreg_set_points *all_set_points[] = {
107 &pldo_set_points,
108 &nldo_set_points,
109 &nldo1200_set_points,
David Collins31a9fcd2012-08-31 12:07:27 -0700110 &ln_ldo_set_points,
David Collins6f032ba2011-08-31 14:08:15 -0700111 &smps_set_points,
112 &ftsmps_set_points,
113 &ncp_set_points,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700114};
115
David Collins62ae8d92012-07-31 16:29:43 -0700116#define LDO(_id, _name, _name_pc, _ranges, _hpm_min_load, _requires_cxo) \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700117 [RPM_VREG_ID_PM8921_##_id] = { \
118 .req = { \
119 [0] = { .id = MSM_RPM_ID_PM8921_##_id##_0, }, \
120 [1] = { .id = MSM_RPM_ID_PM8921_##_id##_1, }, \
121 }, \
David Collins6f032ba2011-08-31 14:08:15 -0700122 .hpm_min_load = RPM_VREG_8960_##_hpm_min_load##_HPM_MIN_LOAD, \
123 .type = RPM_REGULATOR_TYPE_LDO, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700124 .set_points = &_ranges##_set_points, \
125 .part = &ldo_parts, \
126 .id = RPM_VREG_ID_PM8921_##_id, \
David Collins6f032ba2011-08-31 14:08:15 -0700127 .rdesc.name = _name, \
128 .rdesc_pc.name = _name_pc, \
David Collins62ae8d92012-07-31 16:29:43 -0700129 .requires_cxo = _requires_cxo, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700130 }
131
David Collins6f032ba2011-08-31 14:08:15 -0700132#define SMPS(_id, _name, _name_pc, _ranges, _hpm_min_load) \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700133 [RPM_VREG_ID_PM8921_##_id] = { \
134 .req = { \
135 [0] = { .id = MSM_RPM_ID_PM8921_##_id##_0, }, \
136 [1] = { .id = MSM_RPM_ID_PM8921_##_id##_1, }, \
137 }, \
David Collins6f032ba2011-08-31 14:08:15 -0700138 .hpm_min_load = RPM_VREG_8960_##_hpm_min_load##_HPM_MIN_LOAD, \
139 .type = RPM_REGULATOR_TYPE_SMPS, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700140 .set_points = &_ranges##_set_points, \
141 .part = &smps_parts, \
142 .id = RPM_VREG_ID_PM8921_##_id, \
David Collins6f032ba2011-08-31 14:08:15 -0700143 .rdesc.name = _name, \
144 .rdesc_pc.name = _name_pc, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700145 }
146
David Collins6f032ba2011-08-31 14:08:15 -0700147#define LVS(_id, _name, _name_pc) \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700148 [RPM_VREG_ID_PM8921_##_id] = { \
149 .req = { \
150 [0] = { .id = MSM_RPM_ID_PM8921_##_id, }, \
151 [1] = { .id = -1, }, \
152 }, \
David Collins6f032ba2011-08-31 14:08:15 -0700153 .type = RPM_REGULATOR_TYPE_VS, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700154 .part = &switch_parts, \
155 .id = RPM_VREG_ID_PM8921_##_id, \
David Collins6f032ba2011-08-31 14:08:15 -0700156 .rdesc.name = _name, \
157 .rdesc_pc.name = _name_pc, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700158 }
159
David Collins6f032ba2011-08-31 14:08:15 -0700160#define MVS(_vreg_id, _name, _name_pc, _rpm_id) \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700161 [RPM_VREG_ID_PM8921_##_vreg_id] = { \
162 .req = { \
163 [0] = { .id = MSM_RPM_ID_##_rpm_id, }, \
164 [1] = { .id = -1, }, \
165 }, \
David Collins6f032ba2011-08-31 14:08:15 -0700166 .type = RPM_REGULATOR_TYPE_VS, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700167 .part = &switch_parts, \
168 .id = RPM_VREG_ID_PM8921_##_vreg_id, \
David Collins6f032ba2011-08-31 14:08:15 -0700169 .rdesc.name = _name, \
170 .rdesc_pc.name = _name_pc, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700171 }
172
David Collins6f032ba2011-08-31 14:08:15 -0700173#define NCP(_id, _name, _name_pc) \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700174 [RPM_VREG_ID_PM8921_##_id] = { \
175 .req = { \
176 [0] = { .id = MSM_RPM_ID_##_id##_0, }, \
177 [1] = { .id = MSM_RPM_ID_##_id##_1, }, \
178 }, \
David Collins6f032ba2011-08-31 14:08:15 -0700179 .type = RPM_REGULATOR_TYPE_NCP, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700180 .set_points = &ncp_set_points, \
181 .part = &ncp_parts, \
182 .id = RPM_VREG_ID_PM8921_##_id, \
David Collins6f032ba2011-08-31 14:08:15 -0700183 .rdesc.name = _name, \
184 .rdesc_pc.name = _name_pc, \
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700185 }
186
187static struct vreg vregs[] = {
David Collins62ae8d92012-07-31 16:29:43 -0700188 LDO(L1, "8921_l1", "8921_l1_pc", nldo, LDO_150, 1),
189 LDO(L2, "8921_l2", "8921_l2_pc", nldo, LDO_150, 1),
190 LDO(L3, "8921_l3", "8921_l3_pc", pldo, LDO_150, 0),
191 LDO(L4, "8921_l4", "8921_l4_pc", pldo, LDO_50, 0),
192 LDO(L5, "8921_l5", "8921_l5_pc", pldo, LDO_300, 0),
193 LDO(L6, "8921_l6", "8921_l6_pc", pldo, LDO_600, 0),
194 LDO(L7, "8921_l7", "8921_l7_pc", pldo, LDO_150, 0),
195 LDO(L8, "8921_l8", "8921_l8_pc", pldo, LDO_300, 0),
196 LDO(L9, "8921_l9", "8921_l9_pc", pldo, LDO_300, 0),
197 LDO(L10, "8921_l10", "8921_l10_pc", pldo, LDO_600, 0),
198 LDO(L11, "8921_l11", "8921_l11_pc", pldo, LDO_150, 0),
199 LDO(L12, "8921_l12", "8921_l12_pc", nldo, LDO_150, 1),
David Collins31a9fcd2012-08-31 12:07:27 -0700200 LDO(L13, "8921_l13", NULL, ln_ldo, LDO_5, 0),
David Collins62ae8d92012-07-31 16:29:43 -0700201 LDO(L14, "8921_l14", "8921_l14_pc", pldo, LDO_50, 0),
202 LDO(L15, "8921_l15", "8921_l15_pc", pldo, LDO_150, 0),
203 LDO(L16, "8921_l16", "8921_l16_pc", pldo, LDO_300, 0),
204 LDO(L17, "8921_l17", "8921_l17_pc", pldo, LDO_150, 0),
205 LDO(L18, "8921_l18", "8921_l18_pc", nldo, LDO_150, 1),
206 LDO(L21, "8921_l21", "8921_l21_pc", pldo, LDO_150, 0),
207 LDO(L22, "8921_l22", "8921_l22_pc", pldo, LDO_150, 0),
208 LDO(L23, "8921_l23", "8921_l23_pc", pldo, LDO_150, 0),
209 LDO(L24, "8921_l24", NULL, nldo1200, LDO_1200, 0),
210 LDO(L25, "8921_l25", NULL, nldo1200, LDO_1200, 0),
211 LDO(L26, "8921_l26", NULL, nldo1200, LDO_1200, 0),
212 LDO(L27, "8921_l27", NULL, nldo1200, LDO_1200, 0),
213 LDO(L28, "8921_l28", NULL, nldo1200, LDO_1200, 0),
214 LDO(L29, "8921_l29", "8921_l29_pc", pldo, LDO_150, 0),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700215
David Collins6f032ba2011-08-31 14:08:15 -0700216 SMPS(S1, "8921_s1", "8921_s1_pc", smps, SMPS_1500),
217 SMPS(S2, "8921_s2", "8921_s2_pc", smps, SMPS_1500),
218 SMPS(S3, "8921_s3", "8921_s3_pc", smps, SMPS_1500),
219 SMPS(S4, "8921_s4", "8921_s4_pc", smps, SMPS_1500),
220 SMPS(S5, "8921_s5", NULL, ftsmps, SMPS_2000),
221 SMPS(S6, "8921_s6", NULL, ftsmps, SMPS_2000),
222 SMPS(S7, "8921_s7", "8921_s7_pc", smps, SMPS_1500),
223 SMPS(S8, "8921_s8", "8921_s8_pc", smps, SMPS_1500),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700224
David Collins6f032ba2011-08-31 14:08:15 -0700225 LVS(LVS1, "8921_lvs1", "8921_lvs1_pc"),
226 LVS(LVS2, "8921_lvs2", NULL),
227 LVS(LVS3, "8921_lvs3", "8921_lvs3_pc"),
228 LVS(LVS4, "8921_lvs4", "8921_lvs4_pc"),
229 LVS(LVS5, "8921_lvs5", "8921_lvs5_pc"),
230 LVS(LVS6, "8921_lvs6", "8921_lvs6_pc"),
231 LVS(LVS7, "8921_lvs7", "8921_lvs7_pc"),
232 MVS(USB_OTG, "8921_usb_otg", NULL, USB_OTG_SWITCH),
233 MVS(HDMI_MVS, "8921_hdmi_mvs", NULL, HDMI_SWITCH),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700234
David Collins6f032ba2011-08-31 14:08:15 -0700235 NCP(NCP, "8921_ncp", NULL),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700236};
237
David Collins6f032ba2011-08-31 14:08:15 -0700238static const char *pin_func_label[] = {
239 [RPM_VREG_PIN_FN_8960_DONT_CARE] = "don't care",
240 [RPM_VREG_PIN_FN_8960_ENABLE] = "on/off",
241 [RPM_VREG_PIN_FN_8960_MODE] = "HPM/LPM",
242 [RPM_VREG_PIN_FN_8960_SLEEP_B] = "sleep_b",
243 [RPM_VREG_PIN_FN_8960_NONE] = "none",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700244};
245
David Collins6f032ba2011-08-31 14:08:15 -0700246static const char *force_mode_label[] = {
247 [RPM_VREG_FORCE_MODE_8960_NONE] = "none",
248 [RPM_VREG_FORCE_MODE_8960_LPM] = "LPM",
249 [RPM_VREG_FORCE_MODE_8960_AUTO] = "auto",
250 [RPM_VREG_FORCE_MODE_8960_HPM] = "HPM",
251 [RPM_VREG_FORCE_MODE_8960_BYPASS] = "BYP",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700252};
253
David Collins6f032ba2011-08-31 14:08:15 -0700254static const char *power_mode_label[] = {
255 [RPM_VREG_POWER_MODE_8960_HYSTERETIC] = "HYS",
256 [RPM_VREG_POWER_MODE_8960_PWM] = "PWM",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700257};
258
David Collins6f032ba2011-08-31 14:08:15 -0700259static const char *pin_control_label[] = {
260 " D1",
261 " A0",
262 " A1",
263 " A2",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700264};
265
David Collins6f032ba2011-08-31 14:08:15 -0700266static int is_real_id(int id)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700267{
268 return (id >= 0) && (id <= RPM_VREG_ID_PM8921_MAX_REAL);
269}
270
271static int pc_id_to_real_id(int id)
272{
273 int real_id;
274
David Collins31a9fcd2012-08-31 12:07:27 -0700275 if (id >= RPM_VREG_ID_PM8921_L1_PC && id <= RPM_VREG_ID_PM8921_L12_PC)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700276 real_id = id - RPM_VREG_ID_PM8921_L1_PC;
David Collins31a9fcd2012-08-31 12:07:27 -0700277 else if (id >= RPM_VREG_ID_PM8921_L14_PC
278 && id <= RPM_VREG_ID_PM8921_L23_PC)
279 real_id = id - RPM_VREG_ID_PM8921_L14_PC
280 + RPM_VREG_ID_PM8921_L14;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700281 else if (id >= RPM_VREG_ID_PM8921_L29_PC
282 && id <= RPM_VREG_ID_PM8921_S4_PC)
283 real_id = id - RPM_VREG_ID_PM8921_L29_PC
284 + RPM_VREG_ID_PM8921_L29;
285 else if (id >= RPM_VREG_ID_PM8921_S7_PC
286 && id <= RPM_VREG_ID_PM8921_LVS1_PC)
287 real_id = id - RPM_VREG_ID_PM8921_S7_PC + RPM_VREG_ID_PM8921_S7;
288 else
289 real_id = id - RPM_VREG_ID_PM8921_LVS3_PC
290 + RPM_VREG_ID_PM8921_LVS3;
291
292 return real_id;
293}
294
David Collins6f032ba2011-08-31 14:08:15 -0700295static struct vreg_config config = {
296 .vregs = vregs,
297 .vregs_len = ARRAY_SIZE(vregs),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700298
David Collins6f032ba2011-08-31 14:08:15 -0700299 .vreg_id_min = RPM_VREG_ID_PM8921_L1,
300 .vreg_id_max = RPM_VREG_ID_PM8921_MAX,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700301
David Collins6f032ba2011-08-31 14:08:15 -0700302 .pin_func_none = RPM_VREG_PIN_FN_8960_NONE,
303 .pin_func_sleep_b = RPM_VREG_PIN_FN_8960_SLEEP_B,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700304
David Collins6f032ba2011-08-31 14:08:15 -0700305 .mode_lpm = REGULATOR_MODE_IDLE,
306 .mode_hpm = REGULATOR_MODE_NORMAL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700307
David Collins6f032ba2011-08-31 14:08:15 -0700308 .set_points = all_set_points,
309 .set_points_len = ARRAY_SIZE(all_set_points),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700310
David Collins6f032ba2011-08-31 14:08:15 -0700311 .label_pin_ctrl = pin_control_label,
312 .label_pin_ctrl_len = ARRAY_SIZE(pin_control_label),
313 .label_pin_func = pin_func_label,
314 .label_pin_func_len = ARRAY_SIZE(pin_func_label),
315 .label_force_mode = force_mode_label,
316 .label_force_mode_len = ARRAY_SIZE(force_mode_label),
317 .label_power_mode = power_mode_label,
318 .label_power_mode_len = ARRAY_SIZE(power_mode_label),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700319
David Collins6f032ba2011-08-31 14:08:15 -0700320 .is_real_id = is_real_id,
321 .pc_id_to_real_id = pc_id_to_real_id,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700322};
323
David Collins6f032ba2011-08-31 14:08:15 -0700324struct vreg_config *get_config_8960(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700325{
David Collins6f032ba2011-08-31 14:08:15 -0700326 return &config;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700327}
David Collins2ac36d52012-10-02 14:56:21 -0700328
329struct vreg_config *get_config_8960_pm8917(void)
330{
331 int i;
332
333 /*
334 * PM8917 regulators L24, L25, L26, L27, and L28 require CXO to be ON
335 * while they are enabled. These same regulators on PM8921 do not
336 * require CXO to be ON. Therefore, set the require_cxo flag for these
337 * regulators only when using PM8917.
338 *
339 * Do not apply the workaround to L24 (VDD_MX) because it is always on
340 * and using the TCXO workaround with it would result in additional
341 * latency during every Krait upscaling event.
342 */
343 for (i = 0; i < ARRAY_SIZE(vregs); i++) {
344 switch (vregs[i].id) {
345 case RPM_VREG_ID_PM8921_L25:
346 case RPM_VREG_ID_PM8921_L26:
347 case RPM_VREG_ID_PM8921_L27:
348 case RPM_VREG_ID_PM8921_L28:
349 vregs[i].requires_cxo = true;
350 default:
351 break;
352 }
353 }
354
355 return &config;
356}