[PATCH v5 0/7] phy: cpcap-usb: improve charger detection and export cable state

From: Ivaylo Dimitrov

Date: Sat Jul 11 2026 - 16:42:53 EST


The Motorola CPCAP USB PHY contains the hardware state machine used for
USB cable detection. Besides distinguishing USB peripheral and host
connections, it can also detect dedicated charging ports (DCP).

This series extends the CPCAP USB PHY driver to detect DCP connections
and export the detected cable state through the Extcon framework. It also
makes the idle UART mode optional, allowing the PHY to remain in its
default USB detection configuration unless UART support is explicitly
requested.

The series updates the Device Tree binding for the optional charger
detection interrupt and the optional "safe" pinctrl state. Corresponding
mapphone Device Tree entries are added to describe the charger detection
interrupt and enable the safe pinctrl state.

The charger detection interrupt is not currently used by the driver.
However, it is added to the binding and Device Tree because it describes
a hardware capability of the CPCAP USB PHY.

The series has been tested on Motorola Droid 4 hardware.

Changes in v5:
- fix race in remove()
- fix commit message of PATCH 2
- re-schedule detect_work if DCP/SDP modes cannot be reliably detected
- fully configure PHY registers in DCP mode
- fix extcon intermediate cable states

Changes in v4:
- make charger detection interrupt optional
- make driver functional without charger detection interrupt
- add bindings and Device Tree for 'safe' pinctrl mode
- use 'safe' pinctrl state before switching PHY modes

Changes in v3:
- Drop "phy: cpcap-usb: Prevent line glitches from triggering sysrq"
- Fix DT schema interrupts order
- Fix boot cable detection

Changes in v2:
- add chrg_det interrupt instead of replacing se1
- Fix remove() race by cancelling detect_work before hardware teardown
- Restore SysRq state on all error paths
- Introduce CPCAP_UNKNOWN initial mode
- Snapshot enable_uart module parameter

Ivaylo Dimitrov (7):
dt-bindings: phy: motorola,cpcap-usb: add chrg_det interrupt
dt-bindings: phy: motorola,cpcap-usb-phy: add optional safe pinctrl
state
phy: cpcap-usb: fix IRQ teardown race
phy: cpcap-usb: add DCP detection and make UART idle mode optional
phy: cpcap-usb: add extcon support
ARM: dts: ti: cpcap-mapphone: add charger detection interrupt for
CPCAP USB PHY
ARM: dts: ti: cpcap-mapphone: add USB safe pinctrl state

.../bindings/phy/motorola,cpcap-usb-phy.yaml | 13 +-
.../dts/ti/omap/motorola-cpcap-mapphone.dtsi | 9 +-
.../dts/ti/omap/motorola-mapphone-common.dtsi | 19 +
drivers/phy/motorola/phy-cpcap-usb.c | 386 +++++++++++++++---
4 files changed, 357 insertions(+), 70 deletions(-)

--
2.39.5