| From: |
| Fenglin Wu <fenglin.wu-AT-oss.qualcomm.com> |
| To: |
| linux-arm-msm-AT-vger.kernel.org, Bjorn Andersson <andersson-AT-kernel.org>, Konrad Dybcio <konradybcio-AT-kernel.org>, Linus Walleij <linusw-AT-kernel.org>, Rob Herring <robh-AT-kernel.org>, Krzysztof Kozlowski <krzk+dt-AT-kernel.org>, Conor Dooley <conor+dt-AT-kernel.org>, Bartosz Golaszewski <brgl-AT-kernel.org> |
| Subject: |
| [PATCH 0/4] pinctrl: qcom: spmi-gpio: Add bidirectional level-shifter function support |
| Date: |
| Wed, 27 May 2026 02:22:43 -0700 |
| Message-ID: |
| <20260527-pinctrl-level-shifter-v1-0-1965461d0a7c@oss.qualcomm.com> |
| Cc: |
| David Collins <david.collins-AT-oss.qualcomm.com>, Subbaraman Narayanamurthy <subbaraman.narayanamurthy-AT-oss.qualcomm.com>, Kamal Wadhwa <kamal.wadhwa-AT-oss.qualcomm.com>, Maulik Shah <maulik.shah-AT-oss.qualcomm.com>, kernel-AT-oss.qualcomm.com, linux-kernel-AT-vger.kernel.org, linux-gpio-AT-vger.kernel.org, devicetree-AT-vger.kernel.org, Fenglin Wu <fenglin.wu-AT-oss.qualcomm.com> |
| Archive-link: |
| Article |
The PMH0101 PMIC introduces BIDIR_LVL_SHIFTER modules that provide
bidirectional voltage translation between 1.2 V and 1.8 V power
domains, targeting open-drain signal buses such as I2C. Each level
shifter shares its two physical pins with a corresponding pair of GPIO
modules, and its enable state is centrally managed by AOP firmware as
a shared RPMh "XOB" resource.
This series adds kernel support for controlling these level shifters
through the pinctrl subsystem. Patches are ordered from infrastructure
to driver to bindings:
Patch 1 (soc: qcom: rpmh) extends the RPMh driver to accept write
commands from devices that are not children of the RPMh controller.
The existing write path assumes the caller is a child of the RSC device;
however, the SPMI GPIO driver sits under the SPMI controller bus. Two
new APIs are introduced — rpmh_get_ctrlr_dev() for resolving the
controller from a "qcom,rpmh" DT phandle, and rpmh_write_ctrlr() /
rpmh_write_async_ctrlr() which accept the controller device pointer
directly rather than deriving it through the device parent chain.
Patch 2 (dt-bindings) documents the new "level-shifter" function, the
qcom,1p2v-1p8v-ls-en property, the qcom,rpmh phandle, and the
qcom,pmic-id string required on pmh0101 nodes. The pmh0101 conditional
block is split out from pmih0108 and given its own required properties.
Patch 3 (pinctrl: qcom: spmi-gpio, rearchitect) refactors the driver's
group and function registration to use the generic pinctrl group and
function APIs (pinctrl_generic_add_group, pinmux_generic_add_function).
The previous design treated every pin as its own group with access to
all functions. The new design allows multi-pin groups with restricted
function sets, which is a prerequisite for exposing the level-shifter
function that is tied to specific GPIO pairs only.
Patch 4 (pinctrl: qcom: spmi-gpio, level-shifter) builds on the above
to introduce the "level-shifter" function. When selected, both GPIO
pads in the pair are disabled (high-impedance), and the RPMh XOB vote
for the level shifter is controlled separately via the new
qcom,1p2v-1p8v-ls-en pinconf parameter, allowing enable and disable
to be represented as distinct pinctrl states with the same function and
group.
With all these changes, the BIDIR_LVL_SHIFTER in PMH0101 could be
controlled with following settings:
&pmh0101_gpios {
pmh0101-ls1-en {
groups = "gpio11, gpio12";
function = "level-shifter";
qcom,1p2v-1p8v-ls-en = <1>;
};
pmh0101-ls1-dis {
groups = "gpio11, gpio12";
function = "level-shifter";
qcom,1p2v-1p8v-ls-en = <0>;
};
};
Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
---
Fenglin Wu (4):
soc: qcom: rpmh: Allow non-child devices to issue write commands
dt-bindings: pinctrl: qcom,pmic-gpio: Add level-shifter function
pinctrl: qcom: spmi-gpio: Rearchitect for flexible group support
pinctrl: qcom: spmi-gpio: Add level-shifter function support
.../bindings/pinctrl/qcom,pmic-gpio.yaml | 69 +-
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 755 ++++++++++++++++-----
drivers/soc/qcom/rpmh.c | 161 ++++-
include/dt-bindings/pinctrl/qcom,pmic-gpio.h | 1 +
include/soc/qcom/rpmh.h | 21 +
5 files changed, 807 insertions(+), 200 deletions(-)
---
base-commit: b8f192cec7dcb2e4f04ee57ab78d51777b0a5729
change-id: 20260527-pinctrl-level-shifter-929b286f583d
Best regards,
--
Fenglin Wu <fenglin.wu@oss.qualcomm.com>