Commit 8c67d427 authored by Kamal Wadhwa's avatar Kamal Wadhwa Committed by Treehugger Robot
Browse files

UPSTREAM: regulator: pm8008: fix probe failure due to negative voltage selector



In the current design, the `pm8008_regulator_get_voltage_sel()` callback
can return a negative value if the raw voltage value is read as 0 uV from
the PMIC HW register. This can cause the probe to fail when the
`machine_constraints_voltage()` check is called during the regulator
registration flow.

Fix this by using the helper `regulator_map_voltage_linear_range()` to
convert the raw value to a voltage selector inside the mentioned get
voltage selector function. This ensures that the value returned is always
within the defined range.

Bug: 450452014
Bug: 452256518
Change-Id: Ib895e3ae9107b8e2b4e36cfecea26aace6e1ee80
Signed-off-by: default avatarKamal Wadhwa <kamal.wadhwa@oss.qualcomm.com>
Message-ID: <20250823-pm8008-negitive-selector-v1-1-52b026a4b5e8@quicinc.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
(cherry picked from commit ef3e9c91)
Signed-off-by: default avatarSrinivasarao Pathipati <quic_c_spathi@quicinc.com>
(cherry picked from commit a6599738)
parent ddd07215
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment