Re: [PATCH 0/6] usb: typec: add Qualcomm PMI8998 USB Type-C role-switch support
From: Konrad Dybcio
Date: Tue May 19 2026 - 07:39:40 EST
On 5/18/26 10:22 PM, taygoth wrote:
> This series adds USB Type-C role-switch support for the PMI8998 PMIC
> used on SDM845 phones (OnePlus 6/6T, Xiaomi Poco F1, SHIFT 6mq), which
> have been locked to USB peripheral mode under mainline kernels until
> now.
>
> The PMI8998 SMB2 charger block integrates a Type-C detection unit at
> SPMI offset 0x1300 that performs CC sensing, debounce and Rp/Rd
> resolution entirely in hardware. The state is exposed through the
> TYPE_C_STATUS_4 register and reported via a single consolidated
> "type-c-change" interrupt. The new driver reads that status on every
> interrupt and pushes the negotiated role to a usb_role_switch consumer
> (dwc3), enabling automatic peripheral/host switching on cable change.
> Because the hardware handles the Type-C state machine natively, no
> software TCPM port manager is required.
>
> The Type-C block shares the SMB2 USBIN region with the already
> mainlined qcom_pmi8998-charger driver. The two coexist on the shared
> SPMI regmap without write conflict: the typec driver only reads
> TYPE_C_STATUS_* and touches the IRQ enable bits at offsets
> 0x130b-0x130f and 0x1367-0x1368.
>
> The PMI8998 USB OTG VBUS boost converter at offset 0x1100 has the
> same CMD_OTG / OTG_CFG / OTG_CURRENT_LIMIT register layout as PM8150B,
> so the existing drivers/regulator/qcom_usb_vbus-regulator can drive it
> through a compatible cascade -- only the DT binding needs the new
> compatible string added.
>
> Power Delivery is not implemented. The PMI8998 PDPHY block at offset
> 0x1700 is register-identical to PM8150B and could be wired through
> the existing drivers/usb/typec/tcpm/qcom code in a follow-up if PD
> negotiation becomes a requirement.
>
> Tested-on: OnePlus 6T (sdm845-oneplus-fajita) running Mobian
> 6.12-sdm845.
FWIW 6.12 has been released 2 years ago and the sdm845 fork contains
a lot of unrelated changes. Please give this a test on linux-next/master
Konrad