pinctrl: qcom: lpass-lpi: Add ability to use custom pin offsets
authorNickolay Goppen <setotau@mainlining.org>
Mon, 8 Sep 2025 12:28:44 +0000 (15:28 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 10 Sep 2025 13:35:41 +0000 (15:35 +0200)
commit18d676ac0cce3e3aaa06f29553e53134e30c5f61
treebde7707ed31b1c24c52cd809a3e7c48c7a8f31be
parent87ebcd8baebf93b9d763dba5ee31e8fda62daec6
pinctrl: qcom: lpass-lpi: Add ability to use custom pin offsets

By default pin_offset is calculated by formula: LPI_TLMM_REG_OFFSET * pin_id.
However not all platforms are using this pin_offset formula (e.g. SDM660 LPASS
LPI uses a predefined array of offsets [1]), so extend lpi_pingroup struct
with pin_offset field, introduce extended LPI_PINGROUP_OFFSET macro with
pin_offet field and introduce LPI_FLAG_USE_PREDEFINED_PIN_OFFSET flag.
This adds an ability to use predefined offset for pin if it exists.

[1] https://git.codelinaro.org/clo/la/kernel/msm-4.4/-/blob/LA.UM.7.2.c27-07400-sdm660.0/drivers/pinctrl/qcom/pinctrl-lpi.c#L107

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Nickolay Goppen <setotau@mainlining.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
drivers/pinctrl/qcom/pinctrl-lpass-lpi.h