summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorAlexandre Mergnat <amergnat@baylibre.com>2026-11-02 15:54:18 +0000
committerMark Brown <broonie@kernel.org>2026-11-02 18:02:21 +0000
commita8d72f246edb9323f6e0ae8283676a323b7847eb (patch)
tree0b775e3bbe1365bd83d464f271dbae9946471bfe /tools/lib/python
parent7318d3833067e4edb7c2a9bc244e8818b1597ff2 (diff)
regulator: mt6363: Fix VEMC voltage selection
VEMC encodes its voltage as a range and a trim value. The custom getter looks up the range with if (rdesc->linear_range_selectors_bitfield[range] != calsel) so it stops at the first non-matching range and the reported voltage is wrong for every range setting. With hardware trap 1, the custom getter and setter apply MT6363_RG_VEMC_VOSEL_1_MASK, the trap 1 range field, to the trap 0 trim register and keep the trap 0 range field. Voltage changes are then not applied and the reported voltage does not reflect the trap 1 settings. Apart from the trap handling, both callbacks reimplement the regulator core pickable regmap helpers, which work for VEMC once the descriptor holds the range field and trim register of the hardware trap. Select that field and register at probe and use the helpers instead of fixing the copies. Keep the setter as a wrapper for the TMA unlock and relock around the write, which the helper does not do. A trap value other than 0 or 1, or a failed trap read, now fails the probe instead of the VEMC voltage get and set. Fixes: 3c36965df808 ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators") Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com> Link: https://patch.msgid.link/20261102-rgp-67-mt6363-regulator-fixes-v1-2-420789a3113e@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions