[PATCH v2 0/5] phy: cpcap-usb: improve charger detection and export cable state
From: Ivaylo Dimitrov
Date: Sun Jul 05 2026 - 03:58: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 starts with a fix to prevent spurious SysRq events when
switching between USB and UART modes. It then adds DCP detection support
to the CPCAP USB PHY, updates the Device Tree binding and corresponding
mapphone Device Tree to use the charger detection interrupt, and finally
exports the detected cable state through the Extcon framework.
The existing driver already interprets the CPCAP USB detection state
machine to determine the attached cable type. This series extends that
logic to distinguish DCP connections and exposes the detected cable state
through Extcon using a standard kernel interface. 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 has been tested on Motorola Droid 4 hardware.
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 (5):
phy: cpcap-usb: Prevent line glitches from triggering sysrq
dt-bindings: phy: motorola,cpcap-usb: add chrg_det interrupt
ARM: dts: ti: cpcap-mapphone: use charger detection interrupt for
CPCAP USB PHY
phy: cpcap-usb: add DCP detection and make UART idle mode optional
phy: cpcap-usb: add extcon support
.../bindings/phy/motorola,cpcap-usb-phy.yaml | 6 +-
.../dts/ti/omap/motorola-cpcap-mapphone.dtsi | 6 +-
drivers/phy/motorola/phy-cpcap-usb.c | 334 +++++++++++++++---
3 files changed, 290 insertions(+), 56 deletions(-)
--
2.39.5