regulator: Fixes for v6.13

A couple of fixes that came in during the merge window, plus
 documetation of a new device ID for the Qualcomm LABIBB driver.  There's
 a core fix for the rarely used current constraints and a fix for the
 Qualcomm RPMH driver which had described only one of the two voltage
 ranges that the hardware could control, creating a potential
 incompatibility with the configuration left by firmware.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmdIcWQACgkQJNaLcl1U
 h9DfPAf/T/w7ZNWOR52sK8et3itHVVu3YSxB92fMz/CdesUgApi2Q6Py/gw1sduQ
 mY6vUd3aLkTI1Qi+XifeoRKOdRud0GRcgVILdg0J/KgzJ7EXEJ4pxE+uLE6Etuop
 TGD9CY/rsX92vk9aOSPBPXfNtYB8JfBH4EgJSmHYl3V3kNe1jA32IbGUOVahA+vW
 r9M1M40fuE6AsvfX47oN2mird9HyRjTRwwtrMzR8pqq3AZ8CRpPhngaxVpotmGOZ
 UEaJj83WXKtja9iezYTQYmhj9yfw/c7A4UdqUFjAeScRHYxl3U+kue8MpjND1DQZ
 kQfsgFoYLN6CTBhnognp1oyovixztQ==
 =Lhu/
 -----END PGP SIGNATURE-----

Merge tag 'regulator-fix-v6.13-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "A couple of fixes that came in during the merge window, plus
  documetation of a new device ID for the Qualcomm LABIBB driver.

  There's a core fix for the rarely used current constraints and a fix
  for the Qualcomm RPMH driver which had described only one of the two
  voltage ranges that the hardware could control, creating a potential
  incompatibility with the configuration left by firmware"

* tag 'regulator-fix-v6.13-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: core: Ignore unset max_uA constraints in current limit check
  dt-bindings: regulator: qcom-labibb-regulator: document the pmi8950 labibb regulator
  regulator: qcom-rpmh: Update ranges for FTSMPS525
This commit is contained in:
Linus Torvalds 2024-11-28 09:40:53 -08:00
commit d83ec4afd2
3 changed files with 44 additions and 49 deletions

View File

@ -16,7 +16,12 @@ description:
properties:
compatible:
const: qcom,pmi8998-lab-ibb
oneOf:
- const: qcom,pmi8998-lab-ibb
- items:
- enum:
- qcom,pmi8950-lab-ibb
- const: qcom,pmi8998-lab-ibb
lab:
type: object

View File

@ -497,7 +497,8 @@ static int regulator_check_current_limit(struct regulator_dev *rdev,
return -EPERM;
}
if (*max_uA > rdev->constraints->max_uA)
if (*max_uA > rdev->constraints->max_uA &&
rdev->constraints->max_uA)
*max_uA = rdev->constraints->max_uA;
if (*min_uA < rdev->constraints->min_uA)
*min_uA = rdev->constraints->min_uA;

View File

