pinctrl: qcom: add multi TLMM region option parameter
authorYuanjie Yang <quic_yuanjiey@quicinc.com>
Tue, 24 Jun 2025 09:06:00 +0000 (17:06 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 3 Jul 2025 21:44:21 +0000 (23:44 +0200)
commit56ffb63749f4a1e88c282b763c458f3ed73d8c27
tree36931e1ae81169ede613149878ddd028ff123d70
parent4ab401099d4764d1479914fd4c8b9876d5b3aca1
pinctrl: qcom: add multi TLMM region option parameter

Add support for selecting multiple TLMM regions using the
tlmm-test tool.
The current implementation only selects the TLMM Node region
0, which can lead to incorrect region selection.

QCS 615 TLMM Node dts reg:
tlmm: pinctrl@3100000 {
compatible = "qcom,qcs615-tlmm";
reg = <0x0 0x03100000 0x0 0x300000>,
      <0x0 0x03500000 0x0 0x300000>,
      <0x0 0x03d00000 0x0 0x300000>;
reg-names = "east",
    "west",
    "south";

QCS615 gpio57 is in the south region with an offset of 0x39000,
and its address is 0x3d39000. However, the default region selection
is region 0 (east region), resulting in a wrong calculated address
of 0x3139000.

Add a tlmm option parameter named tlmm_reg_name to select the region.
If the user does not input the parameter, the default region is 0.

Signed-off-by: Yuanjie Yang <quic_yuanjiey@quicinc.com>
Link: https://lore.kernel.org/20250624090600.91063-1-quic_yuanjiey@quicinc.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/qcom/tlmm-test.c