From nobody Sun Feb 8 13:48:19 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4508308F1D for ; Fri, 16 Jan 2026 23:21:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605672; cv=none; b=gKAq0V92mJqEackgipXTRftBT6BKDQud0et3zOwvDOIkY+w3iQvOqx/cJPjmPaahbR4/GHhVKZvbeSSBVPS2sG0Wz6Cl7ViRbI079IkcY2H5orY86mZz2nS01bHfY1XZGminDAyFaBGEY2rXxDB1+CwrtdL0R0f0Y/O1veh5UEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605672; c=relaxed/simple; bh=Myb5/SidE30NTPohSE6poB77sjMp34zHy+G6Ervv8b0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e6RcKaYqXwEXmwTTRXohVTqWMxWLK/am2u16/sQ8fsdgH1AxdFXvr6NWw7Debu1Rwfp3eyHWwv2fbhcPWf1GBdEbJdWP0Tu+3DDnK17PPcz7dtQhXSbY0Ku1ClKquj9rjcv3FHbyx0JeAseCWXbGP9Df3Mo+E0g7WDv7P4f4U+Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=XRmPPhWU; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=OAU7XOvd; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="XRmPPhWU"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="OAU7XOvd" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60GNCx0j2183248 for ; Fri, 16 Jan 2026 23:21:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=kwfFFi6O6CY E9sERUzKNtpAa9yEpQVqdx39AZPQqd2g=; b=XRmPPhWU/RdCtRohGnQpYjwyCoq wqD6a/AWRR5cnlCOYMF9s/6jQSRWxfXRi4iWjZyVjsoLSyqaKbce3/VUPCNyEgBN TQ68EqvDGfqPN9OS2y8U9axBbhW/e7jIER2uyJ6EPQpLVO90IUo+7LD0wnmYsL+K nn8yaEYhR9NtTVjRh2QTKo/5KpHeusBiWi3/8griHpLMx3T1Dfl9nPXXqA+Nahn3 eqy/w9EjnaL4ttRYPi4ntrpO7GCKvdICZeG9dX3sCBsPg3lXyVLLRFJ8d1C7sRkK +HnHDkosHwCmP8q1F6kBsCr9/NxiPByEB4XetxJAosjxfuO+WSTk3T2OFbA== Received: from mail-dl1-f70.google.com (mail-dl1-f70.google.com [74.125.82.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bqvga0b2m-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 16 Jan 2026 23:21:09 +0000 (GMT) Received: by mail-dl1-f70.google.com with SMTP id a92af1059eb24-11b9786fb51so15703957c88.1 for ; Fri, 16 Jan 2026 15:21:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768605669; x=1769210469; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kwfFFi6O6CYE9sERUzKNtpAa9yEpQVqdx39AZPQqd2g=; b=OAU7XOvdqSLuB3D/DbSZR1UWQGqrIXEhpLAhpiP4hFLnNYrZ7KwMVq/q+dM7AbULW5 8fsVY8PNNyfsaM3KyuQu+4Rnq5CHppwx3aetw+wpSIsFpt8BO/5V3LmkCYU9XwTyDO+N ZNjIZE8PetS0uYi9UX4xx+0nQRjRraFtgfgAX1TcgzlHsuO+KfzjIrCo51J4HBywqm3m pchX17M+qzdFRzIXdKrWY9AvZbDaG59VOYOYCnQe0kbIH0eP5Oye45rRcArPKEItnkhf h5Xl1tVesWxzeAyFHUHxsWtGWQuWDq4mbA3lVLvnyKuxGi9VmEB+SsiC15tinBvs0bTB U+XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768605669; x=1769210469; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kwfFFi6O6CYE9sERUzKNtpAa9yEpQVqdx39AZPQqd2g=; b=AENRRG781bDlojQJsEnQdimvgaLyKUCiLYQ1cjpBo7Rf1BHlTrs9uC1AsBiYWQc2j0 QxLrOA5lDmIF48cSlW6el5BFs5bcSEwUg3XZd+JeGkV080RjvRjyXmt7YiMVYbDQ/WXk 9/vWBazWST4BXkiAMmhnN/bJ3BLnecGsSzYs7SSzmbJnRgmnCzcyeWlvlgX1iCoXvDU4 w977UBct8GyGzcflcIF/Kce2C1lox0vGb5royWuf7DCp6FPqwWIzoItNHVdRttCIHZj2 hAhZQkP/2amQnxTx2B/F6185ybv+Ru+OdMc/ybWB3B552LRJLcpAmC2CDQoFJS736EET Z3Dg== X-Forwarded-Encrypted: i=1; AJvYcCUH5RNCNIXdOD/DK8fXfVZTDEP98cL7GWPwxSLs6qd+7H7+DXk2J8UCN+ST8JVxCExQxGdrN6dGkEHF7p4=@vger.kernel.org X-Gm-Message-State: AOJu0YwJx76xrH7rokS+03P2nFqZn11g/pJv95K1zJw7Fl6VjktiDB94 YNZzvaKauVbZgZfrBY10SQFAialZglQUrRYcV8F+wFnQajYh3XTwLBt6O81uOznX9vxFPz3aDJV N6YvQw+3bLpIkUiHWA3RXTs1HIBz8VQ9/mCH6UTGQ5gUFLh87K6q06w2OCQnhSWbjKVo= X-Gm-Gg: AY/fxX4DhZbZe+mhaBvgRbvA0Rjb+O52WlG6048gCHKDoedS6oE4EF/wdp4Fq74OZRA NctsS2WFkS9LVo9NDJrVPFVQEnn3O5SmPAxQvTJU72vJYI8xx8v3GJXe374Fhg5A5BaHc7+R0Tp W9iC4ol9YW2HBvpXCdUMvZ30ubITq6IXjrBhjmu6QAopyhLrr0TjYB7pmZwuXQqLDU/H2DuvtF6 MzLLLqMHPspKg5O2Q+ZrzhmF2xa9GSkrO9KeNgVSQJC3P3uTJ55r6XkwEb54Jsq+xpuGKuVKFMg +w49xjgMEIhxrF0pSgEaCHlp0t9Z2D2MfJN84KgXq4RaAvi222GwJFfTmLDjI3rJ912HOfX4Tde Jo405XS9B5Ylct56UOsCA0wTRCbA95+GZes3Fb6fKLES6JWKlNVy51AF7KWzmuBI= X-Received: by 2002:a05:7022:4584:b0:119:e56b:958c with SMTP id a92af1059eb24-1244a72d3b7mr4127551c88.17.1768605668841; Fri, 16 Jan 2026 15:21:08 -0800 (PST) X-Received: by 2002:a05:7022:4584:b0:119:e56b:958c with SMTP id a92af1059eb24-1244a72d3b7mr4127526c88.17.1768605668213; Fri, 16 Jan 2026 15:21:08 -0800 (PST) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244af10e21sm4611267c88.16.2026.01.16.15.21.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 15:21:07 -0800 (PST) From: Elson Serrao To: Greg Kroah-Hartman , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Souradeep Chowdhury Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/9] dt-bindings: soc: qcom: eud: Restructure to model multi-path hardware Date: Fri, 16 Jan 2026 15:20:58 -0800 Message-Id: <20260116232106.2234978-2-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> References: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE2MDE3NSBTYWx0ZWRfX3qBmYDSkIJNB JqVLZVbUxfYsZtJp8ZmovJt6D5dlPz1sdaX/PTae6dlkN6MeHh7HkzRdZlwTDyJssz/Eub+4Adw qIzP5j/QpSA8EmVYA7k0pvDDRIdQU8R3ZrTRjaK3XCIxQ//6ASJ9nf/cgWH3cl26F6tpkW+4Wp8 v8Fhh1VdjDmb5XZDre4FV2Sd/OR1pLI3Bt4LO6ma0FxmCnwXhxht9IVr+XWS/0Un81KdFxzKDTH KRBI6f6A7Pz/9Ax3OF3/1a6HBqoQnUkr0peIc7noC2wEiO0648TXv1ZOmsbfu5xHWE5DYBsbOU/ RZemmq1NN4oeagnzw0wSX0r2cGRb6Ff1JNyXF15tENIYivrdTNZDzkRNRDMXiGt1bp2JWGOjK/w 86JRo7WqJAcI625kr5KSxjR7mOO3AoY5UfkzFwg+asd5eJ1m/TnthyWbvm9uZ01AEWJZzgmLlbu c9PCcyDy38OjU5m9WBg== X-Proofpoint-GUID: -3wbCHxsQbEtmUFjn70pUIG9rbGAs_59 X-Authority-Analysis: v=2.4 cv=Kf3fcAYD c=1 sm=1 tr=0 ts=696ac7e5 cx=c_pps a=SvEPeNj+VMjHSW//kvnxuw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=COk6AnOGAAAA:8 a=BjueR4FZ-pLKYUec0x4A:9 a=T0KM2sWh4d-P_2Ru:21 a=Kq8ClHjjuc5pcCNDwlU0:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: -3wbCHxsQbEtmUFjn70pUIG9rbGAs_59 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-16_08,2026-01-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 clxscore=1011 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601160175 Content-Type: text/plain; charset="utf-8" The Qualcomm Embedded USB Debugger (EUD) hardware can intercept up to two independent High-Speed UTMI data paths, depending on the SoC configuration. Each path operates independently with: - Dedicated PHY interface - Distinct USB connector and controller associations - Role dependent routing Model these hardware paths as separate eud-path nodes to accurately represent the physical topology and add below per-path properties: phys: EUD exposes a High-Speed debug hub that relies on HS-PHY for its operation. This property references the HS-PHY associated with the UTMI path. usb-role-switch: Indicates that the USB port on this UTMI path supports role switching. In device role, debug mode inserts the EUD hub into the UTMI path. In host role, the EUD hub is bypassed and UTMI traffic flows directly between the PHY and the USB controller. This change breaks backwards compatibility, but the previous binding omitted critical resources like PHY and did not describe per-path topology. Without these modifications EUD cannot be guaranteed to function. Signed-off-by: Elson Serrao --- .../bindings/soc/qcom/qcom,eud.yaml | 97 ++++++++++++++----- 1 file changed, 71 insertions(+), 26 deletions(-) diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml b/Doc= umentation/devicetree/bindings/soc/qcom/qcom,eud.yaml index 84218636c0d8..a7162560c323 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml @@ -10,8 +10,11 @@ maintainers: - Souradeep Chowdhury =20 description: - This binding is used to describe the Qualcomm Embedded USB Debugger, whi= ch is - mini USB-hub implemented on chip to support USB-based debug capabilities. + This binding describes the Qualcomm Embedded USB Debugger (EUD), an on-c= hip + mini USB hub that enables USB-based debug capabilities. The EUD block is + positioned between the High-Speed USB PHY and the USB controller, where = it + intercepts the UTMI interface to support debug and bypass modes. EUD can= be + supported on up to two High-Speed USB ports. =20 properties: compatible: @@ -29,26 +32,59 @@ properties: description: EUD interrupt maxItems: 1 =20 - ports: - $ref: /schemas/graph.yaml#/properties/ports + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + +patternProperties: + "^eud-path@[0-1]$": + type: object description: - These ports is to be attached to the endpoint of the DWC3 controller= node - and type C connector node. The controller has the "usb-role-switch" - property. + Represents one High-Speed UTMI path that EUD intercepts. This node m= odels + the physical data path intercepted by EUD and provides graph endpoin= ts to + link the USB controller and the external connector associated with t= his path. =20 properties: - port@0: - $ref: /schemas/graph.yaml#/properties/port - description: This port is to be attached to the DWC3 controller. + reg: + maxItems: 1 + description: Path number + + phys: + maxItems: 1 + description: High-Speed USB PHY associated with this data path. + + usb-role-switch: + type: boolean + description: + Set this property if the USB port on this path is role switch ca= pable. + + ports: + $ref: /schemas/graph.yaml#/properties/ports + description: + These ports are to be attached to the endpoint of the USB contro= ller node + and USB connector node. + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: This port is to be attached to the USB controller. =20 - port@1: - $ref: /schemas/graph.yaml#/properties/port - description: This port is to be attached to the type C connector. + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: This port is to be attached to the USB connector. + + required: + - reg + - phys + - ports + + additionalProperties: false =20 required: - compatible - reg - - ports =20 additionalProperties: false =20 @@ -58,21 +94,30 @@ examples: compatible =3D "qcom,sc7280-eud", "qcom,eud"; reg =3D <0x88e0000 0x2000>, <0x88e2000 0x1000>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + eud-path@0 { + reg =3D <0>; + phys =3D <&usb_1_hsphy>; + usb-role-switch; =20 - ports { - #address-cells =3D <1>; - #size-cells =3D <0>; - port@0 { - reg =3D <0>; - eud_ep: endpoint { - remote-endpoint =3D <&usb2_role_switch>; + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + eud_ep: endpoint { + remote-endpoint =3D <&usb2_role_switch>; + }; }; - }; =20 - port@1 { - reg =3D <1>; - eud_con: endpoint { - remote-endpoint =3D <&con_eud>; + port@1 { + reg =3D <1>; + eud_con: endpoint { + remote-endpoint =3D <&con_eud>; + }; }; }; }; --=20 2.34.1 From nobody Sun Feb 8 13:48:19 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 449A1314D24 for ; Fri, 16 Jan 2026 23:21:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605673; cv=none; b=p193yS/Bqe57iazxeKZlI7XvWD2lYUD5A+y01pSSu3hr+blI6ZA6s6nE2KoOsBom1JG/44yaCD7BSOg5J7nIC6d8U1ZwamCEyQsKu9Lc5gB36NhKuEhj+K/SlczMYAXyWFOP4XQjPKHIgyFW+xDcNmpJZbLd5hvgNXrpnlWByhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605673; c=relaxed/simple; bh=xMUCXc+T1mxqitUAHJsbyD7zN0MBtP33MxPyki89jC0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kkZOj8kw0vJmpYTzClT+qgU2kaby857kAL4wZ4E8uyrezph+kLhX/zzpyMM5pf8HCdrHliOImHDr1zVjVne3HuJACeR0alUlgSH/QgYK5wXDsxgDkLx0bzLeOjRIxZBTwO5RByTv8aUGfnGyuRzpF/umymQ4SBSHYQTJB2lN9Fc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=LrmK+vs3; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BExXGGcL; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="LrmK+vs3"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BExXGGcL" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60GND02h2527076 for ; Fri, 16 Jan 2026 23:21:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=X71iaS2pCQJ 5JwChEZnH7egZFDTUof/Ft5BQu4Wr5X8=; b=LrmK+vs3pl9QnXnAIzwE/KX3U5R AA/wRxhoSRzPD6wqNN+jObeSXQZGlyYn/OgYT5zwMkpoSAemPX9kYS6MVQMxJkDt CbxR78LmbWNqDwnAwTrQhMPx8DVnh5LSIy3wzNkFj2C5WmhBuTxNth76Bf+stJhB JU9RtacdiB4gxwXJKvKRepiGCMDW8uZJ8vYjaBLaH9CHPC060mv9RYdQy2k+vL5H cfgOpj5sCVdevmaZjP6hUPHeVXgL/u3an4+4VgmTEpO2B5rcbvmK6AnevQ4IpKJn wzB7FXRiRKgTpIan0iAdARsXcSg8qxBTDUW6doMRQ/M2Z1TRhSgBpUp4YSA== Received: from mail-dl1-f69.google.com (mail-dl1-f69.google.com [74.125.82.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bqvevgbds-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 16 Jan 2026 23:21:10 +0000 (GMT) Received: by mail-dl1-f69.google.com with SMTP id a92af1059eb24-11b9786fb51so15704099c88.1 for ; Fri, 16 Jan 2026 15:21:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768605670; x=1769210470; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X71iaS2pCQJ5JwChEZnH7egZFDTUof/Ft5BQu4Wr5X8=; b=BExXGGcLoU4IGJvz+n8upaghoqqbtLKh3CajiIGHVSvWpe+64X79LUYZqu1I1mqYJd DSgZRBvnNxiMvFEhv+/DVZfxrm68jxJo6kyntkXdpOJR5Cs1fYFZoA3KQkA7C83NRpys RSKaoSrjZqLy1dnnIeK4n5p2org0k9YeUwxy/5LV28MUBC8LVMk4vIg3F1WCd/8W4Lv4 44tOhf13oR53KLK7vE+avWFXcQXMQT4xTvAuwdp3rWaTh+BbxpdDVfMXEir7z7F8JXtC 8GODSjaz18u0/0JFq1+q8Ivk/3ZPhJFVbisu3SNDubY92FOCj/Sc3T7woOlqYczsUjOz sEGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768605670; x=1769210470; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=X71iaS2pCQJ5JwChEZnH7egZFDTUof/Ft5BQu4Wr5X8=; b=O5c4YHlhuA0TNhRd9SlZjrZwmR8A80gRofcmBCHH8/qsIpiJOmk310dhFuov5qWUGw XC5B950zn03J8KF6zyDXqyWvpxaIBIt4svNEhtHy+PQRjuhD/ybYd5glGTjjvCX+8qff 2VGhPvMwgxrVB9mRJk1H7C1XNxtnTX6oAlQeKPylwlIIUIWtQxXnZcrkn8zZr+5kymTK Taj7WOHMt+zJioaHiK0ksCcuPzLGdFfBIW1HpEstM9eGxDS7S3HgkNOWEpbcXv/GVxLc CfKv91JTX6EYa8RLs9F5GjJkrNvs4O6gmcLu4+HyLAV4WZ//cpWTUz7hRwVKXk1RTKmF eIbQ== X-Forwarded-Encrypted: i=1; AJvYcCVNXTwtoY0nmhRSVmx0fiRtv0T9wxXpSpIKrpcIjFub1B3ZcXViFDQ68bDrzXuOoYy9fTpWHBiuoTiC3E0=@vger.kernel.org X-Gm-Message-State: AOJu0YwNHfAXrJHA7arbauM3P4ZraqMgsvIWUM+2OGSLblbPxQfZto0a Xjco6mm2zLLggPnkLDc0jFvrjMlZwWYK1ZzmT3hoh822uc1L9heP3hTGBb9Fzyfnc4X6+mwgGYk lRdJl+7CMzFJiDn7ECUq/+4XPHXzvtFQf3lGQwdV28hnhPyADSUzhIFJwAaaX6ZUE9hNW9J7v3o I= X-Gm-Gg: AY/fxX6mSkSJL3PrtoYOsCQPOXH67H86nJFzwKtBR1xvE+eACpkdOGcf1t1ttqcQga3 9rFBpR9NZEkHkCfnO6VQXvULnqU6SxytQxq/q0qBJGVGuQN1BRV4hCuSQNTQKgS2SLkHaB5eBT9 jBElHzTBaptMYK+L52zr5hwkOmuP19maF3gTzZFRp7FKQXxC7NTLTC99PaSc2zS3a1NZOZfYV0u HMCLfG5jGlYjCb5JS/ZwmhA1mDAjUzwWidXS93POfEMEs2iVqNlyjgdF4K/dR/7HzwdMcKg7tCc 8rUwn9uuaVGePEo65NPUWefLfmnnMWCFQcunm7JQz2cM5FBp9vdBL04SPwGOcmnuP8xcPnLrDVs gmqj0pqoWomAXOQE9bSsvhhOhRC1vNtYz4DNBOhmsXBEqpRsH8CNG5R2Fv4bFuIU= X-Received: by 2002:a05:7022:4189:b0:11b:9386:8262 with SMTP id a92af1059eb24-1244a7a547emr3764395c88.47.1768605669579; Fri, 16 Jan 2026 15:21:09 -0800 (PST) X-Received: by 2002:a05:7022:4189:b0:11b:9386:8262 with SMTP id a92af1059eb24-1244a7a547emr3764373c88.47.1768605669044; Fri, 16 Jan 2026 15:21:09 -0800 (PST) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244af10e21sm4611267c88.16.2026.01.16.15.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 15:21:08 -0800 (PST) From: Elson Serrao To: Greg Kroah-Hartman , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Souradeep Chowdhury Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/9] usb: misc: qcom_eud: add sysfs attribute for port selection Date: Fri, 16 Jan 2026 15:20:59 -0800 Message-Id: <20260116232106.2234978-3-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> References: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE2MDE3NSBTYWx0ZWRfX4ft3BTvoGYIW /Ei3locPE534glfS5pRPZ0P6zxdYPKPRBqf7N0vWQTmVczI9KAOAJg/WFQY7QhodrG1I0PXQKtx bsx7mS5NByia1QgOu/aQXa3oDCwpPPZ44xAIdaFg4esVPk9agcn2VZURtiYoRbEIJ8VWk9fajAf BVudNeiHR7qgtsXJcNKx58H8jw75FWd0GN0zt3bq3KhB5SyXnqmXwzqX7N2igUAd7ex7cLqzYyo QbCqZoYvp/ttCJfg07a8xwJjf5NdOrnUWPW4pZ6uizopcVKkkhkRSWWJO7vi3i20Z+W5R7jKld9 ikE+s92ysFeeCRu/dq9Blzui3BYgeraItWdO17WZtQG2Rud/WUzT5p73R/eY9TGKoI35dggexk2 M2e0EuSKZ/u4eW1tQeer0uQe6W7RCIaHjzGsdikR+u0dMB/i1naDxsdqhePWRfS1YcuLoSX3I4r jUItKTF2R2YUrbgOU4w== X-Proofpoint-GUID: 4t1rH6BlrrwuG7Z6bN8r-zm9PJLfHjpA X-Authority-Analysis: v=2.4 cv=faugCkQF c=1 sm=1 tr=0 ts=696ac7e6 cx=c_pps a=kVLUcbK0zfr7ocalXnG1qA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=un400R04Xmhap_XYEvQA:9 a=vr4QvYf-bLy2KjpDp97w:22 X-Proofpoint-ORIG-GUID: 4t1rH6BlrrwuG7Z6bN8r-zm9PJLfHjpA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-16_08,2026-01-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 suspectscore=0 spamscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 clxscore=1011 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601160175 Content-Type: text/plain; charset="utf-8" EUD can be mapped to either the primary USB port or the secondary USB port depending on the value of the EUD_PORT_SEL register. Add a 'port' sysfs attribute to allow userspace to select which port EUD should operate on and update the ABI documentation. This is needed for systems with dual USB ports where EUD needs to be accessible on either port depending on the system configuration and use case. Signed-off-by: Elson Serrao Reviewed-by: Konrad Dybcio --- Documentation/ABI/testing/sysfs-driver-eud | 16 ++++++++ drivers/usb/misc/qcom_eud.c | 43 ++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-driver-eud b/Documentation/ABI= /testing/sysfs-driver-eud index 2bab0db2d2f0..67223f73ee60 100644 --- a/Documentation/ABI/testing/sysfs-driver-eud +++ b/Documentation/ABI/testing/sysfs-driver-eud @@ -7,3 +7,19 @@ Description: EUD based on a 1 or a 0 value. By enabling EUD, the user is able to activate the mini-usb hub of EUD for debug and trace capabilities. + +What: /sys/bus/platform/drivers/qcom_eud/.../port +Date: January 2026 +Contact: Elson Serrao +Description: + Selects which USB port the Embedded USB Debugger (EUD) + is mapped to on platforms providing multiple High-Speed + USB ports. + + Valid values: + 0 - Primary USB port + 1 - Secondary USB port + + The attribute is writable only while EUD is disabled. + Reading the attribute returns the currently selected + USB port number. diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index 926419ca560f..1a136f8f1ae5 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -23,8 +23,11 @@ #define EUD_REG_VBUS_INT_CLR 0x0080 #define EUD_REG_CSR_EUD_EN 0x1014 #define EUD_REG_SW_ATTACH_DET 0x1018 +#define EUD_REG_PORT_SEL 0x1028 #define EUD_REG_EUD_EN2 0x0000 =20 +#define EUD_MAX_PORTS 2 + #define EUD_ENABLE BIT(0) #define EUD_INT_PET_EUD BIT(0) #define EUD_INT_VBUS BIT(2) @@ -40,6 +43,7 @@ struct eud_chip { int irq; bool enabled; bool usb_attached; + u8 port_idx; }; =20 static int enable_eud(struct eud_chip *priv) @@ -104,8 +108,47 @@ static ssize_t enable_store(struct device *dev, =20 static DEVICE_ATTR_RW(enable); =20 +static ssize_t port_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct eud_chip *chip =3D dev_get_drvdata(dev); + + return sysfs_emit(buf, "%u\n", chip->port_idx); +} + +static ssize_t port_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct eud_chip *chip =3D dev_get_drvdata(dev); + u8 port; + int ret; + + ret =3D kstrtou8(buf, 0, &port); + if (ret) + return ret; + + /* Only port 0 and port 1 are valid */ + if (port >=3D EUD_MAX_PORTS) + return -EINVAL; + + /* Port selection must be done before enabling EUD */ + if (chip->enabled) { + dev_err(chip->dev, "Cannot change port while EUD is enabled\n"); + return -EBUSY; + } + + writel(port, chip->base + EUD_REG_PORT_SEL); + chip->port_idx =3D port; + + return count; +} + +static DEVICE_ATTR_RW(port); + static struct attribute *eud_attrs[] =3D { &dev_attr_enable.attr, + &dev_attr_port.attr, NULL, }; ATTRIBUTE_GROUPS(eud); --=20 2.34.1 From nobody Sun Feb 8 13:48:19 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB13E31A077 for ; Fri, 16 Jan 2026 23:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605678; cv=none; b=mYN2dAWoConA9JJ6wwbsvfEbz1JdtcbTXW6P1GBY8C8VyA9ZlmnzZSxS7T5YMQJ7ZmkWOb7NthfkELmdkbcDi7ncyUap+bJq0HIk8WnXl7dfrUsQF29woTWwv3flDFiBeolGuk6B+P4KGBYdq3UbWdp5Vw2zfmkKUOF+PYrJa30= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605678; c=relaxed/simple; bh=+qzYM1fSYiL2reWeLe70I04JP20oO8KwkaJWiYnJk+0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IyLSqjE+3PgXqZApYyqE5FLVp6kRDGxT3KffHP5uvQXDgL8AXw9+fXz79pmjo+xT3cFhtd4LiEh/pW2RPnUk1Kppip24H8Y5e8scEkrbq+Vb6wzY4a2W452T7eDDD+Ap8DP0fS/fdeq2DRtjPKsPZNDVMmrrGlpM2H6CKgHXPr0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Pqv/pDis; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=LC2TXA9+; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Pqv/pDis"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="LC2TXA9+" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60GNDQRN1712292 for ; Fri, 16 Jan 2026 23:21:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=pYVx2yqGuzZ kNj+rwFw3NTUEKnrn19cGogpfRYgclkU=; b=Pqv/pDisoQFyfOw22jvYuuv6wOZ Er7TtYMqwfsRAIKHqkY1QAvNZ/KUkSpVkZdObqgEzgWtiVQykPcnPLMFcgfO6oOR eC0e4SRm9p2dcONKLMrna0oBGqX64q9Ev0hSRdSQOBIwlYPHpBvq6xCjqO7QUgKl uDo5jdg/9ihFkNYqkCviAoBH5uK43F+jbhu1tO/GEzS20cHUUIkvB4pet125kLlz RRZefEtQS5Tfhs3Ty+6S0YbYkeAqgOMLX69ggaqIhPLwtdTMf4MXQvNg8Zj67w8K TsQbxk8TBL5tGd5Be4AdBiaYoB/h/hxNmA8cwVT0Pn0b1eAZrFYVDAYwfvg== Received: from mail-dl1-f71.google.com (mail-dl1-f71.google.com [74.125.82.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bqvh08awm-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 16 Jan 2026 23:21:11 +0000 (GMT) Received: by mail-dl1-f71.google.com with SMTP id a92af1059eb24-1233893db9fso2730090c88.0 for ; Fri, 16 Jan 2026 15:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768605670; x=1769210470; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pYVx2yqGuzZkNj+rwFw3NTUEKnrn19cGogpfRYgclkU=; b=LC2TXA9+8Rv1/4oEFw3/D78xE37qBw6i49wqqNJw8OFNA9Txb9+TTFFGIWL3Fxj46R YhUFoBMMLsC4y1nsLFpWdwTt7FCCCQeWOs3ySggqbn3i5RWobD4Mvo1Lh7FrgAeeuBaX v5HVDq5xEKoHZdYS9Y2odUxvzq4okU+XJ/WXZXiZnihjrF/nzMuIPe7DMM+Att4OE8X1 PVtkNDW+YZLZbvBBL5Y9ZtUHlZYw0U5qMMX6P42tdw5AVzRPOZDfUy4xA5QSqlV/fKqZ 1JeY9DK8qmw0RlfWfKKDqxq6pfa6vo/j1bouEB6A3ySug7EAMhPsaSsNOf7kP4IzVYwy Vr4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768605670; x=1769210470; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pYVx2yqGuzZkNj+rwFw3NTUEKnrn19cGogpfRYgclkU=; b=w34BSsrP+1DOacgJfgX2Kdp0PnqU6WmL4XNw6WFCGzuzRwp7PHzcUAu8LZbpwwGv6V xQ+UxhqncEZerutGX81/skZSNgadHmADA+2mabq1ova5J5HWlf1L3JtI2lUE9YCyDPs3 Ionvv+XQ2HUcOIjLYpDZKCuU9OiHgvOOV7lsFhqJymrHFicxO0J6mTZoOwHFGXn6eZ5p r9G33I2IfHI/bPm1wUfaGvpC34ssTHorTSKucpMbztANACQCWKDfmjABaiTjJtyqjFzY HoKFvzmQKOI718IfhjpHGwqZQXASMQ/LAnB0sOWXnEbvFA3KtUhe+dq0f1VhgeO1xLBA wPWg== X-Forwarded-Encrypted: i=1; AJvYcCXzH3lRn2hXQko/gqEVWujUinLh4xnL1geWqu3MNeE8ZPjCuIpr+DhCko5in1wQCSJdx97KXRQRDQ72fLI=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3CCnAO3pwygoctFNKIx5bdawRvdsJm46AswJGsZmpmNA/FmOx Z3NY9M9IiRzPnktJG2i9CjFbZvixlr1617GHqqP2Rvb075xsl16FAwYeLaTMHoMoEj6FLr+qn/F jEMLPqF88tgxFdn1rXHEJWURzer3KTEJ2iKnfkC5Q9f/k2OqGaau/sAL4dQ3DcSEuXQg= X-Gm-Gg: AY/fxX590Jy0KHd1+nfUOzX98lL2L76Y5bsSFCdGXmkJShPbKZLfuHpXIF9WP8ithuX BQkogJ+M5geXU1kTDUlQkP7AUm+I8uCULE1JMJGJSeo4iO/bXP5cngAiNBbMHD5Pyi+r3L+pvj/ 8bJDqY9/IucBNTnuBAMsC4l2oyGt6ALSZqsrvz5l2l24wy9EwQYLh6L17+8+7JY3L8nnB4LCkit X9SrOl+YypNlM7RNHL7Lgr/QGtDivC0ZB2hfzq/GpaA6On9mkRd5ieG1Gx45iEgKT9N7/rLNmKX Ei4955h++PziS0SW4Gd8bcouFrlOk9rj+S1HNdLOWt485oqvQJWnmmHxkpy805YErDFjWZrcATB 5nt9FGR2xBajJ5W6N6OVdG39aZSmQDRXI1/8mCD9Rrm9luTs4gu7Ob+VveV8vGzU= X-Received: by 2002:a05:7022:924:b0:11b:ca88:c503 with SMTP id a92af1059eb24-1244a6fb234mr3574871c88.3.1768605670455; Fri, 16 Jan 2026 15:21:10 -0800 (PST) X-Received: by 2002:a05:7022:924:b0:11b:ca88:c503 with SMTP id a92af1059eb24-1244a6fb234mr3574860c88.3.1768605669886; Fri, 16 Jan 2026 15:21:09 -0800 (PST) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244af10e21sm4611267c88.16.2026.01.16.15.21.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 15:21:09 -0800 (PST) From: Elson Serrao To: Greg Kroah-Hartman , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Souradeep Chowdhury Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/9] usb: misc: qcom_eud: add per-path High-Speed PHY control Date: Fri, 16 Jan 2026 15:21:00 -0800 Message-Id: <20260116232106.2234978-4-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> References: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: Gn1gOVvrTx9DjE-SQqhfS5_ICfZUY8qQ X-Authority-Analysis: v=2.4 cv=ZZsQ98VA c=1 sm=1 tr=0 ts=696ac7e7 cx=c_pps a=JYo30EpNSr/tUYqK9jHPoA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=wu0v9trazkx_CZjgA_kA:9 a=Fk4IpSoW4aLDllm1B1p-:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE2MDE3NSBTYWx0ZWRfX9tfRbJe7Ycja W69yTvhG8aYL2W/5g8KT0CxP6n1ffso5v7Tqp/IL8Px1/5+vZ22VYKiIivEIRLNpE9sD3dnGAOy HmEnBueQVDCSuNa1TIYx4yw4XKRJ6IjPK4volfYo8NwOqG688fU72yVvHNkhd3yhPQiz/Raw6eP /NDfDjYZjxhQMSLtvO7+Rr6+WwUdYdAmLMI+UJD+32hDGViDBxJRMKNsi8OvTQc5Efoj8CJdOaQ JdIOpXNVA1VQQ1H7sCzLCmdy6+A8AYbJt8IyffVq3/X7FD9BQHs9LrfCgGza75B1hRqUcfbmEFK 1NRaKVCvyBOx+q7MzxdUzz8jk0Xjux9uJK6pNpdkSKUoOqeL8A7tRPv6bDZL4e5WpMVT1hNoHRS 4aHW5JtLb0tgo/SPHFjdA6mQmgBmBjHg+OTwu6M1B98rYqpnqts7A+lpPuKlwK0uT8ZWngTKdkC hIHfHUEghGn71GlIBvA== X-Proofpoint-GUID: Gn1gOVvrTx9DjE-SQqhfS5_ICfZUY8qQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-16_08,2026-01-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 bulkscore=0 adultscore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601160175 Content-Type: text/plain; charset="utf-8" The Embedded USB Debugger (EUD) is a High-Speed USB on-chip hub that enables debug and trace capabilities on Qualcomm devices. As a HS-USB hub, the EUD requires High-Speed PHY support for proper operation. EUD hardware can support more than one High-Speed USB path, each with its own PHY. The active path is selected via the EUD_PORT_SEL register. To support this multi-path capability, the driver needs to manage PHY resources on a per-path basis, initializing and powering the PHY corresponding to the currently selected port. This patch restructures the driver to support per-path PHY management. PHY resources are powered on/off based on which port is active. This ensures the correct PHY is enabled when EUD is enabled. This change requires path specifications and corresponding PHY references to be added in device tree, breaking backward compatibility. However, this is acceptable since EUD cannot be guaranteed to function without proper PHY control. Signed-off-by: Elson Serrao --- drivers/usb/misc/qcom_eud.c | 130 +++++++++++++++++++++++++++++++++++- 1 file changed, 129 insertions(+), 1 deletion(-) diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index 1a136f8f1ae5..5cebb64f4a67 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -34,26 +35,96 @@ #define EUD_INT_SAFE_MODE BIT(4) #define EUD_INT_ALL (EUD_INT_VBUS | EUD_INT_SAFE_MODE) =20 +struct eud_path { + struct eud_chip *chip; + struct phy *phy; + u8 num; +}; + struct eud_chip { struct device *dev; struct usb_role_switch *role_sw; void __iomem *base; + struct eud_path *paths[EUD_MAX_PORTS]; phys_addr_t mode_mgr; unsigned int int_status; int irq; bool enabled; bool usb_attached; + bool phy_enabled; u8 port_idx; }; =20 +static int eud_phy_enable(struct eud_chip *chip) +{ + struct eud_path *path; + struct phy *phy; + int ret; + + if (chip->phy_enabled) + return 0; + + path =3D chip->paths[chip->port_idx]; + if (!path || !path->phy) { + dev_err(chip->dev, "No PHY configured for port %u\n", chip->port_idx); + return -ENODEV; + } + + phy =3D path->phy; + + ret =3D phy_init(phy); + if (ret) { + dev_err(chip->dev, "Failed to initialize USB2 PHY for port %u: %d\n", + chip->port_idx, ret); + return ret; + } + + ret =3D phy_power_on(phy); + if (ret) { + dev_err(chip->dev, "Failed to power on USB2 PHY for port %u: %d\n", + chip->port_idx, ret); + phy_exit(phy); + return ret; + } + + chip->phy_enabled =3D true; + + return 0; +} + +static void eud_phy_disable(struct eud_chip *chip) +{ + struct eud_path *path; + struct phy *phy; + + if (!chip->phy_enabled) + return; + + path =3D chip->paths[chip->port_idx]; + if (!path || !path->phy) + return; + + phy =3D path->phy; + + phy_power_off(phy); + phy_exit(phy); + chip->phy_enabled =3D false; +} + static int enable_eud(struct eud_chip *priv) { int ret; =20 - ret =3D qcom_scm_io_writel(priv->mode_mgr + EUD_REG_EUD_EN2, 1); + ret =3D eud_phy_enable(priv); if (ret) return ret; =20 + ret =3D qcom_scm_io_writel(priv->mode_mgr + EUD_REG_EUD_EN2, 1); + if (ret) { + eud_phy_disable(priv); + return ret; + } + writel(EUD_ENABLE, priv->base + EUD_REG_CSR_EUD_EN); writel(EUD_INT_VBUS | EUD_INT_SAFE_MODE, priv->base + EUD_REG_INT1_EN_MASK); @@ -70,6 +141,8 @@ static int disable_eud(struct eud_chip *priv) return ret; =20 writel(0, priv->base + EUD_REG_CSR_EUD_EN); + eud_phy_disable(priv); + return 0; } =20 @@ -132,6 +205,12 @@ static ssize_t port_store(struct device *dev, if (port >=3D EUD_MAX_PORTS) return -EINVAL; =20 + /* Check if the corresponding path is available */ + if (!chip->paths[port]) { + dev_err(chip->dev, "EUD not supported on selected port\n"); + return -EOPNOTSUPP; + } + /* Port selection must be done before enabling EUD */ if (chip->enabled) { dev_err(chip->dev, "Cannot change port while EUD is enabled\n"); @@ -231,8 +310,45 @@ static void eud_role_switch_release(void *data) usb_role_switch_put(chip->role_sw); } =20 +static int eud_init_path(struct eud_chip *chip, struct device_node *np) +{ + struct eud_path *path; + u32 path_num; + int ret; + + ret =3D of_property_read_u32(np, "reg", &path_num); + if (ret) { + dev_err(chip->dev, "Missing 'reg' property in path node\n"); + return ret; + } + + if (path_num >=3D EUD_MAX_PORTS) { + dev_err(chip->dev, "Invalid path number: %u (max %d)\n", + path_num, EUD_MAX_PORTS - 1); + return -EINVAL; + } + + path =3D devm_kzalloc(chip->dev, sizeof(*path), GFP_KERNEL); + if (!path) + return -ENOMEM; + + path->chip =3D chip; + path->num =3D path_num; + + path->phy =3D devm_of_phy_get(chip->dev, np, NULL); + if (IS_ERR(path->phy)) + return dev_err_probe(chip->dev, PTR_ERR(path->phy), + "Failed to get PHY for path %d\n", path_num); + + chip->paths[path_num] =3D path; + + return 0; +} + static int eud_probe(struct platform_device *pdev) { + struct device_node *np =3D pdev->dev.of_node; + struct device_node *child; struct eud_chip *chip; struct resource *res; int ret; @@ -252,6 +368,18 @@ static int eud_probe(struct platform_device *pdev) if (ret) return ret; =20 + for_each_child_of_node(np, child) { + ret =3D eud_init_path(chip, child); + if (ret) { + of_node_put(child); + return ret; + } + } + + /* Primary path is mandatory. Secondary is optional */ + if (!chip->paths[0]) + return -ENODEV; + chip->base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(chip->base)) return PTR_ERR(chip->base); --=20 2.34.1 From nobody Sun Feb 8 13:48:19 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6C8E31A07C for ; Fri, 16 Jan 2026 23:21:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605679; cv=none; b=TzBWdr7ahRMhH9D5NPfc8MxFiWWKn0Y1LBePbpNMsTZEVcwsdMvErv48m/r5iaw2r9BJK60VY80KceEKoVhZOMfiKJ7VU29slTk8t7CrnqpBiP8U1khk0EuS9Tcy6BDbwljCFRW8Z7YG69mXLzSKzNyM+PN2vCGXOlqY5SZ170g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605679; c=relaxed/simple; bh=8QuxfXdYRJcE3fyNR6NyT4XaseLCItGHgJZH0P+Yloc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=giJryUma92n8kSnZhKcZJrzKe8lwz+gpQTZBOb/gI2jOkxQtCPkzrH/k24jsF8kjYr2U5RstFSaT0/IBfLDsVzMXCVF2z+AixEEU6f4eKVZPD044lkoZZaeExUmplr1iRI/6juHDswie34eWEHaLutIRZwMFkfeY9IbmmK15EMk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=LESjgGBP; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=efx8bcmg; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="LESjgGBP"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="efx8bcmg" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60GNDMDQ2825268 for ; Fri, 16 Jan 2026 23:21:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=VKaYciJerw3 mJBDnc7jGWgSPFPx7Co7DTR1b7g2zoXc=; b=LESjgGBP0pE9vVf52fp90RjyhCW O6kYko17U4C/ld6zZfgoF8vrFbt6EQE00tglK7nQeMDuzc5xfgROjcQEjS0CJRwY 0FrVBVvJ0Zmr/keyabSVifr2YNaakqwbnZMqa2JAZYL5HRDq/Eb2FoniearXERcx DrJuf93gel1dBDWnlxSgfr3aFsFomj/m29yFUZKja88arriPa/vE3b/Dgvdj4jdE 07qiReXSajxmwJ0bAgf5xdnTNAhjJtnlH1uerZOI3+/oPEcYYG1AlYNmul6P/zSe AK6F1vY0Gck6GdVdHX+tt96zml+sPG/NO481dEG3m5AVH3ORd6TxdRaN21g== Received: from mail-dl1-f69.google.com (mail-dl1-f69.google.com [74.125.82.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bqvecrcms-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 16 Jan 2026 23:21:11 +0000 (GMT) Received: by mail-dl1-f69.google.com with SMTP id a92af1059eb24-1233893db9fso2730137c88.0 for ; Fri, 16 Jan 2026 15:21:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768605671; x=1769210471; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VKaYciJerw3mJBDnc7jGWgSPFPx7Co7DTR1b7g2zoXc=; b=efx8bcmglPgVIQ7+yCUOk36fdpSZD9zeGEvbolxXxbI7fXJGw/d28eWvZuQQpDHKpu QcDcjPLKofFl4GkRy7m6/r0WpzSFl+C4tCHMJtZ62frGvhvYqqAdWOadhVaLlqNo3/un iQQJyAL3YlLByK1ryHSw+0zwI3Fx/Lx4D88TX4k3DWrdJXnuzCQ0fLJJmb4y748F3w/O VPaWDvQPHpGC2D3LAvrk3V2Zn7+gPWLMWff24HSImWqRR2l+H72XGCr8+8q+c2Wugc/q HcSkHcPyw8SCKqP9IbfOjSvdnJvtP5+rJCJODjrSM3Gy44RmeUP3SuyMD52qRyaTzfGI r8Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768605671; x=1769210471; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VKaYciJerw3mJBDnc7jGWgSPFPx7Co7DTR1b7g2zoXc=; b=oVF689cPrdtXIyteqy1pRQ1ehJvs/SrZWllqJUfIQ/D7inZL9C+BRYZxARzZO1prSl 9oiNq3aP1vBYOnfr2HT72wXGWdzdbh6yeN2qz8i04iW9d6lpCdBY5tDLRis4+X76uYVz /qZAdTPwpShXS4ftep8uphsqTiR4mgZC+gkAOkutEh0zoNiOgVE6ZlQyyk2su+Aqys+0 xnDU3XxyrKk4KFJLIwLxWG9KCYzlEInbQAyCw9VX/R6QrduTDyxbggJWnSgdH0xqXWBp CWV31AXB7qvCKa7bHtmSVW35IT16bUaOIgL2ITCOfmycSjntTCJK3c7TOueYO+XIK6lO dXkg== X-Forwarded-Encrypted: i=1; AJvYcCWtq/ErJ4rW7U2ROcvSz9wJw5+2Gb8dfnsvgFeRHYRlCuFIQvffMMWwYmp+MTy8WYb8Gzm+06q/MluHw9w=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3vjzWbZ3vJaXfgiY2xLqKwbfdo59wp6dnn1n4Eo1ZZbgjtIaw /NmZsQ86Gs0BzV3Wo4iQNIcu+G10auGjq+Zltng5mcz9Bc2mzSzLudxfPxMKFmj7ZOTM8TwOnR1 4Ki/+27ENMfl6PizVSrca6MZRr7qy3HCL3veqmDdGCUhBRQphFPA7jz5CnOQYE+JBP40= X-Gm-Gg: AY/fxX7RBhxrrOMvJm32A3RDbyb3s/gRrSxst5Mozy8OXGPG9WTMDYOD8jmpiffIa0q r35nY47uzvmrwLvpx+LhVc7c3pvhg6Ns6YjXrbsYr4lK8+FsDCMwDPguirVlkSQmsXt0au9rHFu zGoroOkJ+DKBVlnhTbxmCNSG0gQ2YgRwzUGab7psXflLFEQeTawOBp1ULaTPeDFkHaL32tL0DRY RDpokQhnnBVwQbEF9/jbG8S96hX0n7Cgxuyv0SxWe8BZo+eudDhDgHWxS5xZzeRpU2ndW9fJ7FO f0xFzgSKv9p5BacN+V3VPowjqXIg6ftxQcckT6yvrcbSrf8HO2Co30n/U7gzkHng0yYi5tJHh4C RS4xvzXft0liQSU3b3ucWra4ndmkMSZRLsyvHN1Z9iTOPCX0W8CFLSZe4zs8El+8= X-Received: by 2002:a05:7022:2397:b0:119:e569:fba9 with SMTP id a92af1059eb24-1244a75ea44mr3688690c88.24.1768605671324; Fri, 16 Jan 2026 15:21:11 -0800 (PST) X-Received: by 2002:a05:7022:2397:b0:119:e569:fba9 with SMTP id a92af1059eb24-1244a75ea44mr3688672c88.24.1768605670731; Fri, 16 Jan 2026 15:21:10 -0800 (PST) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244af10e21sm4611267c88.16.2026.01.16.15.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 15:21:10 -0800 (PST) From: Elson Serrao To: Greg Kroah-Hartman , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Souradeep Chowdhury Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/9] usb: misc: qcom_eud: add per-path role switch support Date: Fri, 16 Jan 2026 15:21:01 -0800 Message-Id: <20260116232106.2234978-5-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> References: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: E9qRzaelASLudNvseSmbs-HII_UZe39G X-Proofpoint-ORIG-GUID: E9qRzaelASLudNvseSmbs-HII_UZe39G X-Authority-Analysis: v=2.4 cv=L4YQguT8 c=1 sm=1 tr=0 ts=696ac7e8 cx=c_pps a=kVLUcbK0zfr7ocalXnG1qA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=_OGk7KolV25BrENr9Q4A:9 a=vr4QvYf-bLy2KjpDp97w:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE2MDE3NSBTYWx0ZWRfX+hltM3jA4gMH yhqmUhOhyFFpwsq3RsDyJ031KWtgaY/TsA3izKmTFBv/DE0fLLGOSguN2r9AWcneA4TZWk/cXDi Bt13XHnnilRLT8sE0aj3Ypg9KnUs+aVukyf5CyMpnsOpKL+hgT8iqG/YHf4mcCTu1Sk0oOE/Y+H OHFE5HARZvbFcsStchavD7xxDsY59lxwbBOWX1qtZaojB4dKkrc2nPpjmCpnYV5mxk4+H2G5buD Iz3MiCVxwTKTXFQ7gz7vyT6N2o8xRKjGT5YfROK+6uYzU+PYMyHlic7yAbB0CyVmcOqxxwu7elo xcbZrD8xIFWg2+o9FEs3gkBHjlZqgVTkB9LPlgofZNvV795/Y3+/NS/AIZrltKaMSj3kQ5iOK1G oXFeeeiozQImbWNEFtrIHjbzdwnjJXsX4n3ocGoRi22kmPO29MCQtaxph5hPnQcap/hkOSZV8hh 6jJgeLHLgOw27mbbjCQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-16_08,2026-01-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 adultscore=0 clxscore=1015 spamscore=0 malwarescore=0 impostorscore=0 suspectscore=0 phishscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601160175 Content-Type: text/plain; charset="utf-8" The EUD hardware can support multiple High-Speed USB paths, each connected to different USB controllers. The current implementation uses a single chip-level role switch, which cannot properly handle multi-path configurations where each path needs independent role management. Since EUD is physically present between the USB connector and the controller, it should also relay the role change requests from the connector. Restructure the driver to support per-path role switches and remove the chip-level role switch. Additionally, as EUD need not modify the USB role upon enabling, remove the unnecessary role switch call from enable_eud(). Signed-off-by: Elson Serrao --- drivers/usb/misc/qcom_eud.c | 80 ++++++++++++++++++++++++++++++++----- 1 file changed, 70 insertions(+), 10 deletions(-) diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index 5cebb64f4a67..a58022f50484 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -38,12 +38,15 @@ struct eud_path { struct eud_chip *chip; struct phy *phy; + struct usb_role_switch *controller_sw; + struct usb_role_switch *eud_sw; + enum usb_role curr_role; + char name[16]; u8 num; }; =20 struct eud_chip { struct device *dev; - struct usb_role_switch *role_sw; void __iomem *base; struct eud_path *paths[EUD_MAX_PORTS]; phys_addr_t mode_mgr; @@ -129,7 +132,7 @@ static int enable_eud(struct eud_chip *priv) writel(EUD_INT_VBUS | EUD_INT_SAFE_MODE, priv->base + EUD_REG_INT1_EN_MASK); =20 - return usb_role_switch_set_role(priv->role_sw, USB_ROLE_DEVICE); + return 0; } =20 static int disable_eud(struct eud_chip *priv) @@ -287,15 +290,21 @@ static irqreturn_t handle_eud_irq(int irq, void *data) static irqreturn_t handle_eud_irq_thread(int irq, void *data) { struct eud_chip *chip =3D data; + struct eud_path *path; int ret; =20 + path =3D chip->paths[chip->port_idx]; + if (!path || !path->controller_sw) + goto clear_irq; + if (chip->usb_attached) - ret =3D usb_role_switch_set_role(chip->role_sw, USB_ROLE_DEVICE); + ret =3D usb_role_switch_set_role(path->controller_sw, USB_ROLE_DEVICE); else - ret =3D usb_role_switch_set_role(chip->role_sw, USB_ROLE_HOST); + ret =3D usb_role_switch_set_role(path->controller_sw, USB_ROLE_HOST); if (ret) dev_err(chip->dev, "failed to set role switch\n"); =20 +clear_irq: /* set and clear vbus_int_clr[0] to clear interrupt */ writel(BIT(0), chip->base + EUD_REG_VBUS_INT_CLR); writel(0, chip->base + EUD_REG_VBUS_INT_CLR); @@ -303,15 +312,45 @@ static irqreturn_t handle_eud_irq_thread(int irq, voi= d *data) return IRQ_HANDLED; } =20 +static int eud_role_switch_set(struct usb_role_switch *sw, enum usb_role r= ole) +{ + struct eud_path *path =3D usb_role_switch_get_drvdata(sw); + int ret; + + /* Forward the role request to the USB controller */ + ret =3D usb_role_switch_set_role(path->controller_sw, role); + if (ret) { + dev_err(path->chip->dev, "Failed to set role %s for port %u: %d\n", + usb_role_string(role), path->num, ret); + return ret; + } + + path->curr_role =3D role; + + return 0; +} + static void eud_role_switch_release(void *data) { struct eud_chip *chip =3D data; + int i; =20 - usb_role_switch_put(chip->role_sw); + for (i =3D 0; i < EUD_MAX_PORTS; i++) { + struct eud_path *path =3D chip->paths[i]; + + if (!path) + continue; + + if (path->eud_sw) + usb_role_switch_unregister(path->eud_sw); + if (path->controller_sw) + usb_role_switch_put(path->controller_sw); + } } =20 static int eud_init_path(struct eud_chip *chip, struct device_node *np) { + struct usb_role_switch_desc role_sw_desc =3D {}; struct eud_path *path; u32 path_num; int ret; @@ -342,6 +381,32 @@ static int eud_init_path(struct eud_chip *chip, struct= device_node *np) =20 chip->paths[path_num] =3D path; =20 + path->curr_role =3D USB_ROLE_NONE; + + if (!of_property_read_bool(np, "usb-role-switch")) + return 0; + + /* Fetch the USB controller's role switch */ + path->controller_sw =3D fwnode_usb_role_switch_get(of_fwnode_handle(np)); + if (IS_ERR(path->controller_sw)) + return dev_err_probe(chip->dev, PTR_ERR(path->controller_sw), + "Failed to get controller role switch for path %d\n", + path_num); + + /* Create a role switch */ + role_sw_desc.fwnode =3D of_fwnode_handle(np); + role_sw_desc.set =3D eud_role_switch_set; + role_sw_desc.driver_data =3D path; + snprintf(path->name, sizeof(path->name), "eud-path%u", path_num); + role_sw_desc.name =3D path->name; + + path->eud_sw =3D usb_role_switch_register(chip->dev, &role_sw_desc); + if (IS_ERR(path->eud_sw)) { + dev_err(chip->dev, "Failed to register EUD role switch for path %d: %ld\= n", + path_num, PTR_ERR(path->eud_sw)); + return PTR_ERR(path->eud_sw); + } + return 0; } =20 @@ -359,11 +424,6 @@ static int eud_probe(struct platform_device *pdev) =20 chip->dev =3D &pdev->dev; =20 - chip->role_sw =3D usb_role_switch_get(&pdev->dev); - if (IS_ERR(chip->role_sw)) - return dev_err_probe(chip->dev, PTR_ERR(chip->role_sw), - "failed to get role switch\n"); - ret =3D devm_add_action_or_reset(chip->dev, eud_role_switch_release, chip= ); if (ret) return ret; --=20 2.34.1 From nobody Sun Feb 8 13:48:19 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61EA731327B for ; Fri, 16 Jan 2026 23:21:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605679; cv=none; b=lTtkNT1G/qvB5bpDmt+sNIqrRZbI2ht8jYUMB94BJZfr0kHYF61kIKa6I2MTWZM6bty+teXq3qz1aE4Ya95SkLam5ks6LP3rRdoJZ+Oy2vLO7pb7QnCjdbLoObsbeQfN0S6ZJdpU7WDJaIFm+SAz2oWGWXsl3hkqtIt4K290jRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605679; c=relaxed/simple; bh=9B1FnLaHALjYfJ8RPCg5eOxKik1XLzUO5cKu4vZ+ZZw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=C6YY1R4b42E+CNA2QTpK+s8Apd+pV7jI+rzcnCei2UHq0t+9L1x1He+iot2tMaEjsJKYttu+mZhiVyOe2oGrnG7SNgkPLOKtaFjhOTcaVR4ekzijZYDMD9Ows+3PZzVgfNb8yEWcj6mFok4HM9hH00VjLn/VDXJUEqoMJsyZlvE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=jjrCbHT9; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=WHQfUpUW; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="jjrCbHT9"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="WHQfUpUW" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60GNDxPf2648035 for ; Fri, 16 Jan 2026 23:21:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=1qylKAN4jaI gqx7JT64dI6YQstiaPDg+rYzw4T90x1I=; b=jjrCbHT9ad7FMPlIIlaPJ/C0/BM 1AFKriWmjUFqj8IAXFfDlJ10BpXqzgzVn0RruFWXNtwlku1CyvhMuJgzRVC6/271 plk4aJE1pOO06jIEmInlKZ682VWu01dZHtAwVkJsMsoROXeGHCkcyKr578YLeBnE 6dtBUgnMapH/gKopOTdhTC+TiuXX3W2/7FRDL0HQ7+LSok8ugNIkmZwfoaXY63RO JBzwGBiSIJCmo1LSq8jUQ2dJq9MuOifcp+PS4jNqZ8phB1xXvLAiAAFNZqoNEvRP e16YNkzyBjzKWQp2UTNW69iSURciaBEunHkFxNoKQNAQn2gSuC8cr4nmsSQ== Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bqvedrbj5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 16 Jan 2026 23:21:12 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-2b6a8afb513so2858114eec.0 for ; Fri, 16 Jan 2026 15:21:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768605672; x=1769210472; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1qylKAN4jaIgqx7JT64dI6YQstiaPDg+rYzw4T90x1I=; b=WHQfUpUWxIdb22saXBmXZw4MzbPDOsuxZzHtvpievIPTwcCyqgXxgE/Xxi0qsD2piJ //Sf3UsK6OIxoFG8pjbcc/AS5ZB3asWQhTG9RZQrB8i/BjEstIuzDB1WMbe1ZGl4Lb+Z kTsVVUVBLvIogvlhLCi/N1yx+jlSkIQ2m7T177BIHe+SPm3XcQT9DrU2cYmS9YSZrMdd Iwa8jciQOtWyECwbUvH7dmyFCokyz0JfjEeeMgJ62pFO3XeU2fgD/Tc0mLla3VbvOq4t rNppMopCIrzjfFl2hH+hs/GDySiq7MmVb03gCpZGu3Z+qs5uTirhgQGXLNkf4HIo65Zm 0r9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768605672; x=1769210472; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1qylKAN4jaIgqx7JT64dI6YQstiaPDg+rYzw4T90x1I=; b=GgBP0Tgl+GdWpAXBK3NFTgs7IURyuCR9wToC35sOlnLYVrbZeFTYLsn55rDjcjkjQ1 sSmFb6LUtH35wN8iD6mGhrZfgllBpYWZaoV7/3Fmc0nbkVfse9yaSiGhETfTror5I2V3 kl/OLzR1vPbKAmsajwGXECyAjBo+r85NUq3gZo2Ejv7g44bGKXPZXGDRqMUh+OoqOglz RVsGdd1r//z/v/rhZFPwIXFwNDzC6iMmp2qAT79GS68dM/V9YTalkDHKzSvIXu905Ka+ ows6FQ656al1G5LpiWBAWTJgsLx3ysCe4rp5N181k4vIf9kslxXy6vROlIn2zi1JKAuD FR5g== X-Forwarded-Encrypted: i=1; AJvYcCVlqGn0QjmLvEQcr/HIkXfvb4EaUS5P3pyW+sZOrc5pfQ99cpIDtSvG1sNI2lOPe0cvaPJNBjaMftI15cI=@vger.kernel.org X-Gm-Message-State: AOJu0Yzj6SXa7Kzb7EaChrvWg215+fI3Cn8YeIf65V/C6/0KooncDd7W D/+Yry6XJFzvyeZhB8CcSJbkcw4IJ/8G5O16J28GbFGjvAZiwhKihHh+lxo5442qtx0mhC3VA/7 JPNBcavSe2IoC9yJGf499G+4ek8E402fYulotX7diBlBw8aKZxb9GIiPOIBKy+DnfXZA= X-Gm-Gg: AY/fxX6C8yh0GBx4HXSTLS157oup/kJ0HHuYkG46QcJ8SlS8vh9jqoP5gUpN6aEDfoc ASO0m8RAWlzqqfCQP3sXWXqWiO7RPZ1/78k4vjcAlAVZn8Px1Nky128DvuWb40cb3rgK8AP7vco sZXh2pdpuCe6Y5AB/JFqzYy5m9uu9DBq3UKGKJaZoUy7fRbYydmKi8CZ0nnQOLguBJy4uNriMgC 7iwtDboRAsRsNf/ZUzXgBCGsz2alB58PJFnxg6JuPOcmxU1rxTPVtCN7pzsrmf5Yk11rMh/TWL+ wUo4iGcJicZqhfs7NM8pKljdJWcJDLCn//YSmIp63EiQEKXpfy+piVJgDzJ/ClQiqR30qlkCfxo 3AHAXJXWotKVSSwTkCnN6ouNX+lGj6iYhp4Nn4xjVY45Tekd7dkt2XrulNKNTF8k= X-Received: by 2002:a05:7022:6081:b0:11b:c1fb:89a with SMTP id a92af1059eb24-1244b35f486mr3286737c88.32.1768605671986; Fri, 16 Jan 2026 15:21:11 -0800 (PST) X-Received: by 2002:a05:7022:6081:b0:11b:c1fb:89a with SMTP id a92af1059eb24-1244b35f486mr3286723c88.32.1768605671499; Fri, 16 Jan 2026 15:21:11 -0800 (PST) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244af10e21sm4611267c88.16.2026.01.16.15.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 15:21:11 -0800 (PST) From: Elson Serrao To: Greg Kroah-Hartman , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Souradeep Chowdhury Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/9] usb: misc: qcom_eud: improve enable_store API Date: Fri, 16 Jan 2026 15:21:02 -0800 Message-Id: <20260116232106.2234978-6-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> References: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: ZIF3_hKp02gBni33tKAHlSNHVEd6bQ4h X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE2MDE3NSBTYWx0ZWRfX1bxOMN9YWk+v eRYEWQeiMJvOv0Mf0apeMcb6pubzUzXu4YemSMA+vqxU4nSU0gMNn09NVDAOXpvPpGTgnYF1IMd 8p9qP9oPY8mWc1ZakZJp3Vjbk3JrOzHYfV3PhPy9e41mLPh24GxbhmuDrZNwVMggJEP9tJVvGk0 w18ITfhTlaJAOVsqpZ3laVrVw6SR7LxPuUKQcCCkssMT7Ejge6ULadFtBqjcM+eUaIRAHCe9kz/ 1C2iXKt+DbEn7kGo7AWqck4Vg135mEzdN1/yNmrukLT55jRUdIH8AGEMu5yPHiQ1HLBCJ1/jCot 9sbopOB+e9wYlO2frEcMSlHoJm1PG0p+4NQtpogb5sdfP0DNaiJUzHkP06x0X9nEOjFhC6A7Gy4 1EiuArFOtmnFjYypRzrVSyTM8E+KdBdDn1KoE+Cvw9gjeX8N5wxB6bILaClgETQBuvD2rNtIujF CGEsK8UYnkCJY6sWpIA== X-Proofpoint-ORIG-GUID: ZIF3_hKp02gBni33tKAHlSNHVEd6bQ4h X-Authority-Analysis: v=2.4 cv=A4Bh/qWG c=1 sm=1 tr=0 ts=696ac7e8 cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=iEam2xx7WbKG8qDqzoQA:9 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-16_08,2026-01-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 adultscore=0 clxscore=1011 priorityscore=1501 impostorscore=0 suspectscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601160175 Content-Type: text/plain; charset="utf-8" Currently enable_store() allows operations irrespective of the EUD state, which can result in redundant operations. Avoid this by adding duplicate state checks to skip requests when EUD is already in the desired state. Additionally, improve error handling with explicit logging to provide better feedback. Signed-off-by: Elson Serrao --- drivers/usb/misc/qcom_eud.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index a58022f50484..0ea6491f963c 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -168,18 +168,27 @@ static ssize_t enable_store(struct device *dev, if (kstrtobool(buf, &enable)) return -EINVAL; =20 + /* Skip operation if already in desired state */ + if (chip->enabled =3D=3D enable) + return count; + if (enable) { ret =3D enable_eud(chip); - if (!ret) - chip->enabled =3D enable; - else - disable_eud(chip); - + if (ret) { + dev_err(chip->dev, "failed to enable eud\n"); + return ret; + } } else { ret =3D disable_eud(chip); + if (ret) { + dev_err(chip->dev, "failed to disable eud\n"); + return ret; + } } =20 - return ret < 0 ? ret : count; + chip->enabled =3D enable; + + return count; } =20 static DEVICE_ATTR_RW(enable); --=20 2.34.1 From nobody Sun Feb 8 13:48:19 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBA4A3203B4 for ; Fri, 16 Jan 2026 23:21:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605680; cv=none; b=CCS1skTT5L1Ab6ZAr1UN4XN1zwzWJlA3QftS4DxaS2h3iaWyRvifAIqIP1BPJKYwdRiKw9lOcbyHf3sodlOFbtDQCmQK/Esx0CCQVnHrLwMiBwBThnuIjesKnRlAWZW+Ir0mU6IRizzCsUnwaU2sy2Qi+tr3rkZpob++4aJM3/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605680; c=relaxed/simple; bh=r1bqX+YKzW7Wo7iz/2rkXvfUlo4SFKFYbrl1Eh5BoSQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KYeSWJpN0h37JMsGI5k9kOgRdjVMdR2OpnOLD8d1g7pNzPbrR8I9UNPdNTThZxqKnshbyBrCnz/WlhYcRDFlRGRqYHKGL3fmmZqCOF/WhT0L7ORSozzNW4iNO3t/j4v2WZglZtPW+Js90+CaE2zhnwTOom+ZlHLfI0mO754AHlA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=RXB8wg6M; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=dfc+R59n; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="RXB8wg6M"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="dfc+R59n" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60GND0m02527079 for ; Fri, 16 Jan 2026 23:21:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=nLNoInJmlgi CyTSp0s0aDwUKBeAC7fdewIAWrT/v+x8=; b=RXB8wg6M1UqjDyu5uY1Jpz9/GxI hrey0kk7FfZZrAqcc77EesVLivRtsdSP3Y+UH+uTOgb6ue5tUVpjBw8rePqNQAQh BGjqRQM2KKMaq4Lo/Bf2Q+Za/H6C9ziZKuwkFWVJBkVLDI7eI6JiDBGrXmOLiiVp QEG2CAZi/NrilZPFmEFeSvcXrvLlBR93Ns1HbpnrUDCh6d38bTSPVd3YDPcXfSwY 4ES7HOOPeO3mqyjvHz+28QS1/4Vg7I9tN1UA1LbOZAPPi3pcyC8jfvKXLMxxGCDf F7Y+9Khm/2uN/va2qcr/4v4qkKt1wgDa+LXBpdID/0sQfxC4g0fmfdEc31g== Received: from mail-dl1-f69.google.com (mail-dl1-f69.google.com [74.125.82.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bqvevgbe1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 16 Jan 2026 23:21:13 +0000 (GMT) Received: by mail-dl1-f69.google.com with SMTP id a92af1059eb24-1219f27037fso1493773c88.1 for ; Fri, 16 Jan 2026 15:21:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768605673; x=1769210473; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nLNoInJmlgiCyTSp0s0aDwUKBeAC7fdewIAWrT/v+x8=; b=dfc+R59nKfMeRZv+Jf0hT6tKkSc0cdbC+4zH7dCtSy214k69AM/wczyXzwz6FicgDS iDH90QRNWH1uCg/fzGKnjqBDSg9I0gLVe6bOyfWjBPbQ7gatLxLNBOtr6rDZBjnYZmRg uzMYMrSosBXDj4oZkgBe4euoxCRV0cjPwY6yQxr0Do4gjHIMU9d56y04D7qg2PtWnlNW awyJwFjVJM+MIYCWyHqtF1R4y6AoAh9YYArGkLPsynxoaLL/YkDwLJEBIURQ6JIMbdE6 ju4+/ZR4ZQTQcYEGx+PjTclgQYjSpgp0PKsbdkedPqbFIlV2anF3TLqGoeKoawvnWfb2 N9vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768605673; x=1769210473; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nLNoInJmlgiCyTSp0s0aDwUKBeAC7fdewIAWrT/v+x8=; b=w8XCqt2ydDLtTyWxKMXyN6vlFklSrKR5aij19Sf5fmzOeRHWxsjork32qwrPYfbNwW T3zi1W6l4qdMvAfiF+fiA2gM5w85TMsS3jeAxNfaIGoTmP19puECTMXZOiWpWgTIPPxU w9HueM5CtDUuIkW1aOr2EYh5bq9NZ370204CpdAbUiTTd6gs4shoiYABxUUwG+2lCcdt Ab+bCU9YeuzuG0jPfPDyv8c8fl0jnHXCkmqVHueKvJR9ooRnYG4tYenjP9GMQjP3xTel r+sBhKo0DBI7sm8b4N0bc5Atmg3tMdw8xJVWddLC3dqkT/7qCX5FZnLZWQHwpS5xcNmM ZXHA== X-Forwarded-Encrypted: i=1; AJvYcCVITVTemekyuy0fqIOHlQWbtDUZfF3w+zqdzEzn7wJlwXivQJPQzwYA4VbErKZXPhH3SwQxrtRNRyn9U2E=@vger.kernel.org X-Gm-Message-State: AOJu0YxdzgfU+AEIQKSj1rG52S7W8Wz9sKFR2a3KRBvYpv3/ekFoselN 67hx5nFoe7MbCTla1HF4DXwnkmx5yYfPYr/fI6y6QXKke7u2OutrR90SK2pRrGhIM5s4MFzIM8s GVoYIqlfkkPbcBPtpHIqgU7/ud8fcfwec4pJHjl80wr9H1SyIZWirLy4BDPBWcabPMig= X-Gm-Gg: AY/fxX7EYv+HT3LfazGLY+dAC34Ow/5Bj0hlgrV508kVVDna4RSu41WqEqSQMKO9mdj iD5wcRS9div4YR+r2vxluU8nPYX1K+jybMqXL4czbIn9yp1u+DyWwnKeLzZHyGCMxZ63GXjQxqd xM7LbNAMo3EWQudV2WJzUL+h6VXods2MEGL9EuasCsz/OE2WTmT4cfBgKXd9Xr3bjrcn0B4qIQR UCP85LqjMsE60rcwWjGl9gjEhC5ZpSOGmF7oi/lTfhKIAi1RgI8gtAI7+h+jO7wukUcfapNG/jr fxihw0vM9o/BJmZPsaXJtQ8tMtGWs0/V7JDnhSyIgM7cQE66YNxkHmun96CbDHW3jXO/hpV+CcX NUngrHMJWtzdJUPrXyjXKTiDE12MsVZTwhB/I/w9n/HctCwFM5YAa13JIYulJzyE= X-Received: by 2002:a05:7022:660b:b0:123:3360:aa99 with SMTP id a92af1059eb24-1244a75ea1cmr4361082c88.47.1768605672814; Fri, 16 Jan 2026 15:21:12 -0800 (PST) X-Received: by 2002:a05:7022:660b:b0:123:3360:aa99 with SMTP id a92af1059eb24-1244a75ea1cmr4361064c88.47.1768605672348; Fri, 16 Jan 2026 15:21:12 -0800 (PST) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244af10e21sm4611267c88.16.2026.01.16.15.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 15:21:11 -0800 (PST) From: Elson Serrao To: Greg Kroah-Hartman , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Souradeep Chowdhury Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/9] usb: misc: qcom_eud: add host mode coordination Date: Fri, 16 Jan 2026 15:21:03 -0800 Message-Id: <20260116232106.2234978-7-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> References: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE2MDE3NSBTYWx0ZWRfX7PVXFbkNL6W8 SoEtvcOZibvRP4DHITBZbMbRsm2WDJ5390PRtx4ctbZSyD71T6ZiEJERYnha8Y1BLTtA/DwK/J8 13vZM5b7rawxc9CoOJUBIDnbtctKI/Z+UMf1yraCOANJJu0l4TDbaFrCxk6/UVUEYn5v85Vbe3d huDNEmcr5TS7pm2qj2+HL1XCSGjplTR7ghXfyrywyO71Rc+mO1RTfxqOrG6U6AZUcwGr2Jd5P2m lpbdUM8EoJBjK9qNLa7znnQPSjJnEhf/O9mUmB3BihKwvA+TTrkowGxtGypeetUAX9VEN2SImpW cUpDq13rJCT3dMGOV4n5/1Vv9AgLXQ01wgdw03+HBiEC36DHsQlVV2+Bhp75LYSUIX+2q6V0lf9 /0JtwQEMGhlz3N9g61w7PJIIWDGmyoRPOEi1+qLKUv4Yt7BZEo8B+8RmArRl25CXSKA39eOMPp/ uNgpEI1vZHae0ivreiA== X-Proofpoint-GUID: I1Rtv5rQrAigjqIoDVWhCNZupos2J1v6 X-Authority-Analysis: v=2.4 cv=faugCkQF c=1 sm=1 tr=0 ts=696ac7e9 cx=c_pps a=kVLUcbK0zfr7ocalXnG1qA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=0DRR6HtdnbDkULtDn-kA:9 a=vr4QvYf-bLy2KjpDp97w:22 X-Proofpoint-ORIG-GUID: I1Rtv5rQrAigjqIoDVWhCNZupos2J1v6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-16_08,2026-01-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 suspectscore=0 spamscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601160175 Content-Type: text/plain; charset="utf-8" EUD functions by presenting itself as a USB device to the host PC for debugging, making it incompatible in USB host mode configurations. Enabling EUD, when in host mode can also cause the USB controller to misbehave as the EUD hub can only have one upstream facing port. Handle below two scenarios to prevent these conflicts: 1. Prevent user from enabling EUD via sysfs when the USB port is in host mode. 2. Automatically disable EUD when USB port switches to host mode and re-enable it when exiting host mode. This ensures consistent state management without creating conflicts between the EUD debug hub and the USB controller. Signed-off-by: Elson Serrao --- drivers/usb/misc/qcom_eud.c | 79 ++++++++++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index 0ea6491f963c..3f1cc7ea2a6a 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -49,12 +49,15 @@ struct eud_chip { struct device *dev; void __iomem *base; struct eud_path *paths[EUD_MAX_PORTS]; + /* serializes EUD control operations */ + struct mutex state_lock; phys_addr_t mode_mgr; unsigned int int_status; int irq; bool enabled; bool usb_attached; bool phy_enabled; + bool eud_disabled_for_host; u8 port_idx; }; =20 @@ -162,32 +165,66 @@ static ssize_t enable_store(struct device *dev, const char *buf, size_t count) { struct eud_chip *chip =3D dev_get_drvdata(dev); + struct eud_path *path; bool enable; int ret; =20 if (kstrtobool(buf, &enable)) return -EINVAL; =20 + mutex_lock(&chip->state_lock); + /* Skip operation if already in desired state */ - if (chip->enabled =3D=3D enable) + if (chip->enabled =3D=3D enable) { + mutex_unlock(&chip->state_lock); return count; + } + + /* + * Handle double-disable scenario: User is disabling EUD that was already + * disabled due to host mode. Since the hardware is already disabled, we + * only need to clear the host-disabled flag to prevent unwanted re-enabl= ing + * when exiting host mode. This respects the user's explicit disable requ= est. + */ + if (!enable && chip->eud_disabled_for_host) { + chip->eud_disabled_for_host =3D false; + chip->enabled =3D false; + mutex_unlock(&chip->state_lock); + return count; + } =20 if (enable) { + /* + * EUD functions by presenting itself as a USB device to the host PC for + * debugging, making it incompatible in USB host mode configuration. + * Prevent enabling EUD in this configuration to avoid hardware conflict= s. + */ + path =3D chip->paths[chip->port_idx]; + if (path && path->curr_role =3D=3D USB_ROLE_HOST) { + dev_err(chip->dev, "EUD not usable in host mode configuration\n"); + mutex_unlock(&chip->state_lock); + return -EBUSY; + } + ret =3D enable_eud(chip); if (ret) { dev_err(chip->dev, "failed to enable eud\n"); + mutex_unlock(&chip->state_lock); return ret; } } else { ret =3D disable_eud(chip); if (ret) { dev_err(chip->dev, "failed to disable eud\n"); + mutex_unlock(&chip->state_lock); return ret; } } =20 chip->enabled =3D enable; =20 + mutex_unlock(&chip->state_lock); + return count; } =20 @@ -324,18 +361,56 @@ static irqreturn_t handle_eud_irq_thread(int irq, voi= d *data) static int eud_role_switch_set(struct usb_role_switch *sw, enum usb_role r= ole) { struct eud_path *path =3D usb_role_switch_get_drvdata(sw); + struct eud_chip *chip =3D path->chip; int ret; =20 + mutex_lock(&chip->state_lock); + + /* + * EUD must be disabled when USB operates in host mode. EUD functions by + * presenting itself as a USB device to the host PC for debugging, making + * it incompatible in host mode configuration. + * + * chip->enabled preserves user's sysfs configuration and is not modified + * during host mode transitions to maintain user intent. + */ + + /* Only act if EUD is enabled and this is the active path */ + if (chip->enabled && path->num =3D=3D chip->port_idx) { + if (role =3D=3D USB_ROLE_HOST && !chip->eud_disabled_for_host) { + ret =3D disable_eud(chip); + if (ret) { + dev_err(chip->dev, "Failed to disable EUD for host mode: %d\n", + ret); + mutex_unlock(&chip->state_lock); + return ret; + } + chip->eud_disabled_for_host =3D true; + } else if (role !=3D USB_ROLE_HOST && chip->eud_disabled_for_host) { + ret =3D enable_eud(chip); + if (ret) { + dev_err(chip->dev, "Failed to re-enable EUD after host mode: %d\n", + ret); + mutex_unlock(&chip->state_lock); + return ret; + } + chip->eud_disabled_for_host =3D false; + } + } + /* Forward the role request to the USB controller */ ret =3D usb_role_switch_set_role(path->controller_sw, role); if (ret) { dev_err(path->chip->dev, "Failed to set role %s for port %u: %d\n", usb_role_string(role), path->num, ret); + mutex_unlock(&chip->state_lock); return ret; } =20 path->curr_role =3D role; =20 + mutex_unlock(&chip->state_lock); + return 0; } =20 @@ -433,6 +508,8 @@ static int eud_probe(struct platform_device *pdev) =20 chip->dev =3D &pdev->dev; =20 + mutex_init(&chip->state_lock); + ret =3D devm_add_action_or_reset(chip->dev, eud_role_switch_release, chip= ); if (ret) return ret; --=20 2.34.1 From nobody Sun Feb 8 13:48:19 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF1E831E0FB for ; Fri, 16 Jan 2026 23:21:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605680; cv=none; b=AxHgtR7h9jQpIJdGEnferWGAm81sqG2pTQxqKlXdGeGHGptQk3ZWZMBwDceBrTkfo9fEAqQbR4pPItRrrze9rxm5VYsNADvKqNEE51GdLm5QvutD0OfakGY4KSx33nj/1tthNz4sCP+G0azxH8uVv5+2/uPNxidd02w+xVzG/Cc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605680; c=relaxed/simple; bh=jYMZSplTH/Weoy7w2xwkPNIev4l2TEwX13EaENGM7y4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IIjtd9TWRIWMIDirbPCojBrzxQM9V7VZi/xZKDwPstdXoacsPf/mLndEc07/mf2Z4w2Ug92EcCjFwgUylo50uvhjiYgUavY52ZOelbTatvXp1ALBvv8msDq6C6RkSG+8aWb60laTdqqalizmZsD9F/KVmp8nPrVepmiNYz/aBuU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ZCs2Y3vA; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Fa8NN4Gf; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ZCs2Y3vA"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Fa8NN4Gf" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60GNCstt2958249 for ; Fri, 16 Jan 2026 23:21:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=7PTKth0UrDe AreEEoorgLCH/1E+7Lkz0YAQpMI46XKg=; b=ZCs2Y3vAIhSwRp2Hfh2X86eqnec Vp0LrLS2Q4rJzkgo6vMRUdnShjXyQM8txvRnalpRx0A85f4v+2gasrlq/nKcv09o LXsKGXJqZcYWkCOWkrSmJfyT9C+0/J5MxYB/pyIqQsnEmhzZwKWuoLxfbsZ6LjuF a11ILSL4iGtXw0LNv8MxbTWUFg+2mtxYNXHzznJ5wVfkTmmY1NCawOLuKSYDfoiv Zo50Gt3eOZS6Nlvp8g1hRwgLpm69fRHLm314Ye1qDwTOCAMyw2/cycbKZGWLnFG/ jln7gCcAu6Vxd9t8OUUDfp50by1fxv0XPIJv74nvtHYWE86jjBvuVmI7nVA== Received: from mail-dl1-f69.google.com (mail-dl1-f69.google.com [74.125.82.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bqvhh8ahw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 16 Jan 2026 23:21:14 +0000 (GMT) Received: by mail-dl1-f69.google.com with SMTP id a92af1059eb24-123840bf029so4797932c88.1 for ; Fri, 16 Jan 2026 15:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768605674; x=1769210474; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7PTKth0UrDeAreEEoorgLCH/1E+7Lkz0YAQpMI46XKg=; b=Fa8NN4GfJIbM+nJB5tXxrqJmFhkilYLl4U+knmm48DBsxBqbyRPj3RXb9I3slPhcEz 8QPiD7N5DFM9vrrvsoukMEt5ZJW+6xqwxZGPLk3bzUVMgdD6oi5FudforWSqDxk0mZQC QoeJaPDzxiw13Gto8s9HOLZOGzXmNIubnjmEsRkOCaVY/sVk/AjmNApcPGrO3WwYYFAZ kkNtwbm89nHgBEooYrHAVpN2l7gSo8uOLo5u2dh1jQOroV+VpqGQ0li+2kLBdj5ELgJr e/YU77NUrEYqpo7mh+H6+AlM1OOyQgcewr6MF3BM5/kM+Dpnu6mPxx3oXVIolkWNR4Eq 9Yqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768605674; x=1769210474; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7PTKth0UrDeAreEEoorgLCH/1E+7Lkz0YAQpMI46XKg=; b=b7ZUdSniAS27a7WYQkcXAfZfXG9whwoy+tWFtQ9EkNYTuRNyniszvpwQIVVvWayfX2 Jy7N9MBOHqzgbRLt7+f6ZMUbmGS6oPu9bbblwxhQJxCRergRsJaAy0LtusojunF11NWx SbLITWBMEn/i9H0jTs7YrLglWsbKep+Mj7SbpskXxGQZ6B+9yOygvn4RcPEA2PjWDdTH VWiZ2cbvQTo1jfMFYgRkXBxZn3p63z/OhoAjhyw9Jy9mzFM1pmTKsJgad9mb+D9itklL XyHVvpQEQslQmb8Z3/6yIS+F0CQLbdcVF9rsFqqezZ4O92IsZoDsi7v3rku+7UnojbtT 12QQ== X-Forwarded-Encrypted: i=1; AJvYcCV50KQuj4CBvFyfxV+JpXY33otcIZaOmF6u73MDoScKOQndAap/7xma2NLAj/xDP1FZQWrKY6FhWYr73UI=@vger.kernel.org X-Gm-Message-State: AOJu0YxpRxU+57K2S4Ap+rnmUQc7hRBOghFL9ZSFTuwqpRe32NIO3gYz FxxoAzqyWtOZ9vYuGpdDXCwU2Z0aUV64vx3N76XrmREF2nVeQyHPrFVv281tke0wM1FaIA/3e3n fI6lTv8KPm7A44Cl/3FL9+k1oxZT41Ng+bY+kEfANNZplT3veJdYHBvGRAhofRArF7So= X-Gm-Gg: AY/fxX6reXBrUpeSKKrpeCVugLUIIHLpAAhu8by6Z2wziQUnVy3UiLGPLZlmBywsGbI 4Ugs1Kk8irDGzKAbNMmtyUzodpgemEJ0CfumyxQcZR1JtQ3SjBnswGMuEatSxlChrJPQx5pZ4L6 EfM/qx5c+M90kYrrfVGI4WXjBG+2Gd20JD+/71eEhpZm070QdsfZNNfT+HKfDgjCIzNopF5+Sau xJcdjkzGUeEbSZUjEIfbSXt9u+9JCOMhc4AKjhgrxrCovvhsBCdb4qATNP79CZnLZIWkxvPs/od VeNdL9Mp2Es3D3HX18wDgMmnlAEJRzgn9VqrUBuw2+4x8uzls8fwFmzdZrVqMsJyjAkyjh3oEH0 yvx+vAzOcG96NqNywrACI1G0uHZFCjIwuMqVjSAay0gsEqrTzxdVfBmVTqe3DNsc= X-Received: by 2002:a05:7022:4190:b0:11b:9386:a3cc with SMTP id a92af1059eb24-1244a78115bmr3483074c88.45.1768605673620; Fri, 16 Jan 2026 15:21:13 -0800 (PST) X-Received: by 2002:a05:7022:4190:b0:11b:9386:a3cc with SMTP id a92af1059eb24-1244a78115bmr3483059c88.45.1768605673137; Fri, 16 Jan 2026 15:21:13 -0800 (PST) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244af10e21sm4611267c88.16.2026.01.16.15.21.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 15:21:12 -0800 (PST) From: Elson Serrao To: Greg Kroah-Hartman , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Souradeep Chowdhury Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/9] usb: misc: qcom_eud: fix virtual attach/detach event handling Date: Fri, 16 Jan 2026 15:21:04 -0800 Message-Id: <20260116232106.2234978-8-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> References: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: 0JnTfZrPeWsg5aZIL9uQYOreMKy1_qsA X-Proofpoint-ORIG-GUID: 0JnTfZrPeWsg5aZIL9uQYOreMKy1_qsA X-Authority-Analysis: v=2.4 cv=foDRpV4f c=1 sm=1 tr=0 ts=696ac7ea cx=c_pps a=kVLUcbK0zfr7ocalXnG1qA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=oDIJ3hVRoRHbvujwG_AA:9 a=vr4QvYf-bLy2KjpDp97w:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE2MDE3NSBTYWx0ZWRfXz9cI9FjA+Oki xlPwlYRQtD0tBavRbD9szKSCweu/noaPq69cygjkt2LkepNS2bYoundPGs4nSrzVl5YW2ltmtlg EGbcF0LDtISBuI8S60HaFKnrwCBUgGLzGPelKggZuL12vaewClrFvv0P9hfw843ufQ4x5+lT5Na dxPbDvqLoY5NJyVRSl4CXCTHwM21G78uirnry78U4MQIEdbQmG5pHc+ugw5+EjyecKvayYMaUqq vSZJWTeHJPACBjAyKFJI3ePILU140JDbqevSaoL1CwiE3E80GKAukj8mfW64EX1JL8yyQChQ5hN TXg0ZoZGJastIRBHNJwgfZrfP0kVzSATnCNX2a74Xhb0JJ6KaZR/ZVm8mUCbSKzTRjE+6vO9yFh cjvzE2m8w9UgiuutsRg/W+HbaQwhQ9zb4/a6X4yeyl5ULLIAltVEkXG/x2cmSXwM5n1H1i5+elY YNp340go7vKOA1qBy4Q== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-16_08,2026-01-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 adultscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601160175 Content-Type: text/plain; charset="utf-8" EUD provides virtual USB attach/detach events to simulate cable plug/unplug while maintaining the physical debug connection. However, the current implementation incorrectly sets the USB role to HOST on virtual detach, which doesn't represent the disconnected state. Fix the virtual detach handling by setting the USB role to NONE instead of HOST, correctly representing the disconnected state. Signed-off-by: Elson Serrao --- drivers/usb/misc/qcom_eud.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index 3f1cc7ea2a6a..60f566427abe 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -343,10 +343,26 @@ static irqreturn_t handle_eud_irq_thread(int irq, voi= d *data) if (!path || !path->controller_sw) goto clear_irq; =20 + /* + * EUD virtual attach/detach event handling for low power debugging: + * + * When EUD is enabled in debug mode, the device remains physically + * connected to the PC throughout the debug session, keeping the USB + * controller active. This prevents testing of low power scenarios that + * require USB disconnection. + * + * EUD solves this by providing virtual USB attach/detach events while + * maintaining the physical connection. These events are triggered from + * the Host PC via the enumerated EUD control interface and delivered + * to the EUD driver as interrupts. + * + * These notifications are forwarded to the USB controller through role + * switch framework. + */ if (chip->usb_attached) ret =3D usb_role_switch_set_role(path->controller_sw, USB_ROLE_DEVICE); else - ret =3D usb_role_switch_set_role(path->controller_sw, USB_ROLE_HOST); + ret =3D usb_role_switch_set_role(path->controller_sw, USB_ROLE_NONE); if (ret) dev_err(chip->dev, "failed to set role switch\n"); =20 --=20 2.34.1 From nobody Sun Feb 8 13:48:19 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5C0D31ED6B for ; Fri, 16 Jan 2026 23:21:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605679; cv=none; b=tzRy0I8KHK1IyOFJQMCAUzDj4x2FeBkFcUbelzskZp1LTwPkIt/86uNxJr/DFIKWzHs6D01OMH4PJqEI5jNZaSgg0LoO0GCi6i3amcCin6RGmyA6DgSvymE+Tpydf0AtlCQhhyqOSo3ZWr/NMJxSxAiOoiO1XUaIfYJhpby1lTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605679; c=relaxed/simple; bh=v0VM1AbyGegd/JoyrZJcZY3z0tITTBhEtE8yYszRho0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u4HA5fzzexjIetgVN18++omPQF3xEqYyYQYiYLNEnTWKvIbIanQFv/xhgaNaum1jxfJ6bP182gFG95MB/5M1AVa5SybeCSGjAkYIJ7vv3glbv9QVFP5vwlHF0F/ANx0W3KHz8+IVd65hn0xoc8Amk7xmRJ3trXfnfGrhDKRfO0A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=QgIyl2HZ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=F9VfDtcg; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="QgIyl2HZ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="F9VfDtcg" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60GNCr2c2824328 for ; Fri, 16 Jan 2026 23:21:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=LXiIQXFkT2b H+u++kC00u044e73Da6D4+783FXlcB7Q=; b=QgIyl2HZwu9EHWDw5czg9yRsxmm lufX/DGKoG7BNEyv6Rrb8cCgziMlfw3qSSD/yKIO+1PvrNQInKOeLlwmpwT+Ygon L7JBj1zT2e/KZ+FK3vC5xPvoKMGzUU5PDEirBpV7+RHAReaxnDdZ7zCsxCRv0TOA wzc11R/DTUv1X8st12KzWwL1NLT7tSCGg8vUxGaLXTgqUSprwQPSAvjR71rDmtn1 UyduFWWrXhDEdjmL8hGH0kRUyxvdXJfFdDVNjKfFu/qmzUGyd/CIKe42hV+WztIB HntzwPspaykjZ2lgQzRZshe34Mz3O7fUJrCKbJYItDWuBrx13ZmPffQe+bA== Received: from mail-dl1-f71.google.com (mail-dl1-f71.google.com [74.125.82.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bqvecrcmy-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 16 Jan 2026 23:21:15 +0000 (GMT) Received: by mail-dl1-f71.google.com with SMTP id a92af1059eb24-123349958b2so10371372c88.0 for ; Fri, 16 Jan 2026 15:21:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768605674; x=1769210474; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LXiIQXFkT2bH+u++kC00u044e73Da6D4+783FXlcB7Q=; b=F9VfDtcgwqaeTcMPdgKTvNw20Jh3dsSwGPhiVDn65rKW5OrSvTLWaMGlCoh8oklHqE wKo8j8QdACMeGPVT4ryCOV1Idf6lWLVt/zedOOg/+w5WiHlSLQUm4r2RhEd9ySHixAwn hkg941QM5H7LDuhhOb34H01FGAy8110N1zuLwYFdSS1VlgMFi0SZ+SG3lzf9Qa2Lcfjc /pns3+dIPHOwaxx+o3bf/OteTVTuNEr0dDkVORuY+XAbB4jmDAVL7006m/qVBvkhEaI4 hkTAOhfNumIVG0MNaqcBKAHPKOP7tUFIwfg4oQYSZpZk4DC2ldHQFTN4oQ9sBBLEh/oY bImg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768605674; x=1769210474; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LXiIQXFkT2bH+u++kC00u044e73Da6D4+783FXlcB7Q=; b=MxheFfeQ8J/gEMVe3VIwWwvier0cz3qqZpbf1AdFwIntrFC/7xa2k+LTGJvZuEpZw1 /JosV2mfVECkiaqNBeiCvwneTCnf3gvpwLW4WQ4TPGZIvLiD+587Jy+4Kxt18OTHYRDB nF37jxt5t4/Kcfp6dN6ahixE7nnokQL6atyRi5oG9pyDW1VLNPkCBxpCabnDxynVQXy4 ajzKVXXfZwq9C/U3AHa5bPKiYkgrIFHWTlsTsj1lhZtKEH8QANF0ohqbXLRnfY+YRGRA 2F1WpHW2wyWwTRRrISI2dbF9jKAkbuRExwlnq+YW+CjlbYcNStNsCwiIgsMHZPkC3U2+ VWDQ== X-Forwarded-Encrypted: i=1; AJvYcCVVwp884yeF9fjWRzSLvdqysq6pUDlHJi6u3TQPix+HnbI84P1kuQcXMDEj3ryEUzxmBEX3QpO8zmsT2Pc=@vger.kernel.org X-Gm-Message-State: AOJu0YyJo7x1nBr5EFFeEa1SLoG1YbkojUiBti6zJavxxnLOQzrfZj/n p0tZ890Jgbcwsjpgc+uJ8RNMDB5oZ6LtdBaQLdU5fzyO43fs52gGU7AR49v0dSLsbAR8SoRYmOW ac2YnT9l8xmJxB7AWJhZrZLTGkOKxvXERKGXsigW8hz0UsOHWIQxHaAixVAjBOWQMFfU= X-Gm-Gg: AY/fxX6ZADls13p/47Gpta/GOxjgQN1V6HBGjHzQTdI9G2uDWNfxNIyoYISohPn/AF9 sEo8hPvVh948YCpp0LIWJq6Q0T7SozCcS3i+y+0sV+QWpQRIdSjDdUI1BoZY7v2o3bTTx4Nj5Ht VNpgRkcfCIVH0pXvQoshcFoq75e3bttSnkyJiprRSRKduks4PO9Bh1ohQZMmeB2ijLk85/6Vb1/ ZHsI7ftYXXaDBViFV85zZ+Y31iQROUcGO+arnc78MjhQNLPS/rkN6uArGjpjGIQM/ZTRDdjq1kW 1XBMCCUEUSvtXNzhcjujqrYoJeWwxPzmPZqivoG6xyuBicwrsxSqkZSXXEHLDmAkYakzuuTgar7 hEN4/s71CL/Smf9KIU8VhhAVmOwNct+12SvaxQ+W1bhdAyqqfLAD659Ylv8sj2zY= X-Received: by 2002:a05:7022:418c:b0:11d:e2a3:2070 with SMTP id a92af1059eb24-1244a7a208emr3987802c88.44.1768605674369; Fri, 16 Jan 2026 15:21:14 -0800 (PST) X-Received: by 2002:a05:7022:418c:b0:11d:e2a3:2070 with SMTP id a92af1059eb24-1244a7a208emr3987785c88.44.1768605673885; Fri, 16 Jan 2026 15:21:13 -0800 (PST) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244af10e21sm4611267c88.16.2026.01.16.15.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 15:21:13 -0800 (PST) From: Elson Serrao To: Greg Kroah-Hartman , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Souradeep Chowdhury Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/9] arm64: dts: qcom: kodiak: Align EUD node with binding Date: Fri, 16 Jan 2026 15:21:05 -0800 Message-Id: <20260116232106.2234978-9-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> References: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: t1hONzLBxMQ_nZDtgqYR8goOrRI5dP9U X-Proofpoint-ORIG-GUID: t1hONzLBxMQ_nZDtgqYR8goOrRI5dP9U X-Authority-Analysis: v=2.4 cv=L4YQguT8 c=1 sm=1 tr=0 ts=696ac7eb cx=c_pps a=JYo30EpNSr/tUYqK9jHPoA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=OcAoOLw2Dr_w_q-oR68A:9 a=Fk4IpSoW4aLDllm1B1p-:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE2MDE3NSBTYWx0ZWRfX0DIvO7fMayOw aK/6Lv+FB/CTJBQT5BEyVxWClVjHyo4UIlLiKRWofS+c7w7mrc+9S7hZulzgjWGeiOKfFztfiz9 GthsD3YnEyZ1FmR0ocnHLS08MNNuA59mUAiNwasKr42LFoavQraurVW5DDd3XxJqwYEPxWOivCe oAxxlq12788ZxQCRCxbm633WtlHoHl6LoOAwdg7F/+8fXKqoD2sP/XT3Q9EYI4GUPEiAcc5CE2Q XtQJvX7HhWWln6VP/lWCtnxgWnUTh+7tuoOnZM2fqhHMqMdGI80cQDoZP/XwE9Zp4rb9tvweT7G m0ZvR/v7pLCr6MLCh8DQQBbxltl6fA/pwrY2bNcSlY65VKdqhS+rWP6fZ8BPeEI43vZCPC8Gtc7 pKeSWz6ylH/SoybeG6CAMt51Re09Dpbyml39H49KU2c+0wG+g6CMJkkduQlO4CGsgvRUzKn+qIr jIvyqA2SKtH1qFrBWWA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-16_08,2026-01-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 adultscore=0 clxscore=1011 spamscore=0 malwarescore=0 impostorscore=0 suspectscore=0 phishscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601160175 Content-Type: text/plain; charset="utf-8" The EUD node does not match the current binding and maps USB endpoints to the secondary controller. This SoC supports EUD only on the primary High-Speed USB path. The binding also requires a per-path PHY reference. Model the primary UTMI path as a child node with the required PHY and an empty ports graph. Leave endpoint mapping to board DTS files, and remove the secondary mapping and associated ports so the description conforms to the binding. Signed-off-by: Elson Serrao --- arch/arm64/boot/dts/qcom/kodiak.dtsi | 33 +++++++++++++++++----------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qco= m/kodiak.dtsi index c2ccbb67f800..35c47a6b03f7 100644 --- a/arch/arm64/boot/dts/qcom/kodiak.dtsi +++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi @@ -4284,12 +4284,6 @@ usb_2: usb@8c00000 { phy-names =3D "usb2-phy"; maximum-speed =3D "high-speed"; usb-role-switch; - - port { - usb2_role_switch: endpoint { - remote-endpoint =3D <&eud_ep>; - }; - }; }; =20 qspi: spi@88dc000 { @@ -4610,16 +4604,29 @@ eud: eud@88e0000 { <0 0x88e2000 0 0x1000>; interrupts-extended =3D <&pdc 11 IRQ_TYPE_LEVEL_HIGH>; =20 + #address-cells =3D <1>; + #size-cells =3D <0>; + status =3D "disabled"; =20 - ports { - #address-cells =3D <1>; - #size-cells =3D <0>; + eud0: eud-path@0 { + reg =3D <0>; + phys =3D <&usb_1_hsphy>; =20 - port@0 { - reg =3D <0>; - eud_ep: endpoint { - remote-endpoint =3D <&usb2_role_switch>; + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + eud_usb0: endpoint { + }; + }; + + port@1 { + reg =3D <1>; + eud_con0: endpoint { + }; }; }; }; --=20 2.34.1 From nobody Sun Feb 8 13:48:19 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1173431A81F for ; Fri, 16 Jan 2026 23:21:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605680; cv=none; b=hOsrWQ2tzxs2D5LYTiT1B+hnMoDV0HMes23LO4Jn203v0CFdWwFuerVLUb8rdVv37phTWeorC6dZvD9QTR5i+rEv65VtoNBxSl4uRZzrzIjYB30WVD3rduA5J9jHGLQn4ioMusOStruewcYebU7K2o51EI+DdjBMcfS/zKdtgps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768605680; c=relaxed/simple; bh=oJZEE75ljDhbxjPAjmqXX/qekCyAnUUIY+vndlyCRTs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WJ+PY2N8Y/F7QUa9gAme8EmkgqNRSFHTn1azHwKQpjG81Olj1O+v4HTFvpcZoiGqKnfNDvv5vANQ+ZxBMfpVBWsBYRKq+JSvUX3W4SNRB/GrZ8XpDH0pKDL9KOKcDxvsxaGUH+YVkycMxWzl03WGxm9NC6yQYFzKpsrYVOZcuDY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=gVsbH5jZ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=JfdTpncJ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="gVsbH5jZ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="JfdTpncJ" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60GNDwgt3033017 for ; Fri, 16 Jan 2026 23:21:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=YodHWG0Qjmm xJvKMASHwO0ieWVY/Zym4kEuPLt9q2go=; b=gVsbH5jZTWKKD3qlhepO7EBZXDW qz7MdvwC6PVR8TU0rWp9UXaTIQIYUURXbZQ9/KP/jYSTx21KL04EzIPRwx9m1hUq PjFE/6YF+XklsQJ1+b7DjcKSNXBpUHhyzBvQSxsYOz6CjJG4TQyHIjGwMaTKMYsn tAiaqzzgQL5ZMYXXAaa3cb8cbT0uCKzPbPqtctpBbRXzpKb/opflF4M68UqOWOP1 PQYLKYLqrHcaLjp+6bM4SQns0HNWpetAhzgru0QjhtmsjK+AokW+i1ab40kf8J0z GrFZua5Tw/HyaKGIS1r/fhD+Ktu+aLmBqfVI1tGAMSDnATjeNYUFFKPHH2w== Received: from mail-dl1-f71.google.com (mail-dl1-f71.google.com [74.125.82.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bqvhsgabk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 16 Jan 2026 23:21:15 +0000 (GMT) Received: by mail-dl1-f71.google.com with SMTP id a92af1059eb24-122008d48e5so4736727c88.1 for ; Fri, 16 Jan 2026 15:21:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768605675; x=1769210475; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YodHWG0QjmmxJvKMASHwO0ieWVY/Zym4kEuPLt9q2go=; b=JfdTpncJ/UDALHZLWF/JGuLIQy9rNR2d0Hy230JSAARNiUqkRFZBgjSy7q5PJ+3t8I /CIwdj3u7vbls0dMuLuRtWuIpKmNlr7MpRREfjmcR6OU5FUaLy28aEAiKiYFEStmMrnC tODceKXYCUfh2vKoPpNDt8giHkpIUM0gkvzJPwdYRZvQ07jHkpTYpRCI+YcS1NQiCr8U gwWTivVUOre8Muq3nvqSmqacHhGSt7IdLuHxxbZc5EcFmVY/6k5M8+8DmzirGM+DA6gP i/ZSJFOf26RB/fkrJMd/+pARXb2Y0EsUvJQJrxQmhifp8WCbF3Ojs6p/sh2b+/c0fSh3 OY/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768605675; x=1769210475; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YodHWG0QjmmxJvKMASHwO0ieWVY/Zym4kEuPLt9q2go=; b=AhGNICrRuZVU03659zTaoDbW7VEWGyWAskkOsryV7brz/0tg2liFhbTcL/fAwRQvEB 129qxchTV7xP6ASs3XIAOYqC6DK8yyBM2miIV7xc80ja+pirGtrsg5Q2Su1E4nw28hVh /fMrFuzWbb217ftV1/epvmBkKdkW5ps+3hE8wnCyU3dxvKJEohULTCn1N7qar2ArTZ1P NE4vJHD43O3FJnDQ3w82t/zuqmugVBVinY6Wa5uZQ211Wsz213BtgxLoQ5T2t+sB07y/ UwSOd6PI83UqJGK78dON+bAxn6XPYNxKus6SpcAbgMJooEwMpfVZ/m8qEo11nlcpzLBE LgkQ== X-Forwarded-Encrypted: i=1; AJvYcCXF46KIz9ilaUMly+nUgHomuL7nGlYGaPIye7YH42vYd64ofkChKQ3/f8/slSlEOZdGoFcAXGC7jeFevC0=@vger.kernel.org X-Gm-Message-State: AOJu0YzeVgT13nZu34qosrX7qPJgsSEdrZ+CwABuA3mjZ6eOB8qGme2M YfBeMV40f4ffTnfylVPdPd5SGpz8A5ptUcXPiAEorFTtLIJiYncdQ2TEfpKsJQwUAADdibPIm5+ L6yORW1fMhJ3P/I1uK5IjUhuZ8S5VJqrzsQeHsaJUliHX7hgq+PVbJVtx/BAM8GUQhh4= X-Gm-Gg: AY/fxX4OLN7y/i0XSww/PXFdms3DEnR/Qqz4KI0uRTyznlnCPnMZRbDfZawPKhBW4GB uGbdwDeeKvyUI1XRm51s+iy/8cELYf6nW6rwWQ01fyf0QYf6n8HFHlWjJEnt7T6UIPIPAnpMh/c IFpRcrIPaIgucx8Tinib6YYu7vGhtwTSJ/KR8LeH0pzWcycG1xdwushtrp0d16GgJd7+b6romov gGhuP+vl5TjI7tM4W4BKkoalf3WkxoZiK8FRr4evofsRE0olihXKWB43VhqoX++kGwLKQFEYSky 9PKcV6pgrJ1Cr4nJ7ZZnaPvPFEQv/AVVfWpCqvm3JvukBa+ZDzSA5xMEfdIF4LcGuq6Ig9XBcFW W2aM/LlrTQq3FiwaSI2h6W7tcpovDSywEwB5a0FPMAuo3qUWPe5gHnysCL4TNQig= X-Received: by 2002:a05:7022:128e:b0:11b:9e5e:1a40 with SMTP id a92af1059eb24-1244a72e9fcmr3479666c88.15.1768605675167; Fri, 16 Jan 2026 15:21:15 -0800 (PST) X-Received: by 2002:a05:7022:128e:b0:11b:9e5e:1a40 with SMTP id a92af1059eb24-1244a72e9fcmr3479651c88.15.1768605674645; Fri, 16 Jan 2026 15:21:14 -0800 (PST) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244af10e21sm4611267c88.16.2026.01.16.15.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 15:21:14 -0800 (PST) From: Elson Serrao To: Greg Kroah-Hartman , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Souradeep Chowdhury Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 9/9] arm64: dts: qcom: qcs6490-rb3gen2: Enable EUD debug functionality Date: Fri, 16 Jan 2026 15:21:06 -0800 Message-Id: <20260116232106.2234978-10-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> References: <20260116232106.2234978-1-elson.serrao@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=UOvQ3Sfy c=1 sm=1 tr=0 ts=696ac7eb cx=c_pps a=JYo30EpNSr/tUYqK9jHPoA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=bAolQom50hykzV7YMrMA:9 a=Fk4IpSoW4aLDllm1B1p-:22 X-Proofpoint-GUID: MJ27UV9MqGrLOnAIwM1Wa03euRyGi9pB X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE2MDE3NSBTYWx0ZWRfXx8dXfCdwJ1CE TaSQxZI63Cpd0HDBERkW+Sy4pLFpgv9sqEiKRXkCeWHHhcKaD0RuAuN1pa72j+pmhdzSygfAgf0 ICpXbct4VnbSUDrJ8cLuQTpxf0VaN15NqezQ0KyJN7g5k6eUDn1EeYJ/HPrGffTVM4ey3BjiO1Z vyiv02j0O9Ykum2TFYDlWq5g6CFlIEJ0TrMBsAzyQxFFT4OgoIeJAih92DTboDw/gWHr6TU9y2M Q5gTd8Zlf3lA5e4NgB5sKSIWAU8uUBPTofgCKvgQKT4vwz0016mUL8iu3XfJ2NsXr7UhI8MY5Tu P6KLdK1rn4qct2kcr+gkaQq+6PNBwhZfe3JFC2OVgntUxnH7Qd9mIdkL4NqjFtO3VKF7jq46YTI 83owwV/MFIJ7LqD8xj7+aq0PpPBVZuX+/0+vFGf4lubN3uTPZC+wrVixKLJ9zqi4NhKiQmweGFt lqRkIjZ2M+bYqd1OVKA== X-Proofpoint-ORIG-GUID: MJ27UV9MqGrLOnAIwM1Wa03euRyGi9pB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-16_08,2026-01-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 phishscore=0 spamscore=0 clxscore=1015 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601160175 Content-Type: text/plain; charset="utf-8" On this board, EUD resides on the primary High-Speed USB data path between the connector and the DWC3 controller. Update the device tree connections to correctly map the connector and controller endpoints, and describe role-switch capability on the EUD primary path. Signed-off-by: Elson Serrao --- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot= /dts/qcom/qcs6490-rb3gen2.dts index f29a352b0288..2fc2d0aed8dd 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts @@ -194,7 +194,7 @@ port@0 { reg =3D <0>; =20 pmic_glink_hs_in: endpoint { - remote-endpoint =3D <&usb_1_dwc3_hs>; + remote-endpoint =3D <&eud_con0>; }; }; =20 @@ -1176,13 +1176,29 @@ &usb_1 { }; =20 &usb_1_dwc3_hs { - remote-endpoint =3D <&pmic_glink_hs_in>; + remote-endpoint =3D <&eud_usb0>; }; =20 &usb_1_dwc3_ss { remote-endpoint =3D <&usb_dp_qmpphy_usb_ss_in>; }; =20 +&eud_con0 { + remote-endpoint =3D <&pmic_glink_hs_in>; +}; + +&eud_usb0 { + remote-endpoint =3D <&usb_1_dwc3_hs>; +}; + +&eud { + status =3D "okay"; +}; + +&eud0 { + usb-role-switch; +}; + &usb_1_hsphy { vdda-pll-supply =3D <&vreg_l10c_0p88>; vdda33-supply =3D <&vreg_l2b_3p072>; --=20 2.34.1