@ -843,26 +843,15 @@ static const struct rpmh_vreg_hw_data pmic5_ftsmps520 = {
.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
};
static const struct rpmh_vreg_hw_data pmic5_ftsmps525_lv = {
static const struct rpmh_vreg_hw_data pmic5_ftsmps525 = {
.regulator_type = VRM,
.ops = &rpmh_regulator_vrm_ops,
.voltage_ranges = (struct linear_range[]) {
REGULATOR_LINEAR_RANGE(300000, 0, 267, 4000),
REGULATOR_LINEAR_RANGE(1376000, 268, 438, 8000),
},
.n_linear_ranges = 1,
.n_voltages = 268,
.pmic_mode_map = pmic_mode_map_pmic5_smps,
.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
};
static const struct rpmh_vreg_hw_data pmic5_ftsmps525_mv = {
.regulator_type = VRM,
.ops = &rpmh_regulator_vrm_ops,
.voltage_ranges = (struct linear_range[]) {
REGULATOR_LINEAR_RANGE(600000, 0, 267, 8000),
},
.n_linear_ranges = 1,
.n_voltages = 268,
.n_linear_ranges = 2,
.n_voltages = 439,
.pmic_mode_map = pmic_mode_map_pmic5_smps,
.of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode,
};
@ -1190,12 +1179,12 @@ static const struct rpmh_vreg_init_data pm8550_vreg_data[] = {
};
static const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = {
RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525_lv, "vdd-s1"),
RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525_lv, "vdd-s2"),
RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525_lv, "vdd-s3"),
RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525_lv, "vdd-s4"),
RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525_lv, "vdd-s5"),
RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525_mv, "vdd-s6"),
RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525, "vdd-s1"),
RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525, "vdd-s2"),
RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525, "vdd-s3"),
RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525, "vdd-s4"),
RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525, "vdd-s5"),
RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525, "vdd-s6"),
RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo515, "vdd-l1"),
RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo515, "vdd-l2"),
RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l3"),
@ -1203,14 +1192,14 @@ static const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = {
};
static const struct rpmh_vreg_init_data pm8550ve_vreg_data[] = {
RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525_lv, "vdd-s1"),
RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525_lv, "vdd-s2"),
RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525_lv, "vdd-s3"),
RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525_mv, "vdd-s4"),
RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525_lv, "vdd-s5"),
RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525_lv, "vdd-s6"),
RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps525_lv, "vdd-s7"),
RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps525_lv, "vdd-s8"),
RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525, "vdd-s1"),
RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525, "vdd-s2"),
RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525, "vdd-s3"),
RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525, "vdd-s4"),
RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525, "vdd-s5"),
RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525, "vdd-s6"),
RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps525, "vdd-s7"),
RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps525, "vdd-s8"),
RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo515, "vdd-l1"),
RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo515, "vdd-l2"),
RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l3"),
@ -1218,14 +1207,14 @@ static const struct rpmh_vreg_init_data pm8550ve_vreg_data[] = {
};
static const struct rpmh_vreg_init_data pmc8380_vreg_data[] = {
RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525_lv, "vdd-s1"),
RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525_lv, "vdd-s2"),
RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525_lv, "vdd-s3"),
RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525_mv, "vdd-s4"),
RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525_lv, "vdd-s5"),
RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525_lv, "vdd-s6"),
RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps525_lv, "vdd-s7"),
RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps525_lv, "vdd-s8"),
RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525, "vdd-s1"),
RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525, "vdd-s2"),
RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525, "vdd-s3"),
RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525, "vdd-s4"),
RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525, "vdd-s5"),
RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525, "vdd-s6"),
RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps525, "vdd-s7"),
RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps525, "vdd-s8"),
RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo515, "vdd-l1"),
RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo515, "vdd-l2"),
RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l3"),
@ -1409,16 +1398,16 @@ static const struct rpmh_vreg_init_data pmx65_vreg_data[] = {
};
static const struct rpmh_vreg_init_data pmx75_vreg_data[] = {
RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525_lv, "vdd-s1"),
RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525_lv, "vdd-s2"),
RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525_lv, "vdd-s3"),
RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525_mv, "vdd-s4"),
RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525_lv, "vdd-s5"),
RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525_lv, "vdd-s6"),
RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps525_lv, "vdd-s7"),
RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps525_lv, "vdd-s8"),
RPMH_VREG("smps9", "smp%s9", &pmic5_ftsmps525_lv, "vdd-s9"),
RPMH_VREG("smps10", "smp%s10", &pmic5_ftsmps525_lv, "vdd-s10"),
RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525, "vdd-s1"),
RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525, "vdd-s2"),
RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525, "vdd-s3"),
RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525, "vdd-s4"),
RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525, "vdd-s5"),
RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525, "vdd-s6"),
RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps525, "vdd-s7"),
RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps525, "vdd-s8"),
RPMH_VREG("smps9", "smp%s9", &pmic5_ftsmps525, "vdd-s9"),
RPMH_VREG("smps10", "smp%s10", &pmic5_ftsmps525, "vdd-s10"),
RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo515, "vdd-l1"),
RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo515, "vdd-l2-18"),
RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l3"),