From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60D6730499A for ; Sat, 11 Jul 2026 20:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783802561; cv=none; b=jnHGzPLM+/ROexVIRYNGHcPrByirURr56yy0/1QXv8TdfBLXUE4Sx0l3mlNkiE86lwyrVCYFqbMiudtBD5mRqiFIx/EEqr063MqUfojSmZSl/CsINy4BdgIXZ3dKnBAyjddauJhgRKtRhmNekXzv2xfvCzzbLeYBGljo/2EgrDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783802561; c=relaxed/simple; bh=L2sb5cET0wjT1JgD/AHsjf7HpJ891Sy1hzT2Y5sI8FI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=bFIVLSA54OtcCJ28bpBYbWLcv6JPCfGIRAc6q7WDbHrl9g7hTXUUAVIy/4OyIbag9/jcAWtFTyf0g6q2aLhb1qlINRjhxGnI9terAsy243XW9RbiEev6AHzvMMBbTSPCAHFnkQ9GoWWQZYqCs3BZN4lPxrsouo9cbKyoBq1+LWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KKFbcQyq; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KKFbcQyq" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-493c733f15aso19644125e9.0 for ; Sat, 11 Jul 2026 13:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783802559; x=1784407359; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=PnttK4V5N2RbdGmmP/+gvD/lecbvQoerec0w3s7gRKw=; b=KKFbcQyqnwjTAexocsEcTztm2/hp9ai65jm8Du/U0VVFFxyzx8D9fTbOrNNFVho+eT laSFVCAd6tBbkLB3VbdNCltvmjWUbMizz1/RY0KlWnkVmMvPdvq5c8b++5HGkQig9+Hq u3vFgNWrU/vHNaeuJf/kV5T8dmK3aBq/qqmUC0iXR/8ETZfuiSXjni9bIraQKu2YqfV/ ZdzZEeMf/8WW/7UZJUgdreXSCHsuSajGiRMSibV02Ysjq4f0K9x5s4f8ZxEUYm+7u9J+ RmTs7uJ5Cgos4Vc2zuVWeU2b63vRW43ILTQU3n7mJRRpDOU7fjwp7WLjAm42bRB6Hs8G 8vEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783802559; x=1784407359; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=PnttK4V5N2RbdGmmP/+gvD/lecbvQoerec0w3s7gRKw=; b=abxlzYb2BIKqpekCvEN00s+cH9WGI9WXkBUEN+T23x1vTPSg3hA1Dwiq/9DwrVXZvq v7p374O4CNCjEryU9+qk6RKT24vYifK2PkhCCz+AWIvDOrqF0bt9WAdT9DvUOy/QFdXn ntsk5ga4ztzn3YwL1Q7/6doZT60PeR+8JIOwJF5fQcjEqjhqvMSATJf8WWnosKtHdjQe AqIgw/eZsfLoYuoC9TU0oXCDkBnL4Vj616MUNBKYxAA9Tnhn5ydaPjxmxwAzco9bJLyG YkH2mTacmjj7FxxQ7DRGCkAHBooicm3YiY0/r05JLmucXWItu1rpCNVhv1cmayepJSOM dr5w== X-Forwarded-Encrypted: i=1; AHgh+RqDq+j0/uho8qg6Qc8ui5mLwRtNtL+mV5eaaWHdWQFCVcZuALFGsAcQrG+9kwFgOg+yXw0A9xwYSUjctzI=@vger.kernel.org X-Gm-Message-State: AOJu0YzVopvw8EREQeb+BybETdZlZ52H/C4NJUX3/0pgqsaoSZVREzXf f9UQnQxVn2ee6sINU2dFc3BVGR2Yk8mcvNW/W8eazsDiS9ybLyHwMVqn X-Gm-Gg: AfdE7cmzLYpQGArtbFrJ+oXwDwQz+79GAdgiohq2kKTiWSEXRKFVsob8oAmheaJvcyE sGLNfoHO+3v9wL0vHtUqrJWoHwQenmBdIJopfXtXdLhvmdQs+39nnIL1x403yp/cxyY7W7hETwh gamsAI/sJkyxeFHxLYpTro4T2GNWoTySqZqga9jYio4nIaFO0uhYCBGIPvcnuksuH7ywVkIa0oU wQTYewftNCbIFrtMU1fEQgTOSvseaCktY8JIKu3O0yOPf6b2tIaePTF9RqxLe40G0hUaq8ipTF1 LC7AD9gBpQnAr3/UwrVGWs/111U0ATRgr0JNKEKp+LJxnYAG3KQ/q8gBxfQWC0tRXDlbQeKyX/C Fb1NbvYmrvM2tcy3WE6LhaoX4UZHON0mXiJsS+eeoZYvxqvhS6lJnMimp6RfmdugTgy5pAZo1vf 7Kgi7auLg+ZFn4pOvvPEfhlM8PBUriKJ7YJw== X-Received: by 2002:a05:600c:608e:b0:490:b8c0:d470 with SMTP id 5b1f17b1804b1-493f881f934mr35888195e9.19.1783802558744; Sat, 11 Jul 2026 13:42:38 -0700 (PDT) Received: from localhost.localdomain ([95.43.220.235]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d97527sm172704725e9.2.2026.07.11.13.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jul 2026 13:42:38 -0700 (PDT) From: Ivaylo Dimitrov To: Vinod Koul , Neil Armstrong , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Linus Walleij , Bartosz Golaszewski , --cc=linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Ivaylo Dimitrov Subject: [PATCH v5 0/7] phy: cpcap-usb: improve charger detection and export cable state Date: Sat, 11 Jul 2026 23:42:03 +0300 Message-Id: <20260711204210.197144-1-ivo.g.dimitrov.75@gmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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