Re: [PATCH 3/6] usb: typec: add Qualcomm PMI8998 role-switch driver

From: Krzysztof Kozlowski

Date: Tue May 19 2026 - 07:09:15 EST


On Tue, May 19, 2026 at 01:22:48AM +0500, taygoth wrote:
> The Qualcomm PMI8998 PMIC integrates a USB Type-C detection block in
> its SMB2 charger USBIN region at offset 0x1300. The block performs CC
> sensing, debounce and Rp/Rd resolution in silicon and reports role
> changes through a single consolidated "type-c-change" interrupt.
>
> This driver reads TYPE_C_STATUS_4 on probe and on every interrupt,
> decodes the hardware-detected role (host / device / none) and pushes
> it to a usb_role_switch consumer (typically dwc3) so the controller
> can flip between peripheral and host on cable orientation change. An
> optional VBUS supply regulator is toggled on USB_ROLE_HOST transitions
> so bus-powered downstream peripherals can be powered.
>
> No software TCPM state machine is used because the hardware handles
> the Type-C protocol natively, and the PMI8998 interrupt topology does
> not expose the granular per-event signals the TCPM code path expects.
> Power Delivery is not implemented in this driver; the PMI8998 PDPHY
> block at offset 0x1700 (register-identical to PM8150B) can be wired
> up by a separate driver later if PD negotiation is required.
>
> This enables USB host mode on the OnePlus 6 (enchilada), OnePlus 6T
> (fajita), Xiaomi Poco F1 (beryllium), SHIFT 6mq (axolotl) and other
> SDM845-based phones that use the PMI8998 as their second PMIC.
>
> Signed-off-by: taygoth <taygoth@xxxxxxxxx>

Incomplete identity.

> ---
> drivers/usb/typec/Kconfig | 17 ++
> drivers/usb/typec/Makefile | 1 +
> drivers/usb/typec/qcom_pmi8998_typec.c | 213 +++++++++++++++++++++++++
> 3 files changed, 231 insertions(+)
> create mode 100644 drivers/usb/typec/qcom_pmi8998_typec.c

Do not mix up subsystems which take entire sets in one patchset. USB
patches should be split.

Best regards,
Krzysztof