Skip to content

Commit b7f3b89

Browse files
wensbroonie
authored andcommitted
regulator: mt6358: Make MT6366 vcn18 LDO configurable
The VCN18 regulator on the MT6366 (only) actually has a wide configurable range of voltages, even though its name suggests a fixed output voltage. Convert it from a fixed LDO to a configurable LDO. Its range of settings is the same as the VM18 regulator, which is missing and will be added in a subsequent patch. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230928085537.3246669-10-wenst@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 0c3697b commit b7f3b89

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

drivers/regulator/mt6358-regulator.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,27 @@ static const struct linear_range vldo28_ranges[] = {
325325
REGULATOR_LINEAR_RANGE(3000000, 0, 10, 10000),
326326
};
327327

328+
static const unsigned int mt6366_vcn18_vm18_selectors[] = {
329+
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
330+
static const struct linear_range mt6366_vcn18_vm18_ranges[] = {
331+
REGULATOR_LINEAR_RANGE(600000, 0, 10, 10000),
332+
REGULATOR_LINEAR_RANGE(700000, 0, 10, 10000),
333+
REGULATOR_LINEAR_RANGE(800000, 0, 10, 10000),
334+
REGULATOR_LINEAR_RANGE(900000, 0, 10, 10000),
335+
REGULATOR_LINEAR_RANGE(1000000, 0, 10, 10000),
336+
REGULATOR_LINEAR_RANGE(1100000, 0, 10, 10000),
337+
REGULATOR_LINEAR_RANGE(1200000, 0, 10, 10000),
338+
REGULATOR_LINEAR_RANGE(1300000, 0, 10, 10000),
339+
REGULATOR_LINEAR_RANGE(1400000, 0, 10, 10000),
340+
REGULATOR_LINEAR_RANGE(1500000, 0, 10, 10000),
341+
REGULATOR_LINEAR_RANGE(1600000, 0, 10, 10000),
342+
REGULATOR_LINEAR_RANGE(1700000, 0, 10, 10000),
343+
REGULATOR_LINEAR_RANGE(1800000, 0, 10, 10000),
344+
REGULATOR_LINEAR_RANGE(1900000, 0, 10, 10000),
345+
REGULATOR_LINEAR_RANGE(2000000, 0, 10, 10000),
346+
REGULATOR_LINEAR_RANGE(2100000, 0, 10, 10000),
347+
};
348+
328349
static unsigned int mt6358_map_mode(unsigned int mode)
329350
{
330351
return mode == MT6397_BUCK_MODE_AUTO ?
@@ -547,7 +568,6 @@ static const struct mt6358_regulator_info mt6366_regulators[] = {
547568
MT6358_LDO_VRF12_CON0, 0, 1200000),
548569
MT6366_REG_FIXED("vio18", VIO18,
549570
MT6358_LDO_VIO18_CON0, 0, 1800000),
550-
MT6366_REG_FIXED("vcn18", VCN18, MT6358_LDO_VCN18_CON0, 0, 1800000),
551571
MT6366_REG_FIXED("vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000),
552572
MT6366_REG_FIXED("vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000),
553573
MT6366_REG_FIXED("vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000),
@@ -580,6 +600,8 @@ static const struct mt6358_regulator_info mt6366_regulators[] = {
580600
MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00),
581601
MT6366_LDO("vsim2", VSIM2, vsim,
582602
MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00),
603+
MT6366_LDO("vcn18", VCN18, mt6366_vcn18_vm18,
604+
MT6358_LDO_VCN18_CON0, 0, MT6358_VCN18_ANA_CON0, 0xf00),
583605
MT6366_LDO1("vsram-proc11", VSRAM_PROC11, 500000, 1293750, 6250,
584606
MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f),
585607
MT6366_LDO1("vsram-others", VSRAM_OTHERS, 500000, 1293750, 6250,

0 commit comments

Comments
 (0)