Skip to content

Commit

Permalink
lk2nd: hw: regulator: gpl: Add PM8937 support
Browse files Browse the repository at this point in the history
PM8937 PMIC has 4 HFSMPS, 2 FTSMPS2.5 (for controlling APC voltage)
and 23 LDO regulators.

The PM8937 Power IC can be found in MSM8917/8937/8940, but can also
be found in APQ8017.

Add configuration for this chip.
  • Loading branch information
Danct12 committed Nov 3, 2023
1 parent 49670b3 commit c768a7c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions lk2nd/hw/regulator/gpl/qcom-spmi-pmic.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define PM8998_SUBTYPE 0x14
#define PMI8998_SUBTYPE 0x15
#define PM8005_SUBTYPE 0x18
#define PM8937_SUBTYPE 0x19
#define PM660L_SUBTYPE 0x1a
#define PM660_SUBTYPE 0x1b
#define PM8150_SUBTYPE 0x1e
Expand Down
34 changes: 34 additions & 0 deletions lk2nd/hw/regulator/gpl/qcom_spmi-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -2306,6 +2306,39 @@ static const struct spmi_regulator_data pm8941_regulators[] = {
{ }
};

static const struct spmi_regulator_data pm8937_regulators[] = {
{ "s1", 0x1400, "vdd_s1", },
{ "s2", 0x1700, "vdd_s2", },
{ "s3", 0x1a00, "vdd_s3", },
{ "s4", 0x1d00, "vdd_s4", },
{ "s5", 0x2000, "vdd_s5", },
{ "s6", 0x2300, "vdd_s6", },
{ "l1", 0x4000, "vdd_l1_l19", },
{ "l2", 0x4100, "vdd_l2_l23", },
{ "l3", 0x4200, "vdd_l3", },
{ "l4", 0x4300, "vdd_l4_l5_l6_l7_l16", },
{ "l5", 0x4400, "vdd_l4_l5_l6_l7_l16", },
{ "l6", 0x4500, "vdd_l4_l5_l6_l7_l16", },
{ "l7", 0x4600, "vdd_l4_l5_l6_l7_l16", },
{ "l8", 0x4700, "vdd_l8_l11_l12_l17_l22", },
{ "l9", 0x4800, "vdd_l9_l10_l13_l14_l15_l18", },
{ "l10", 0x4900, "vdd_l9_l10_l13_l14_l15_l18", },
{ "l11", 0x4a00, "vdd_l8_l11_l12_l17_l22", },
{ "l12", 0x4b00, "vdd_l8_l11_l12_l17_l22", },
{ "l13", 0x4c00, "vdd_l9_l10_l13_l14_l15_l18", },
{ "l14", 0x4d00, "vdd_l9_l10_l13_l14_l15_l18", },
{ "l15", 0x4e00, "vdd_l9_l10_l13_l14_l15_l18", },
{ "l16", 0x4f00, "vdd_l4_l5_l6_l7_l16", },
{ "l17", 0x5000, "vdd_l8_l11_l12_l17_l22", },
{ "l18", 0x5100, "vdd_l9_l10_l13_l14_l15_l18", },
{ "l19", 0x5200, "vdd_l1_l19", },
{ "l20", 0x5300, "vdd_l20_l21", },
{ "l21", 0x5400, "vdd_l20_l21", },
{ "l22", 0x5500, "vdd_l8_l11_l12_l17_l22", },
{ "l23", 0x5600, "vdd_l2_l23", },
{ }
};

static const struct spmi_regulator_data pm8950_regulators[] = {
{ "s1", 0x1400, "vdd_s1", },
{ "s2", 0x1700, "vdd_s2", },
Expand Down Expand Up @@ -2586,6 +2619,7 @@ static const struct spmi_regulator_match qcom_spmi_regulator_match[] = {
{ .subtype = PM8226_SUBTYPE, .sid = 1, .data = pm8226_regulators },
{ .subtype = PM8841_SUBTYPE, .sid = 5, .data = pm8841_regulators },
{ .subtype = PM8916_SUBTYPE, .sid = 1, .data = pm8916_regulators },
{ .subtype = PM8937_SUBTYPE, .sid = 1, .data = pm8937_regulators },
{ .subtype = PM8941_SUBTYPE, .sid = 1, .data = pm8941_regulators },
{ .subtype = PM8950_SUBTYPE, .sid = 1, .data = pm8950_regulators },
{ .subtype = PM8994_SUBTYPE, .sid = 1, .data = pm8994_regulators },
Expand Down

0 comments on commit c768a7c

Please sign in to comment.