]> git.ipfire.org Git - thirdparty/linux.git/commit
regulator: rpmh-regulator: Add support for new resource name format
authorKamal Wadhwa <kamal.wadhwa@oss.qualcomm.com>
Thu, 18 Sep 2025 09:27:03 +0000 (14:57 +0530)
committerMark Brown <broonie@kernel.org>
Wed, 15 Oct 2025 19:12:50 +0000 (20:12 +0100)
commit6a8cdef7dc2a4c0dbde3f7d7100b3d99712a766b
tree597877d7218ffe01526962b7984a41ad035b8778
parent1356c98ef911e14ccfaf374800840ce5bdcb3bbd
regulator: rpmh-regulator: Add support for new resource name format

Currently rpmh-regulator resource name inside CMD-DB follows this
format: `^(ldo|smp|bob|vs)[a-n][1-9][0-9]?$`

(eg - ldob11, smpa2, bobc1 etc)

Here `[a-n]` in the resource name signifies the `pmic-id`.
However, newer firmware follows a different format that also
includes the `bus_id` as well in the resource name.

New format:
`^(L|S|B)[1-9][0-9]?[A-N]_E[0-3]$`

(eg - L11B_E1, S2A_E0, B1C_E0 etc)

Here `_E[0-3]` at the end is the `bus_id`, and upper case `[A-N]`
is used to denote `pmic-id`, while the regulator `(ldo|smp|bob)`
is replaced with their initials in upper case `(L|S|B|VA)`.

To handle this properly, do the following:

- Remove the `resource_name` member from vreg init data

- Add `index` and `regulator_hw_type` new members, which will
contain the index number and the regulator hardware type
(SMPS/LDO/BOB/VS) which can be combined with the pmic-id read
from the devicetree to generate the resource_name.

- Choose new resource name format if `pmic-id` contains `_E`
in it, else fallback to old format.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Kamal Wadhwa <kamal.wadhwa@oss.qualcomm.com>
Link: https://patch.msgid.link/20250918-glymur-rpmh-regulator-driver-v3-3-184c09678be3@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/qcom-rpmh-regulator.c