From nobody Fri Sep 25 12:00:31 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 470B23D1A82 for ; Sat, 12 Sep 2026 22:53:07 +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=1789253590; cv=none; b=DTY8xXsq4fUbuLYTgfV3lGmArZi23LxgRBX7qa8Z6igDoIosIVXPOKFzTWZXPdDgBoWEgkgBPzHJaI3smWNIjwrCuMeNFLJPRI0AZ9ZoEzBa8e2FAqDWyyl4SqISROc5Z96X3puWcxF64YByV81Q5IsEM3HraUV4zRdQvlLnsHE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789253590; c=relaxed/simple; bh=NS67m12FohtVTM0LAceMS1EJYY9P5UQk+hL/TSpoW4E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TnPybZSEIj/lhBeTtdj+XujMmr6hZrbHCzAqrMYF0MSTYst5U6PhsoWXLIPgMzcLU7lSnE8rk21xR/U1zYZHRkrssSszN63Yr665EpQKeMAlHWqQSH84jIun5um8TW4bsGWHgicBA4S0j7queRbYlO/M2opb/XVDR58Q3TRwjuo= 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=jDUtrZAS; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Ue9Vz51d; 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="jDUtrZAS"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Ue9Vz51d" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68CLoTKU2947339 for ; Sat, 12 Sep 2026 22:53:06 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=mjs3rlDnLUk N31VdHb88E8QJ4KDT+KUi0fn1sZoUpDA=; b=jDUtrZASU4zSm1oT1OWb6CujYGu 3VHS9ZqUu9i2qLC71XTqukm7bWcnoYoqKUQLVFeP5F8aW40RomjcnNFkB6OyU1ij 2M+7ux7X+/5lDDRy9aYVcfIGpYYw91GEfoQgqs54yVd7q9vzYvC8/On4XAnUL30R 47cqaZjA50pXcv14fHl9hlEPzE9B/XhrPozkMRT0afoy1pspKFH+q7f54Y8eRJt8 ujojGJASfisZH1K0rkciGzgrp5r9pnicDVXDTGyVpgO54OIFuPMRRlEGZFgm9FyL m7kB0JooX1tovQtYxXKhQgj4c+eF4qeggfZcmptlZD0IeUZujkgFnPbwLKQ== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmywh1ybb-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 12 Sep 2026 22:53:06 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2dcfed75f77so28493855ad.2 for ; Sat, 12 Sep 2026 15:53:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789253586; x=1789858386; 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:content-type; bh=mjs3rlDnLUkN31VdHb88E8QJ4KDT+KUi0fn1sZoUpDA=; b=Ue9Vz51dPPoD5COXhuyu54RdwQDzpLzGYJ4k2pPoklqf9BenF5cezGKZv8NYaSCqpA HV1w8xIgyAmA88VnAHalhJc4i8nnnyJJnBXOParNPe54k4J2f7/aGsXJDhhS5s1TwWnY u2oxyBv42AJtK33geR1EmbEwlxWI52LNF07oorX1pEe66/Y86lfoayjnTp2639afTlap sDD7gTB8pMr8P3DCN9qlToFiknHzq+qKDTZJNDjVah0pOyQg86y7BazKAlLcJaAu/NSF eFxcuQr7soRatUM54pV1JRM5xcr6+hDhc87zRPiqBb/yei8u5STUqr+8F7SNkWnYWGX2 ij7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789253586; x=1789858386; 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:content-type; bh=mjs3rlDnLUkN31VdHb88E8QJ4KDT+KUi0fn1sZoUpDA=; b=LrQYz4exWOJRNkT0vnHzbhZ/F95yvIqcsz79UofApHOvwAm2geKJl8iXog3fmukdfl /k811h3+VqM80YNArXiQHAwAth+dHCKSjGBSOp+4C0DjPkaUFkCxt80zvMteWSikuJ2h xxsvYtK5s6qgcu/k0nCA9IEtRnb2Pp4xYwM4v7RXkUrk/EwLymJ/zSD6JWJgR0yGbvtF VuKRei9pFkMXouWJ8QgQzokVYmcBEl2igUsewxoOxfyOWG9CrWpOYApHFXnYUTQ7G02b Y8+O2ILZfmaV9bt7vQXVx3oAtpyrRX62aGDKH7FJOXtYHgt62XT1/upj1HE+1XYqGeb0 Eo9A== X-Forwarded-Encrypted: i=1; AKwUvBykQIrdB+a9aPoM3Gtn6oxginSRkr9TZExiUQ0oOV4cafAg9E20NBSUPeBnbx+5uVDAhOYO4/WCb6gtjZo=@vger.kernel.org X-Gm-Message-State: AFuF++kuREqBp/VzuabYw20bWLR9cIyMVedNhRvh2ti6FYQW3jGb26JX mznhWJH6qOQszjUEGXpjmdCP54PzBoXJ0Xe2XSZM8N4TfnW2QgFBXer+/3uH0E1NG+XjuQXUux3 weqZo4nx7YB/ObSQ0zpw53puuIlsI1Ede4cn36Y2oLx/qSRQ+KPt4C7yu7K/t4aFeadA= X-Gm-Gg: AYBFou3l4CYTNNWD22Qk+QX1DskikfxfDDOE7aVqP7F78+EJPyMNKengh3xlMMZe6Ph X8SduUn0NejYlmVakwX6w51q1Sw29k+de9MjzG9NpUrlYIakViilIj7IfD9Lv1HeE3pIJHA2xer 8YpwC3lpz0hPv3ywf2Q7UU3Nm98mGkGoKg25Ew45WUqg/D14588EWEROSVQ9lyRcy5Z9quPzX/V xQzQS6bQ9CbRK1p3Fdru1t4dm3yI59ifaJCYXqI1tfgbsz5/nyGSyWszTGMSaMtN9kNjFqe3Kbq BX7kFgTJe4LkVBvGkvauVtrF8oSIZTQuepvvrAwvsAT6yI3zedx9lJamL+nNYRW3Fcpu3x8o4Qv KRfHfAKm1nU0+vPAU8b09IQKeUGsGezYksE6E5B3I49hPDwTmnbTyrQ== X-Received: by 2002:a17:902:e74d:b0:2d6:fec3:bd57 with SMTP id d9443c01a7336-2dd2a34b154mr185634415ad.14.1789253585796; Sat, 12 Sep 2026 15:53:05 -0700 (PDT) X-Received: by 2002:a17:902:e74d:b0:2d6:fec3:bd57 with SMTP id d9443c01a7336-2dd2a34b154mr185634155ad.14.1789253585359; Sat, 12 Sep 2026 15:53:05 -0700 (PDT) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f5833fsm19741555eec.23.2026.09.12.15.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2026 15:53:04 -0700 (PDT) From: Elson Serrao To: Bjorn Andersson , Conor Dooley , Greg Kroah-Hartman , Konrad Dybcio , Krzysztof Kozlowski , Rob Herring Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH v8 1/8] dt-bindings: soc: qcom: eud: Add per-path child nodes for UTMI routing Date: Sat, 12 Sep 2026 15:52:54 -0700 Message-Id: <20260912225301.3396556-2-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260912225301.3396556-1-elson.serrao@oss.qualcomm.com> References: <20260912225301.3396556-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: 8kXUngvlJIIkZ0WOY7gi3Tu5CbhXSGYs X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfXxjE60aggYfDn 3gb16xblzDLN1IakSQZa0QodHZlGJSjffCDT0aTd9C+Pmxdw2TqkaOnLPEBm4y2NEwi6sZAyptk 0mX83cAOeNrq+FfBWZ9y3ZW1MrzCkSt9hf05Qq8dQ229MpgDhF6M6Auh6T4zZ7wmcwswe9cCTeL n0JBHWcDFThYT59Itxro51kZyNsPU7/Hu7rSID/cgGM9PUIzk5wWpXt/d5/lGI2AO6JGJZMfuTi tgZKfmEadMyzAbUsY9B5ppC1AHzawr3ZX3QyGtLffgeKGnWFZDpjxsCRTNY+FUGbYdV1LtIcNEU ffF1jkaHiGU2WNbjFIJJmRaJmhEIkpn7ZFDkwYshzMD3ZB4SjRMYxomZ4LXrtv7Z8qViotwUy4h mgeozL6okbmTXGJBKrfIi/a+LodETzgoHxcKPWway2iIRVbaDO97fJoFkn9EfPEuK4ASWKOyQ+r U6rk/XdE6/6rRT2J3Ww== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfX0xw/X0J3C9j/ /Pyv2NfdjBmTfXv6igNuGhocc2rEo0mv0OGbXmAiveNMbe3mZP7MGBMvtNRARqueCBHykFm54fq cr/AyERQ3BCxbrHysXDEAg7JwfGBZf8= X-Proofpoint-ORIG-GUID: 8kXUngvlJIIkZ0WOY7gi3Tu5CbhXSGYs X-Authority-Analysis: v=2.4 cv=PsUG/AM3 c=1 sm=1 tr=0 ts=6aa5d7d2 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=RJ9lep_nkaVUh_m6BXgA:9 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-12_07,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609120334 Content-Type: text/plain; charset="utf-8" The Qualcomm Embedded USB Debugger (EUD) can intercept one or two High-Speed UTMI paths depending on the SoC. For example, SC7280 supports EUD on the primary UTMI path only, while SM8350 supports EUD on both primary and secondary UTMI paths. Each UTMI path connects an independent USB controller/connector pair and forms its own role-switch domain. EUD routes traffic based on USB role. In device role the debug hub is inserted, while in host role it is bypassed. The existing binding models EUD using a flattened ports representation. While sufficient for fixed device-role configurations, it cannot naturally associate a controller, connector, and role switch with a specific EUD-routable path. This is problematic for role-switch capable ports and becomes more pronounced on SoCs with multiple paths. In such cases, each path forms an independent role-switch domain and requires per-path role awareness. Model each UTMI path as a separate child node with its own OF graph. This representation is used for role-aware EUD routing regardless of whether a SoC exposes one or two UTMI paths. Add an SM8350 compatible for dual-path EUD topologies. Retain support for the legacy flat ports representation on SC7280 for backward compatibility. Reviewed-by: Krzysztof Kozlowski Acked-by: Bjorn Andersson Signed-off-by: Elson Serrao --- .../bindings/soc/qcom/qcom,eud.yaml | 138 +++++++++++++++++- 1 file changed, 137 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml b/Doc= umentation/devicetree/bindings/soc/qcom/qcom,eud.yaml index 84218636c0d8..90dc104e4475 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,eud.yaml @@ -18,6 +18,7 @@ properties: items: - enum: - qcom,sc7280-eud + - qcom,sm8350-eud - const: qcom,eud =20 reg: @@ -45,10 +46,92 @@ properties: $ref: /schemas/graph.yaml#/properties/port description: This port is to be attached to the type C connector. =20 + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + +patternProperties: + "^eud-path@[0-1]$": + type: object + description: + Represents one High-Speed UTMI path that EUD intercepts. Use eud-pat= h nodes + to associate role-switching behavior with specific port connections,= allowing + EUD to manage role transitions independently for each UTMI path. + + properties: + reg: + maxItems: 1 + description: Path number + + usb-role-switch: + type: boolean + description: + Indicates that EUD relays USB role-switch events for this path a= nd + performs role-dependent UTMI routing accordingly. In device role, + the EUD hub is inserted into this path to enable debug + functionality. In host role, the EUD hub is bypassed and UTMI + traffic flows directly between the PHY and the USB controller. + + 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. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: This port is to be attached to the USB connector. + + required: + - reg + - ports + + additionalProperties: false + required: - compatible - reg - - ports + +allOf: + - if: + properties: + compatible: + contains: + const: qcom,sc7280-eud + then: + oneOf: + - required: + - ports + properties: + eud-path@0: false + eud-path@1: false + - required: + - eud-path@0 + - '#address-cells' + - '#size-cells' + properties: + ports: false + eud-path@1: false + - if: + properties: + compatible: + contains: + const: qcom,sm8350-eud + then: + required: + - eud-path@0 + - eud-path@1 + - '#address-cells' + - '#size-cells' + properties: + ports: false =20 additionalProperties: false =20 @@ -77,3 +160,56 @@ examples: }; }; }; + - | + eud@88e0000 { + compatible =3D "qcom,sm8350-eud", "qcom,eud"; + reg =3D <0x88e0000 0x2000>, + <0x88e2000 0x1000>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + eud-path@0 { + reg =3D <0>; + usb-role-switch; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + port@0 { + reg =3D <0>; + eud_usb0: endpoint { + remote-endpoint =3D <&usb_1_dwc3_hs>; + }; + }; + + port@1 { + reg =3D <1>; + eud_con0: endpoint { + remote-endpoint =3D <&pmic_glink_hs_in>; + }; + }; + }; + }; + + eud-path@1 { + reg =3D <1>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + port@0 { + reg =3D <0>; + eud_usb1: endpoint { + remote-endpoint =3D <&usb_2_dwc3_hs>; + }; + }; + + port@1 { + reg =3D <1>; + eud_con1: endpoint { + remote-endpoint =3D <&conn_2_hs_in>; + }; + }; + }; + }; + }; --=20 2.34.1 From nobody Fri Sep 25 12:00:31 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 743503EF0D7 for ; Sat, 12 Sep 2026 22:53:08 +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=1789253591; cv=none; b=RxbGC6zOIU7ORuXBzAG1A/Xl791e53rmRxpswo2rI1e8d3yGhRD4ezAQWGjozOUIixaa4KeEmQJUzVpXDI3SqXZrcHNAXG40KJmVeRQNLlNFs+cnNp9f4uvTFX1nmqTX2rqP48suaY2/2vraptTGs0DiAEh0HSsSbFl7VNDcCcE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789253591; c=relaxed/simple; bh=3WiTeifuqmMeArbH1dtfZ7piLUat0wFfmRGWAJmbbCI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=o2dN43pxtplK07k7mAWpjddtBqlTGxR7YIpM1+ZbUMXxVApA5mhtTDiUho6xJepHG1sOK7znwfknpW42Li4WBc7s9sxOiYr6UhcgAm7IvdcRDF0LcweJQZTglh9JlqE1W7hmlGr7xOW7V8L/iw3rdhF5+XpRk4e/xExnlZ1M9NI= 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=LHnKbCvb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=jFAPlxw5; 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="LHnKbCvb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="jFAPlxw5" 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 68CLnUsD3672995 for ; Sat, 12 Sep 2026 22:53:08 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=U2yiW6/w/O3 YW3IoJI1OCamD5OwPHelC5r8nyjpV8WA=; b=LHnKbCvbc4kV9j7uaKOmM+o0uGh 63M9osBslA+A3JwrhnUFtBp/gU/KKY1/HpwB2WXSqqDb72F8kwAvTBHIDqS1oUqY gVGU/kX7zBwH1BPSq66pWUnhI7QFLNZyw+L2ChKGCgcj86qBF5MnCRE2bex4LydG /QAbKJFPpXtMl801AxOxKy1aAsAD3fMaUl1nB3HyVn3sgtkQAnacF4BcbTKhRu/Q b+EYaZ36gNPZY7fQZtruis554+KEZpCoRS+3siwJyGCdTl0jq12xfsIVQ8BpdpQM XD0yB50qEodtk/2MDCMS34kF/TITSSLmkzV+xrOQVCpKST97tIT+LyPTuPA== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmygd2360-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 12 Sep 2026 22:53:07 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-39db5b5f98bso2124188a91.2 for ; Sat, 12 Sep 2026 15:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789253587; x=1789858387; 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:content-type; bh=U2yiW6/w/O3YW3IoJI1OCamD5OwPHelC5r8nyjpV8WA=; b=jFAPlxw5cuN8oB1oTogTqwKwMK34/340R3n5UXsNufKY4zVPIdtt9wzyVf+eUOUMu0 znIv9j2eSO//DGydBAeHf+enSTEjuoo5JHedWnnE9HONtK+zkqxmXJchQGkw6efWR1V8 AgAKRp9plbgCJpBHq6Jym1mhN7xusZeOXj2Bskkj1z3Hj9bY3F9ePOX/KSUp5HqPA4I0 4sX38ORwVqMf9OQYIzveFFHsGZ5crTDaVPvTgIfK4ZUO5T+ERIfaZ19adhP/dVlG0GKW ZU0Fe49/okDhVBbM48hosBDwCHYP3pvBoe163BZhxl11YldpMbemjH+QBbOstRqlAfoP J1Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789253587; x=1789858387; 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:content-type; bh=U2yiW6/w/O3YW3IoJI1OCamD5OwPHelC5r8nyjpV8WA=; b=Bog3GVzpWWlKyLDVSmwdycrC6J+tEIn0lZ1eNTvHjHFS9sqdCPhZW7IOyzolbbb3Kz +0BgRlk8auvdnCS4T2nQGhqnVWPggwmLlQ6B043kGJXvNRaxKu6kgD/ljGDpqrT4t53r 1/h48WGDyXCYedykuOZEgys0knQRCgvIHETQ6PfJJreTkJ9XmuC0fSpRp614cPMiWsrP p9KBnj3eXQDnY/73qigLDxlzTnsSpSWLw/YhGDBDY1GaUMS5g4SgUXqAuUMguT/yHhJj NchjZM1koTs5Bxl/d9oZ+2luVoTFg578seMpXg3rolYlFeel2FEVvdknonmhQeA4jKjI ExMg== X-Forwarded-Encrypted: i=1; AKwUvBz4xS2XE4NKyNc+qbrxSMcsYFEXRS7RtfLi720dzaQUD+1OsLImfIZ7+ePH6/G1PyGCPzXP15nhoK3JQf4=@vger.kernel.org X-Gm-Message-State: AFuF++nX98GVobR1iV1b2tOm3YgJm00zwWqMDE+0m2e+k4Vkg61vtJ61 hOIQKET0hV6KglqeeU8d9GSsGvPTJ8eBvRJDNe6S4CVQJxoQI0MbBexx2CyFy6r0YYHhP+mSHjC 5Wtiml/w2mx6EBSonofPwt9GN3Pcj8Y7dScu7I/EKtmAZPKgqPlvBkJZL5M0+nnhLlkY= X-Gm-Gg: AYBFou3ZwuJOaTvPd8R946vQkAVjTGUY6gBV226E9puXEpeipHV5g8XDM/DGiWbKSJ3 l/zobzW5HAi6W+2W4X/wIgC8jOIShrnNQmlN1LO893jfAoAoU5G5DQwD/tI5Cb11vQSgiJcQ1b0 92mYzIgLtSLtEqFuJqgI0puLY+mDd+Em87BMA+MRIqNVo0hxFD11mOM0pZw/EGmOxvCEJy6xTbk Moz/d9OyMhHGcYdDY9ypEw/xBRU18jLVm/L1RR7zk27c6Q0HsRszaXw2jWGitgDbajB7uTJ/1uc C2x/FzPA5vCxJr2RuXRRlF4hoM2BjCZXbSWWUjEGYtvFDdZ44wd2aw6B2WpeqFiVL2HPcmxmKPJ 9mWhl+i3o/JFLgs5odLZJlvIKl94STr/+CGrLv7VXa9eQpH6XBoydtQ== X-Received: by 2002:a17:90a:10d6:b0:39d:cbb1:c96f with SMTP id 98e67ed59e1d1-39dcbb1cadbmr2556069a91.18.1789253587034; Sat, 12 Sep 2026 15:53:07 -0700 (PDT) X-Received: by 2002:a17:90a:10d6:b0:39d:cbb1:c96f with SMTP id 98e67ed59e1d1-39dcbb1cadbmr2556052a91.18.1789253586568; Sat, 12 Sep 2026 15:53:06 -0700 (PDT) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f5833fsm19741555eec.23.2026.09.12.15.53.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2026 15:53:05 -0700 (PDT) From: Elson Serrao To: Bjorn Andersson , Conor Dooley , Greg Kroah-Hartman , Konrad Dybcio , Krzysztof Kozlowski , Rob Herring Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Chen , Konrad Dybcio Subject: [PATCH v8 2/8] usb: misc: qcom_eud: add sysfs attribute for port selection Date: Sat, 12 Sep 2026 15:52:55 -0700 Message-Id: <20260912225301.3396556-3-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260912225301.3396556-1-elson.serrao@oss.qualcomm.com> References: <20260912225301.3396556-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=RY0FmFtv c=1 sm=1 tr=0 ts=6aa5d7d3 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=qXh0dugIJu6lbCvlF8UA:9 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfX8gxu516FMimm D9VU+1zNDgADlIjan4gm2ykEr+YOAYEqDFk1jX7eUGp1uu+G1agfCqauLETfsqoM4QDAx9Z20B8 Ewr9JuJv0yjthZ0Y1iOGw2Hq1JdWS0aM2N3S+si/IHSVWXx7pk5b1aXhVJ8bVkqYgw2AjvmaXA3 wdz932qtmR9wbbrStssjEBP/IPpNX2CITPCRfvattTxm2Z1RHJ/xEI7GcEZ1t0b05P38x1Qnpcp muzc5SBx2OsO1G36DtJ2aiNpIKHYZ3k5TQ/opUoJc8gbHCrr+OxCIktgmtZITGzPTDdIB19Szqi l6RHqZfSyUq6UOFHG3tn5+OO0k8WNvr2Nvxo1czxW++8g0mgIlRfFvoB7WtO/Hv9NBJA3lG4aHj KwbiflHFUYFNTumQJRnEi/mpGdeN21SuC7VMyGcYM5ykgSUj9X3bufj6pMOraGiWlWol//gvIwc DfkPqw58swf+qkdnMnA== X-Proofpoint-ORIG-GUID: p9XvmfM4d--iAvsu3gnQlhMcwPC4-dyy X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfX5NxE61z28QBL +o0F9GnNjUyRTQN5EqD4M4IG3qHNReaaigDpqTMoHtJxXulOJNLo2rpDtKC5oZ9DTustyX5VF9r TSWFce8nXeFAvh5xJ6Bqq1VHRBLs0Eo= X-Proofpoint-GUID: p9XvmfM4d--iAvsu3gnQlhMcwPC4-dyy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-12_07,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 spamscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609120334 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. Reviewed-by: Peter Chen Reviewed-by: Konrad Dybcio Signed-off-by: Elson Serrao --- Documentation/ABI/testing/sysfs-driver-eud | 18 ++++++++++ drivers/usb/misc/qcom_eud.c | 39 ++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-driver-eud b/Documentation/ABI= /testing/sysfs-driver-eud index 2bab0db2d2f0..fb927a003596 100644 --- a/Documentation/ABI/testing/sysfs-driver-eud +++ b/Documentation/ABI/testing/sysfs-driver-eud @@ -7,3 +7,21 @@ 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: + primary - Primary USB port + secondary - Secondary USB port + + Writing any other value returns -EINVAL. + + The attribute is writable only while EUD is disabled. + Writing it while EUD is enabled returns -EBUSY. Reading + the attribute returns the currently selected USB port. diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index a7b9ed4ac071..d32d382a311e 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -23,14 +23,22 @@ #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) #define EUD_INT_SAFE_MODE BIT(4) #define EUD_INT_ALL (EUD_INT_VBUS | EUD_INT_SAFE_MODE) =20 +static const char * const eud_port_names[] =3D { + "primary", + "secondary", +}; + struct eud_chip { struct device *dev; struct usb_role_switch *role_sw; @@ -40,6 +48,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 +113,38 @@ 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, "%s\n", eud_port_names[chip->port_idx]); +} + +static ssize_t port_store(struct device *dev, struct device_attribute *att= r, + const char *buf, size_t count) +{ + struct eud_chip *chip =3D dev_get_drvdata(dev); + int port; + + port =3D sysfs_match_string(eud_port_names, buf); + if (port < 0) + return port; + + /* Port selection must be done before enabling EUD */ + if (chip->enabled) + 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 Fri Sep 25 12:00:31 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 3D04B3F076F for ; Sat, 12 Sep 2026 22:53:10 +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=1789253597; cv=none; b=cblzAzN+Yr7X7RtSPq0UsWgE8tASxwf/MPHulmGVDczjCavr/Qa90/WitmjKT0wxJbmTskAz+7q4U7Ur1+xqdm459LS+9uoLFboLuy286o01Jw6GzeX6mIuTMxYqDvzMz+PEgxB7Fg+6HlOgFb4l/XMpgip7ucBh1DAKVxIfHqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789253597; c=relaxed/simple; bh=rVdkz760Q8fXyAseABchn8U5vS/oKnuFm6WPsfdcnjw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=b1i2UoPEZ3NpA2nmlyJaMp9RZ0mft1TAuCDjRJF/51TrwHI8d1ycmPXxGiWYM3ohsL9dxtOl831eo6aH5eKpsxXhvbO9Eb3cUhS7xFcYFuM7Ms3BcGy0z9CNPE4L0YxFReNhua6udKv9Kw4ltsI+S9f0zHY6gu9MBqtdGHMv99c= 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=FjUhv9aM; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=YmLt1jfi; 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="FjUhv9aM"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="YmLt1jfi" 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 68CLnVsf4183768 for ; Sat, 12 Sep 2026 22:53:09 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=rDAPLYVM6TG uQkdtNKjVBPeoUGkbJB4PVCw18G3tQWo=; b=FjUhv9aMxUr3gJZRDsLyJBt0pFU njR8VLiwl3f63i0mSFYgxVcr5qL/H2Ho5yMdjCdmzVJPmcG+BI4fduJT/u/SozjD OYRF9EmOsRYBWZW/zxEzPwXJJbS8H/cDoI7qVGvHMLmnLm8huY8gjJoO6oZX+Pn9 xZCQn4HaUoRojN1Mp78Ux2jlLagkAKdLytiJOh4BfNCzqnaaGSL2RBxpiknPb/jY KxYAws89cWMF67xJqNDVPxrj+gIVdbl0Ngt4fAmM0n2il3mzdrf7UtOShCOLni4P qhcuGaOw1AhtSL6lO1F4ghTOt0dJerix7VxuHSUqBxFichBsYbHBW+hUvMQ== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9d22jf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 12 Sep 2026 22:53:08 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-39b77130a7fso3634251a91.2 for ; Sat, 12 Sep 2026 15:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789253588; x=1789858388; 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:content-type; bh=rDAPLYVM6TGuQkdtNKjVBPeoUGkbJB4PVCw18G3tQWo=; b=YmLt1jfiLIPdU8EpP9U9QUeG4ev/M/ORLzohNdXZwLHlqpScxhQT+l9DKddjwb1fuK 2xPVe3eMvDFiJvjSqkuvaPuEayHUQ0SUbvzxbdoX/5IQF65IC25lnzubeCmsO9HdJMGq BlvaM/welgp0w4d/tViWeAoCMc5bQ2DIIDGdISfY3mhTyZBed6DGa1JAKpFcqDVFiTVO 20YJ6PAefm6roXGpKfaXMM780dwn6BGB2hpjncNJ92iIv0RvZESHPyYl9gXuSErwt3Xa +qx7KhTrusvpjX3x2+mtZGs7K5tvEoXrtsXHh2JqAp4eyDrM8Z0DRXK04/2BGwiR9Ead uzUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789253588; x=1789858388; 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:content-type; bh=rDAPLYVM6TGuQkdtNKjVBPeoUGkbJB4PVCw18G3tQWo=; b=qg9fZOl6+tgHoEu6yeIubfdt9xZI3eIj/KwwcCQh697ly1TLC8DThnW1+fqCuuqy4U nWfxIWnSzYn1yLqDnDvHPIG0nB1MhhdxfA3I25msoPPuF+kjCBY1e57y4J2Qa2YziEoI CwEH0j/1mTT8YiedAdarU1u4lf5Kc9D4V0wk4t8EGISNhKxNb5tGgKNr8bqLzwuEfEWC CD50Zw/4ajIfxpJ8vIL3Kh2Gtrtj6QIrJpc8k7nWkNHdfX/TQWVsgkodIxIqnb9DAAMj OZt8W2zp4RU3zicWfTtyvqpq0ZmFe2h7sAjE91U+z/GEi89OzTx3rz/NgUv6qwsuuXUO /9gg== X-Forwarded-Encrypted: i=1; AKwUvBxTyivzBR+vKg1GEUrZTIuXmKlMO102CixnpcH9sXpSein9NCqwKoe93zYGpJ9jZqPNjYSH5VxauO5yQLA=@vger.kernel.org X-Gm-Message-State: AFuF++mRnjKXr1/b/cOJKYHLGGiC5qOWZhmEszSqMvJdd594ub0ymVbu OWvFeS2ZeJVFyjuAIYbHWw8QWEbeNwPWCr42bcv1+nBxlbzAYCJpQWLm+aX0mWAgIIklSm/rK8F qbkupmiq96IqS+7GyiQRlwY46jzmVOu7ZYaFruBV+vyKnuY2l2jEoIie2cKGkCVDWapw= X-Gm-Gg: AYBFou1dg9EWBe89y5gvVBmqlfwi+xWsOadn7BRHFWtilet38qBRPk70qPiZrRrzfiv E4H7a4SBPRncEa8tpI6cRDu1piXemrjpvBHlWEtcYi0MZTB0SjQoBiCoDS8E1BdH/N/gfGS8cnj Pf9EVVrvgUPCbDivzztJxJ5R74g1HiDc/lmldUjcWtatqdTn3yi2ctgWjuHWnfeluEaTST1HSzq uzNxZagAxh7OBRdE8iJtyGUevjinZTCQqSn83OMZUKHUo6IKKbJwQGVK+syiB0uo8cRYWOg7mU+ SQ+GITy84PJNkZq8Ou+u4T1cqKq/v3z+hxyotwVFkLb/cC16IaRD2AMoAenxCKkINk1693OW4ab SCI7Cr3PQnkIXT5P4BgBkAhEyL/a76ELQhdSf95lD8EK1beZoxMk3IA== X-Received: by 2002:a17:90b:5243:b0:398:c724:1bb1 with SMTP id 98e67ed59e1d1-39dbc0c3777mr9261917a91.8.1789253588200; Sat, 12 Sep 2026 15:53:08 -0700 (PDT) X-Received: by 2002:a17:90b:5243:b0:398:c724:1bb1 with SMTP id 98e67ed59e1d1-39dbc0c3777mr9261887a91.8.1789253587789; Sat, 12 Sep 2026 15:53:07 -0700 (PDT) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f5833fsm19741555eec.23.2026.09.12.15.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2026 15:53:07 -0700 (PDT) From: Elson Serrao To: Bjorn Andersson , Conor Dooley , Greg Kroah-Hartman , Konrad Dybcio , Krzysztof Kozlowski , Rob Herring Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Chen , Konrad Dybcio Subject: [PATCH v8 3/8] usb: misc: qcom_eud: add per-path High-Speed PHY control Date: Sat, 12 Sep 2026 15:52:56 -0700 Message-Id: <20260912225301.3396556-4-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260912225301.3396556-1-elson.serrao@oss.qualcomm.com> References: <20260912225301.3396556-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-Info: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfX+XSn9mIX6MOd PZ5rTod6CpyilwoFjHlXyN31S0/2rZ9kdqMcU0CNWHja/kYTeuQsSvS02LZdoO1byWD5WouVTlO P2qRhdVTcGSDwwEtpoMZkAC/RBhAgqM= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfXwlHs1yJmIveB 5vfcNqIX0zJSfIrspX4JURXLzGguZ18xfUXOHEKEoOi/DqetFyl1yAV5RjIgvVG0Jl7tU4VbLpu mO3VFJX7Iylqw13HPEGJ6sPDk8GELMY2dQ9S3axPMhK3Xru8OKrfEejHsWl5Nl1bgO0v14Zj6Ps hWv/zjYsMDGxcXIxgr/8hKaaaDCUpT8HkpGTLXA7Cl4fxlGAgWMEXudjUo3N10e49id9ZzxmglY u/CwNgN1B3xpHOBa7NoMQvQ0PLE92nXMxdQBComlWYPr6dNVmd/5lTC3eQgkhKzwKOfkyI/aEKL +Ao57lDVckjpVc34E94zch4+tDfM6ri2Xs/y6CH66Mnibn6er/iYe+5L2Zc60KXPFNiHzxUOU4Q ewy/mvs+u89ujFCbhvzZ7/x9wUx9+VUXPXulmFpKqdbsv+GrqCFILmljFCb0zAOwVLK/GwgcMTu 0TvFnWxlkkWyTusazKQ== X-Authority-Analysis: v=2.4 cv=IOSXmQvG c=1 sm=1 tr=0 ts=6aa5d7d4 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=OKkk4dbWoaB1VCfbt-4A:9 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-ORIG-GUID: l30P-q6llHMeERhyf0IRWk1ksmGLu9ga X-Proofpoint-GUID: l30P-q6llHMeERhyf0IRWk1ksmGLu9ga X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-12_07,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 clxscore=1015 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609120334 Content-Type: text/plain; charset="utf-8" EUD hardware can support multiple High-Speed USB paths, each routed through its own PHY. The active path is selected in hardware via the EUD_PORT_SEL register. As a High-Speed hub, EUD requires access to the High-Speed PHY associated with the active path. To support this multi-path capability, the driver must manage PHY resources on a per-path basis, ensuring that the PHY for the currently selected path is properly initialized and powered. This patch restructures the driver to implement per-path PHY management. The driver now powers the appropriate PHY based on the selected and enabled UTMI path, ensuring correct operation when EUD is enabled. Historically, EUD appeared to work on single-path systems because the USB controller kept the PHY initialized. However, EUD is designed to operate independently of the USB controller and therefore requires explicit PHY control for proper operation. Reviewed-by: Peter Chen Reviewed-by: Konrad Dybcio Signed-off-by: Elson Serrao --- Documentation/ABI/testing/sysfs-driver-eud | 3 +- drivers/usb/misc/qcom_eud.c | 124 ++++++++++++++++++++- 2 files changed, 125 insertions(+), 2 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-driver-eud b/Documentation/ABI= /testing/sysfs-driver-eud index fb927a003596..f20b82b5a38a 100644 --- a/Documentation/ABI/testing/sysfs-driver-eud +++ b/Documentation/ABI/testing/sysfs-driver-eud @@ -20,7 +20,8 @@ Description: primary - Primary USB port secondary - Secondary USB port =20 - Writing any other value returns -EINVAL. + Writing any other value returns -EINVAL. Writing a port + not supported on the current platform returns -EOPNOTSUPP. =20 The attribute is writable only while EUD is disabled. Writing it while EUD is enabled returns -EBUSY. Reading diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index d32d382a311e..70915af40ebe 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include #include @@ -39,26 +41,84 @@ static const char * const eud_port_names[] =3D { "secondary", }; =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 phy *phy; + int ret; + + if (chip->phy_enabled) + return 0; + + phy =3D chip->paths[chip->port_idx]->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 phy *phy; + + if (!chip->phy_enabled) + return; + + phy =3D chip->paths[chip->port_idx]->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); @@ -75,6 +135,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 @@ -130,6 +192,10 @@ static ssize_t port_store(struct device *dev, struct d= evice_attribute *attr, if (port < 0) return port; =20 + /* Check if the corresponding path is available */ + if (!chip->paths[port]) + return -EOPNOTSUPP; + /* Port selection must be done before enabling EUD */ if (chip->enabled) return -EBUSY; @@ -227,8 +293,54 @@ 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 device_node *controller_node; + struct eud_path *path; + u32 path_num; + int ret; + + ret =3D of_property_read_u32(np, "reg", &path_num); + if (ret) { + /* Legacy DT uses 'ports' node without 'reg' property; treat as path 0 */ + if (of_node_name_eq(np, "ports")) + path_num =3D 0; + else + return dev_err_probe(chip->dev, ret, "unexpected child node '%s'\n", + np->name); + } + + if (path_num >=3D EUD_MAX_PORTS) + return dev_err_probe(chip->dev, -EINVAL, "invalid path number: %u (max %= d)\n", + path_num, EUD_MAX_PORTS - 1); + + path =3D devm_kzalloc(chip->dev, sizeof(*path), GFP_KERNEL); + if (!path) + return -ENOMEM; + + path->chip =3D chip; + path->num =3D path_num; + + controller_node =3D of_graph_get_remote_node(np, 0, -1); + if (!controller_node) + return dev_err_probe(chip->dev, -ENODEV, + "failed to get controller node for path %u\n", path_num); + + path->phy =3D devm_of_phy_get_by_index(chip->dev, controller_node, 0); + of_node_put(controller_node); + + 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 eud_chip *chip; struct resource *res; int ret; @@ -257,6 +369,16 @@ static int eud_probe(struct platform_device *pdev) return -ENODEV; chip->mode_mgr =3D res->start; =20 + for_each_child_of_node_scoped(np, child) { + ret =3D eud_init_path(chip, child); + if (ret) + return ret; + } + + /* Primary path is mandatory. Secondary is optional */ + if (!chip->paths[0]) + return dev_err_probe(chip->dev, -ENODEV, "primary path not found\n"); + chip->irq =3D platform_get_irq(pdev, 0); if (chip->irq < 0) return chip->irq; --=20 2.34.1 From nobody Fri Sep 25 12:00:31 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 1855E3E008F for ; Sat, 12 Sep 2026 22:53:10 +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=1789253597; cv=none; b=DGIuPuoNdfFiRHscr5+PlZfbiP6CCg7rdGEUdEODMFG4BmGhnABWTOV6u35n3f883GacERHsS6QpX8pw8zg28AMKIDF8EKMtsKqKpjQ9kJyVxmb/qcRdY8J1lzwwrVuB1jYxIWNj0EE1+hAwiNy0xPYIYrawCRMTcR5Wh8awgew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789253597; c=relaxed/simple; bh=Juz/dj/HsawOZiARwrkb5JL2xT5tPmr5s7r7g6se4cE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qgvB8M5t4cnHmSW9mFxeeaWuofmxUVY6ALGV3ClChKGY99MRSsByWqMWhZj/3M4RApaiGuYI17YROaVZpfKQF1lpb7uG/gogkcJBnY2OPqMvLsB23Q6zJqk6kKb+wrrv6VXRxArxBq2eWk0bi2RvZ+lW3wwRR7coBxf6BFGnFIg= 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=Bt1skkw2; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Q55Iz9rU; 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="Bt1skkw2"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Q55Iz9rU" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68CLnXCX2945324 for ; Sat, 12 Sep 2026 22:53: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=U01oEf9Jomm cGM9nob9JiPSs71KM3XNLbec2UNPsGh0=; b=Bt1skkw2KiSTNh/FgKP8ROXiP0S GylrCmnJ7ZSYHaATTLG3B2NPxbF5QBi1OX7TxRfKSq1FX/zibANSmzBXWmGRdkx2 8pvOenQZasE1VAihAoaiBTYifQOm3v9ZvLUl967BolE0lSnmV6gSGgAN4tYNhYSE 4d2nhcSGB2g/xvB1ZO2F5rVqKTfyEE/Rmt82cHwjV7esSJMSuo7EE/aOTbtqw9iC 3ktfMQC8eNqy1aBsKvnqhxCvJN4VJx+ijivoIUVU6HNNzu1cFXAgh/wMHiS/0xua pCelBzEjyDowdVtu5Rpvxy1tl/xcp54jg11ThuMuIX0LT43yxDsg4NdgPwQ== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmywh1ybv-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 12 Sep 2026 22:53:10 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-38e54b6556aso2798479a91.2 for ; Sat, 12 Sep 2026 15:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789253590; x=1789858390; 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:content-type; bh=U01oEf9JommcGM9nob9JiPSs71KM3XNLbec2UNPsGh0=; b=Q55Iz9rU9tMYZ6qxycLs4hhwHw/2hv1EVLOAvsdNbOgA3x+LyEpaEzaXSi3YJRdj85 pJMCNR2zPj30Ob72A+QHfkC0eJ/lziAtE/lQa9fDENSRqoTVyoj1kryyBS/efb50tDEH /PCWk3uoD11eLp3ioXUTOouigeQeO+AXFPQxFFUxs1F2vHC/3RjWdTRTVAVEfknBMjWM Ql3EQb+sjUKiEX03O/qFCzkTSJXu8HH9/yJIBP41IlbQwfopWUqpuGHhZox5ZocApktM d9EOHY8Ey8AHoOvIDKabEZv3qK57m5jKc+1el+BMNL5GHMnKqqLuE8e5LmOrM47KZ6mq 6Dsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789253590; x=1789858390; 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:content-type; bh=U01oEf9JommcGM9nob9JiPSs71KM3XNLbec2UNPsGh0=; b=RdKChzIVklb51uJbIqYawS3+RgOADRHbc8nH3JAJT38X5GXrFWJZGVmMwC2c/gu71K aVMN8u5OOH8zIOlOxgm1Z5uuIsgnWh4YFrqseD8EO39nKMbNpih80JhRq6ZE186ecvw5 AAVFY3NP8OCNSH6VnwIScF3whR4NvFra9vEkX5ixVmckIDtdkFFbJ1izZxI3MHt4ArOE VZvssLEmZWtdAUVzoHbwVxRtDJ8PRRCqQ+fDvs7Zvb6UmxsHuYvn9+1UIDcNnZCLLOVl 0U/+pZfrpD6owa4yUlUJ+jPxddUGHV7Xttd0yOCO2Bn0MiBqenqM+ChVqAvRdLeBu1fX ZC9A== X-Forwarded-Encrypted: i=1; AKwUvBzmMCbR0w6l75adeSEXX4FcpVfj05BLzGxpZdMCsAEo9cV58xZje7ZjWPLhJK5+e+NtNUSlSjChHyWpRwg=@vger.kernel.org X-Gm-Message-State: AFuF++kVuoxeeyNyOnfwz3CQ+49LFMIuuKwcSCWB3IU+xXc1GQcon7zO uQhiFD2xSz1TWZK8H27Ebf9mvW1JL9VVrLr6kJ2iclZQs1CK5SUqh5cBLfd7HXRXhsof6/UeasX /RJHH2RndiqtPb5ZdeOX7+qGXKCmZo203alwiMFxYjxtTwScF2MCQhlNpzWjwXs09uXA= X-Gm-Gg: AYBFou3lzOMPYBQlCrGL2gH7v4HIkWEadbLBkSVekmcUC6IFCXKyRjABlIzQjZ5w51I paiNApwfvDHDMX4jGrPsb+mmLr3m3T5Sqc01qRl1ngjtfTiVl+P0SQZTf6qwfjrKnH5CfX1qbJN YOmJQu9+auBICIyC/jzEYKU3mDvWGSB2Y4uG2oO9r5pJuFF7FJwId1dozWroE0sItBzhzAaHJ32 3IyvySo/JLaguLtDJZ4caEa0N+5SMHWOtsqSLEtb0UdWW10X++/ahnBac4oXbbsdCcicgbNwlRM x54pPJ7puFfFcw79IVopeXNLbLuFUEDl+LTGjRPPYKTMrg6fnnmJdbKLx5wWtJq456QWger7BQH YJ8UpwjX7pIcza4SU70B6EI8yG4nledKU+9ma9mdinkDBmSro+1WwDA== X-Received: by 2002:a17:90b:1a92:b0:398:ba0e:96f6 with SMTP id 98e67ed59e1d1-39dbc6f0686mr8355552a91.23.1789253589573; Sat, 12 Sep 2026 15:53:09 -0700 (PDT) X-Received: by 2002:a17:90b:1a92:b0:398:ba0e:96f6 with SMTP id 98e67ed59e1d1-39dbc6f0686mr8355527a91.23.1789253589169; Sat, 12 Sep 2026 15:53:09 -0700 (PDT) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f5833fsm19741555eec.23.2026.09.12.15.53.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2026 15:53:08 -0700 (PDT) From: Elson Serrao To: Bjorn Andersson , Conor Dooley , Greg Kroah-Hartman , Konrad Dybcio , Krzysztof Kozlowski , Rob Herring Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Chen Subject: [PATCH v8 4/8] usb: misc: qcom_eud: add per-path role switch support Date: Sat, 12 Sep 2026 15:52:57 -0700 Message-Id: <20260912225301.3396556-5-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260912225301.3396556-1-elson.serrao@oss.qualcomm.com> References: <20260912225301.3396556-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: DuqInmvOxvaTKTmKJxkaUvEK9lyaRnlx X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfXw0tzByGgvayT xjETFbp+f8kFtE26TIm+qeEC8/hJoaxsF23xa2sxncOUY3cucYxoAEd3oHfPF9PpZgALiFdDt+y cPvaRzN/ERHMro22bBsB+2OiD3lCbC9vvhSi1hfVeyEqSz5RbWi2XbIpijdDL7mz8FiFj1tJCKw wlkmToQ3yeL7xNgbiGTwGqO5kc04xwB4435ZDEqGru19Y/M//LJYA0CpKAetb8s9r8pIcGa+9na bWfjzOFP9R5ASM/bN74C7IJ3R48uypMwVGoPWP6vGnjl7Z6DiRTJIHLYwPWmBWB7+bd0IIGg53R ybw7LvikKNdb4CsSnvLbDInOCofiSR3MZXsn+CCarno1uNdSbL6e4/h7ej5c69W5tPwC+qPpy3p iuPkC1qPiYriPNVy7xlIk2nPXSf2KgIACPES1VlQNyOPd93LH+IoN9j13yFfYcuJbbDRNvTmIOK cyFgZMmXLb/D+qA35jg== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfX4qi35LoWFiuw JSXcquw+05CPiwzcc6zGZhr6azO5vn2OEb15g7Aq0X50zQve1liD77IU1HOiVDgPJrA6Rzgq/8r Ib7VK2Fyo6AOyYpjCSeosGwPYZLdK5U= X-Proofpoint-ORIG-GUID: DuqInmvOxvaTKTmKJxkaUvEK9lyaRnlx X-Authority-Analysis: v=2.4 cv=PsUG/AM3 c=1 sm=1 tr=0 ts=6aa5d7d6 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=7LOY1QleUuiESi-gyjEA:9 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-12_07,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609120334 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(). Reviewed-by: Peter Chen Signed-off-by: Elson Serrao --- drivers/usb/misc/qcom_eud.c | 103 +++++++++++++++++++++++++++++------- 1 file changed, 84 insertions(+), 19 deletions(-) diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index 70915af40ebe..e2694c6109ba 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -44,12 +44,15 @@ static const char * const eud_port_names[] =3D { 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; @@ -123,7 +126,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) @@ -270,12 +273,15 @@ 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 (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 @@ -286,17 +292,40 @@ static irqreturn_t handle_eud_irq_thread(int irq, voi= d *data) return IRQ_HANDLED; } =20 -static void eud_role_switch_release(void *data) +static int eud_role_switch_set(struct usb_role_switch *sw, enum usb_role r= ole) { - struct eud_chip *chip =3D data; + struct eud_path *path =3D usb_role_switch_get_drvdata(sw); + int ret; + + /* curr_role tracks the role from EUD's point of view */ + path->curr_role =3D role; + + /* 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; + } =20 - usb_role_switch_put(chip->role_sw); + return 0; +} + +static void eud_path_role_switch_release(void *data) +{ + struct eud_path *path =3D data; + + usb_role_switch_unregister(path->eud_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 {NULL}; + struct usb_role_switch *sw; struct device_node *controller_node; struct eud_path *path; + const char *dr_mode =3D ""; u32 path_num; int ret; =20 @@ -327,14 +356,59 @@ static int eud_init_path(struct eud_chip *chip, struc= t device_node *np) "failed to get controller node for path %u\n", path_num); =20 path->phy =3D devm_of_phy_get_by_index(chip->dev, controller_node, 0); - of_node_put(controller_node); - - if (IS_ERR(path->phy)) + if (IS_ERR(path->phy)) { + of_node_put(controller_node); return dev_err_probe(chip->dev, PTR_ERR(path->phy), "failed to get PHY for path %d\n", path_num); + } =20 chip->paths[path_num] =3D path; =20 + of_property_read_string(controller_node, "dr_mode", &dr_mode); + + /* No role switch needed for fixed role controllers */ + if (!strcmp(dr_mode, "host")) { + path->curr_role =3D USB_ROLE_HOST; + of_node_put(controller_node); + return 0; + } + + if (!strcmp(dr_mode, "peripheral")) { + path->curr_role =3D USB_ROLE_DEVICE; + of_node_put(controller_node); + return 0; + } + + path->curr_role =3D USB_ROLE_NONE; + + sw =3D usb_role_switch_find_by_fwnode(of_fwnode_handle(controller_node)); + if (!sw) { + of_node_put(controller_node); + return dev_err_probe(chip->dev, -EPROBE_DEFER, + "Failed to get controller role switch for path %d\n", + path_num); + } + path->controller_sw =3D sw; + + of_node_put(controller_node); + + 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)) { + usb_role_switch_put(path->controller_sw); + return dev_err_probe(chip->dev, PTR_ERR(path->eud_sw), + "Failed to register EUD role switch for path %d\n", path_num); + } + + ret =3D devm_add_action_or_reset(chip->dev, eud_path_role_switch_release,= path); + if (ret) + return ret; + return 0; } =20 @@ -351,15 +425,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; - 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 Fri Sep 25 12:00:31 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 59F643F166A for ; Sat, 12 Sep 2026 22:53: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=1789253598; cv=none; b=dKW7bQs9F+XI6Zh6MSHFs+Vyqd+bgfK6Bm4hsu5tKXxkQ0muZjR+TLUKwc2FQ7DdIghJwKDnQFDF7B02aP6QMR1wBjtw6YJl51ywvpgKc77ZtvUsJqrvOSOYc6TxwJatR14FIKCKiwZsZYZmUVn/DgQlLpteBQfc1f/zz5EcfNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789253598; c=relaxed/simple; bh=CxINbAgj0KrvDpn80rfuC0LTbqzZ9PR7KL+bHMKUQPU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tkGYJOjoAHPTEcp+dbYUZN+JTcSy17ru/2IkM2I3hcGplT1WnZe0dJcv1R0nDngTps2KnJxOk+ZuJYacgEiHlxyWkj6CPuqVDej3TtVNtBe8vzYD/LbJYhceMqJJj3vPjQPnw92lDwChU1qXho3IQaTBAFoGV2v7aUZzxc0KYf4= 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=owe+Eb0S; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=FkAqggJL; 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="owe+Eb0S"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="FkAqggJL" 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 68CLoZr83674504 for ; Sat, 12 Sep 2026 22:53: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=HseOcJDMkSV 2wbU7KryEfZ/oIZYLo1W223ZlnWsKMso=; b=owe+Eb0SQ5iWsXh3cPMn4r6vbWI fighoJnvEZkaPKFEMGUqWw8+3YVdjzylbi7CjKJP1nzJgoeAJvC1UigSGsYKFfFa 3jV8KhYqqxGjHpKqYA49UkkfbhWpSuVL/H2xK7v63rNUISAmJIZVc4ksyRYVGAHy UKICzxPaGjHA4BeYMOgV9kaUpZXP998OeJv/pdsiRNClw5L5HCXKn5z7+DxyUHZ/ fQcjE5dZIzkCFwA2PZ96gO440o7+q0ZhA20ZncG/D9evpjbocnMZok4809Ym2I+6 5Vs6BwlIaHgoJWJJC7vhvW9GPf3TmLtmc5zKRSSx5bD1ImVqNedG9+adjlg== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmygd236g-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 12 Sep 2026 22:53:11 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-38ecc48b3c2so3363058a91.1 for ; Sat, 12 Sep 2026 15:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789253591; x=1789858391; 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:content-type; bh=HseOcJDMkSV2wbU7KryEfZ/oIZYLo1W223ZlnWsKMso=; b=FkAqggJLDJ33m55Qlwx4UZao09tL05vUTx0AuCS50H9Hetai9JqnlC1eC1Z+12DlUJ pvHR0oXpN8ExkVps0DVT9VoK6VaM1Yc9PaXVsh21TYLRWlIj4npViDXE7aF/H4t5IQAs EW7k/EQtnvRrI10fPWd7qYR5FPGzvFwMLDAutGAO7Zpmb64rtD0EsYcVbN7ArhxkrFKJ W/RTi4NCKf7Y19bkpC9WVLY4/YamzD5EZnfvxJ5eiPiwV/CsEaP1n4AZFxD+s5+jb78y ij+1fkWvBfsHAz2z+qhflFx9H3tVjrHvv+pXLLvFn4WYGpQk5GmCKMQOw4Ck0th/yhRV Fwwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789253591; x=1789858391; 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:content-type; bh=HseOcJDMkSV2wbU7KryEfZ/oIZYLo1W223ZlnWsKMso=; b=Y5IG1lacT0iroqiriqPEsWtLmzcxGda1f3N0i1U8kD2HKY4+awu2QypRavJFyq/5J5 Lqx54qfaDb/bzL7kr8p9UDS4THym+fMNXbvD4aoNWnuRCD0xZUPV5NOqCJHSr+9P006V vGxV0NknYgOOMqqyHNalyhpgMFJKRSri0x66F91LSZPVdUNsbCMBeafF/XHLsqXTjiVE fEk6CBg5nxGhcFxznvggibymN/t/MHh8ssd32ek02WZyIIDLulXFw9q7cVCdT2t+Egid hpOlDwuUamiDl5WEi1RE1i7G/45pmPrsSGIGeCctb4eDS+Al04cltmbjVtD0yIu1cqiN Y4xA== X-Forwarded-Encrypted: i=1; AKwUvBy8VI8myKTGussHVnHpKWmXZa8vAemRZJPQDFuEgTFNjLTVgHI3Y96J7S624eKR4lntvcfY2PCy3l8TzXE=@vger.kernel.org X-Gm-Message-State: AFuF++kXgv+P4XIf9Ue/1CsbTJ3KegPfvvNwy3nqhA3c3kaw2l3+Qrqr zOEU5nnMnAzp+n77Aq/T+iPgpjGWTPkAFQih/pVhTl+fjK6NJtEF+m48vNAG7Z5Xbo2XJt7GI02 jDHsTtsuAo+txMcB9RowCxR1IrddJFvp5tcpYYENQC/I3WLAJzbGKzLW7PG0Ehie8PiM= X-Gm-Gg: AYBFou2o/WKTn3H+1XQChdccxfzv9Axw2e4drCL/XdtZxSF3PP4HuPxzwHZ6R0RRZ3D e/bI4fYnOQAc+Uxo5Ovan8bJ9ZOdjr9Zmm1MxtPLiMSgDFkLQ0+RUbctqr5Mjltu8cW96/6Covt Bqn53Vws03g9dri0u5UFnXcf7paHMK6c0bddwT0pgvCnLHC1HOsIU4ITNI7ATVvDnuk8aotdOpy pIY1By7stxe7+Y4ZSVkGoBPablf6G5P3zaLNS75oDsgKHljRNBn46tH+EZkfy/1XtcpLjRN61vI hR3fYe8IJAaXWdi2LDZkUIjtSJ363DwSla4SX3UpUbxo1K1yLpJ6DAsW4rwlbLr/siatPMY+iOs j0dpbwD5wOyLQN+XkhST/DGQp31qrC5KhKpL6V+zzLoac506qMWHxxA== X-Received: by 2002:a17:90b:4c0d:b0:38e:b400:a860 with SMTP id 98e67ed59e1d1-39dbc6a3e56mr8467481a91.13.1789253590685; Sat, 12 Sep 2026 15:53:10 -0700 (PDT) X-Received: by 2002:a17:90b:4c0d:b0:38e:b400:a860 with SMTP id 98e67ed59e1d1-39dbc6a3e56mr8467436a91.13.1789253590284; Sat, 12 Sep 2026 15:53:10 -0700 (PDT) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f5833fsm19741555eec.23.2026.09.12.15.53.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2026 15:53:09 -0700 (PDT) From: Elson Serrao To: Bjorn Andersson , Conor Dooley , Greg Kroah-Hartman , Konrad Dybcio , Krzysztof Kozlowski , Rob Herring Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Peter Chen Subject: [PATCH v8 5/8] usb: misc: qcom_eud: improve enable_store API Date: Sat, 12 Sep 2026 15:52:58 -0700 Message-Id: <20260912225301.3396556-6-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260912225301.3396556-1-elson.serrao@oss.qualcomm.com> References: <20260912225301.3396556-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=RY0FmFtv c=1 sm=1 tr=0 ts=6aa5d7d7 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=iEam2xx7WbKG8qDqzoQA:9 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfX2VmVCwIOMxre eUNDNG9KriGQScxePYDwCx3x8CyWvZdbrmS7YPrPd59vGL9aHOvtpZJ/VTL3EYlmh/NeffWf7AU uO9j6/Wjxp14MY900E9m+xBui1XGvA1eUEpvmgYFJygwnRuHqUvT00AgZWKyA8V7Cm1guUhjr3/ x5zLPYwrkcTA6ImcvzPhYEE8OgimPGzmh7gdokh2TQm97CIorvM1Ihd7deMiI4RB3d1n7i6ojxr c0xj9CcKzv2GriFi8nJhNmfOssC1VwulzxcfvZgbsuvg2kym0rjXwfQMdfCXplnXWTaMEGyIaGl nwmrBFPoYcAwS8I9Z0PEsu9ZIp+99fNAhPRhwqfj0N1KYR3jH2iGBXMZMCytdRQC8kyYOqqY8BP c7JgMEagWS9DhrX/nQXYutqsilhEjFCXHVKhy7bG6u/behmBE7owdsQfiTH1QblLzUAFIVU9ZTd qnPNgZIK+cJ9Ej5Zzhw== X-Proofpoint-ORIG-GUID: JDCKtLuwaQ5VAKL9VmQugEy4m6BLhUX4 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfX8f3nZi/7rJe+ fc11LFN9xaS+V55fUL8UWh0BDpohAZVs72GkoCqTopy01Ri4MIpiDdwTWBx8sJu5m0CqowjsJDN pDFzrwJ6efTTdj4RIWFN1jVtx6Y4jyk= X-Proofpoint-GUID: JDCKtLuwaQ5VAKL9VmQugEy4m6BLhUX4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-12_07,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 spamscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609120334 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. Reviewed-by: Konrad Dybcio Reviewed-by: Peter Chen 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 e2694c6109ba..d280628370e4 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -162,18 +162,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 Fri Sep 25 12:00:31 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 8C98D3E639D for ; Sat, 12 Sep 2026 22:53: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=1789253598; cv=none; b=LWTmcaTnVE8VfGVU3ykF33elIVRP8BKqAMgIdT5kW/RDRJf9UT8aqRd3mgRr5PkkM+CcrvApSXc1fpnkHJ+0WYIxCw6X/BV6Q0ZFD2QffSf3VR0aGQ7E9HFTsbWIaYIM+GnTNBrdxvL1VNkNqIYUHgugTjdveeIR8RjRcofhE0U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789253598; c=relaxed/simple; bh=tEDXH/Mz1x1xgdKZ0nHNJm+M2OVWIRMxRtOBeC2FqJ4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VbtibpXGLE4St7j69VxZ8/HR6URRd1GKjHhNQdakNux31RWxfrLv75nE2fHXHELmyZydSdHHNFZ5/z8TzhTZr7v/JWQOwP82MknWlt5HB/BWjHwMzHIvBHSfcFgQ89P8/S4uZQc5e0oDHdxk3IBOBpEA2Wwz0NjsBmx3qDNXN4s= 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=WvRViK84; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=jbWow06R; 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="WvRViK84"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="jbWow06R" 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 68CMdiNT1180209 for ; Sat, 12 Sep 2026 22:53: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=othrSyv0peg 1Up4pt50lIvgoy2rt2hUJYdDjAxQKDcU=; b=WvRViK8449yN8wrD2DALt0xVL+7 /ZzcUbsqdPskpOnFsxzIs+u3QUkLGS21N6TLUb02yWX0QThspoRmRtTbbUfCqSew 4zEFAd2MeazbriG0c5Dtm6le0ZJ9FiatVdyQoUaS1CgEYwcG4utq3ZqcZg3v12qb 8qvC4XfOyKk8xjhLX0h0mfkLWfKHCycfCR91Tso6J930ZQE64+n6sLlDuveYmiat /15G99GrK7oryRAfwv8lbBauojaSzCYNmUKO3AaywM0I8W5xUx2q2LzydrhtdLGx e8xHWeVva2kh94zx7/f/osbIsR6GjkdWu1UOjA5gmXJ+/BT/mDOkq29Z5YA== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9cj2rj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 12 Sep 2026 22:53:12 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-38ea32e57e2so4176107a91.1 for ; Sat, 12 Sep 2026 15:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789253592; x=1789858392; 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:content-type; bh=othrSyv0peg1Up4pt50lIvgoy2rt2hUJYdDjAxQKDcU=; b=jbWow06RjhD/fc8Tkz11IfTDzY9NrjExq2CSia8OVtK88Aqrz+G+GfpfNojVf5W8u6 jEaOG+HgVV0WloSoztFX951gpdTYVvqZbvLNsE//SaXafi0UIzxlfFdLPfjxEWDhgQKy Q4p2YVIZTxVXUzu3NrJK/a4O+jl7kwZqxSF9omJ7zBLvQ+gvOA6aRWnzos2vN1q+5crw jSACQmz5SoZMDubhK6nNKax5LxafqXGjU7A/xJJQtI/IKGzKrhBpFdilyyoccKdwgNPO Aw8EY6ocH0MYPbgRPoFvyyCAgffYCZIltzvJl2pkO6tQdylnngWfSYFhhOOhsC1I2llP THDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789253592; x=1789858392; 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:content-type; bh=othrSyv0peg1Up4pt50lIvgoy2rt2hUJYdDjAxQKDcU=; b=q9SjbbmlQ8qmqkKlaANlRNOFQs7uhPkDgvGAbtJPK7bV7Y5OgioThPGzvPLeJqatfK PHVsRFm4dnwTkHsf8Hd6YkH9Mq/GtPa9yh8ao5mjPciHA01iBLrDpnQpI947XZ/FkLZF aGrzUX4MtvhZ/dixc4d0uUE1sgzNf2GlRomK/pYbdvkG5vpjz11Y5oXare97lrPhmX4n O7rZSSneGUkzU/5y/DCdlrlJvIbh8l1CLxI0QG+Scqjm56H0LPKwS+VOFebzH8K2KoS2 sg5klPvwqmXA7GDFi3haOn7box8fPqxskZcBhhverucovltULs4U+s/JkdKVmvz0C1cd QvVw== X-Forwarded-Encrypted: i=1; AKwUvBzWGqxUXQh2220wYaOwpVfC9QdornYKlfbMPLXV2cJ1YMYvhuYtdAjQ5rkYcxeYRfS0N14kLg0jykUTbIU=@vger.kernel.org X-Gm-Message-State: AFuF++lAQmpfb2tcJQqucIKE4vBV6oI4fvxYpj/t59CPwzoG8RRVNZ/8 Qm8QcXyc4swpThHx6FykJLiAuoyuSgb/52Uwc5WMv2N+73HmVYSVwf5a/8Cj5cXZ2ZtrGxEsa8l kNappb//sqXvySzaCBlOAIKcPFFqUXVy/Fz5PAoi+uXbqhdLuRdvWSFDZ2QAuJvvSLNs= X-Gm-Gg: AYBFou1VFLEH0ISV2EH0pGSWclDJ45dtny5o+2cOUAlDrDfN5tK/bLeX93TT8PRD/03 noWvtRQC7giAFwYSBm8v4+FrM1svo3yo2+Ka0W9ziUfCr6rlftJ16JoYJ/7e9ckuHSX5xDEW/oL D5H/C1EwuOdHJd23DjOEh8VMKGGmo5gE1FriwR/O6f44tuAjbSJfYluPuqrXp5T+R44X6I6a4rs qDa6avH+Hd+EcoGqhcaNZvtGel9oSimcjB9eB83E+YYi9IIgohu0eQvw7GugYSl6FiLwCdm1ZRy lDuloM4aQKK7BDCOySIr8PW9mmOuQXtBrVx5XfOWqUOnlLAheTdQtnCYR9I1J2qsth8Em83yEPe jQAsCmA5D2NF6OAOouC8GEG4JZGo58r/FxI1JPLqpxEdBQIhBdd+VDw== X-Received: by 2002:a17:90b:1f91:b0:398:9bd5:4910 with SMTP id 98e67ed59e1d1-39dbc7205aemr8913968a91.23.1789253592021; Sat, 12 Sep 2026 15:53:12 -0700 (PDT) X-Received: by 2002:a17:90b:1f91:b0:398:9bd5:4910 with SMTP id 98e67ed59e1d1-39dbc7205aemr8913953a91.23.1789253591626; Sat, 12 Sep 2026 15:53:11 -0700 (PDT) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f5833fsm19741555eec.23.2026.09.12.15.53.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2026 15:53:10 -0700 (PDT) From: Elson Serrao To: Bjorn Andersson , Conor Dooley , Greg Kroah-Hartman , Konrad Dybcio , Krzysztof Kozlowski , Rob Herring Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Chen , Konrad Dybcio Subject: [PATCH v8 6/8] usb: misc: qcom_eud: add role-based EUD control Date: Sat, 12 Sep 2026 15:52:59 -0700 Message-Id: <20260912225301.3396556-7-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260912225301.3396556-1-elson.serrao@oss.qualcomm.com> References: <20260912225301.3396556-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: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfX6auyUsb7bADC nJYP0acpM10vQaAbP/9QO3/ynIQ59XWAf5E5HYqEpCvxK49j3B0RinsNJifH+jJHs7KOYXAzfW9 VQMNmF2oHkY83R0EcLiKJSm3CAFY25ANxURu7NkFps0A0D2G8gZXpW68mpzsg/a+vR98fz8smly g7qthDWBCbUo3cs4u/R/JN3FMvqNlDMgQ898O07o/NuWjA99hnzfxSgfrAlDqg1sYU1BvGEeonO FAPYpE8KmPOWFQEB+flJXOUDIzTiD7QPl6G2pNZgwfYSSeN8Ay0CVPjCoUlvmQdx4W0chxsaV6q UuiXfJY43aJl1Iz3uIgGlRIvHAAOmKwXSnDBXIE9aC7ysQAIJlFjFE/+hHyQGd1vboxxe8VEfDT QrjoS9LrheZl8d6UNbNU5lRIeg7pmvW4rjVaYd3UC6gSz+a95wBNDHweyiBjv5uULV8G1419UjD I0j3TseLuZGTtv+VxbA== X-Authority-Analysis: v=2.4 cv=EMyTQFZC c=1 sm=1 tr=0 ts=6aa5d7d8 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=YKK-c5bBAu3nLoGgrlsA:9 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfX0pHEe6r1DBLt PNIFYe68gvFGBPIXmDFV2tcqEqrfoeIkdCEvkyP+2uD8xiGzZn/oqeLEut7+QPpPfv/rJvjAVNl 116kVYEckXqeHIHhtBsZKq89RaiXWcU= X-Proofpoint-GUID: RnrLb6OmDYySywjpCbygoOUr32iMq-0Q X-Proofpoint-ORIG-GUID: RnrLb6OmDYySywjpCbygoOUr32iMq-0Q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-12_07,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 impostorscore=0 spamscore=0 bulkscore=0 clxscore=1015 malwarescore=0 suspectscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609120334 Content-Type: text/plain; charset="utf-8" EUD functions by presenting itself as a USB device to the host PC and is therefore only applicable when the port operates in device role. Keeping EUD enabled in other roles provides no benefit and unnecessarily keeps the associated PHY resources enabled. Furthermore, enabling EUD in host role can cause the USB controller to misbehave because the EUD hub supports only a single upstream-facing port. Address this by treating EUD as usable only in device role. The role-switch callback enables or disables EUD as the port enters or leaves device role. A sysfs enable request made outside device role is recorded and honored when the port subsequently switches to device role. Additionally, synchronize EUD state management across different paths to avoid races and maintain consistent hardware state. Reviewed-by: Peter Chen Reviewed-by: Konrad Dybcio Signed-off-by: Elson Serrao --- drivers/usb/misc/qcom_eud.c | 60 +++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/drivers/usb/misc/qcom_eud.c b/drivers/usb/misc/qcom_eud.c index d280628370e4..353c45dfd328 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,8 @@ 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; @@ -156,17 +159,33 @@ 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 + guard(mutex)(&chip->state_lock); + /* Skip operation if already in desired state */ if (chip->enabled =3D=3D enable) return count; =20 if (enable) { + path =3D chip->paths[chip->port_idx]; + + /* + * If not yet in device role, honor the userspace request and defer + * EUD enablement until the port transitions to device role in the + * set_role callback. + */ + if (path->curr_role !=3D USB_ROLE_DEVICE) { + dev_info(chip->dev, "Deferring EUD enable until port enters device mode= \n"); + chip->enabled =3D enable; + return count; + } + ret =3D enable_eud(chip); if (ret) { dev_err(chip->dev, "failed to enable eud\n"); @@ -204,6 +223,8 @@ static ssize_t port_store(struct device *dev, struct de= vice_attribute *attr, if (port < 0) return port; =20 + guard(mutex)(&chip->state_lock); + /* Check if the corresponding path is available */ if (!chip->paths[port]) return -EOPNOTSUPP; @@ -285,8 +306,13 @@ static irqreturn_t handle_eud_irq_thread(int irq, void= *data) struct eud_path *path; int ret; =20 + guard(mutex)(&chip->state_lock); + path =3D chip->paths[chip->port_idx]; =20 + if (!chip->enabled || path->curr_role !=3D USB_ROLE_DEVICE) + goto out; + if (chip->usb_attached) ret =3D usb_role_switch_set_role(path->controller_sw, USB_ROLE_DEVICE); else @@ -294,6 +320,7 @@ static irqreturn_t handle_eud_irq_thread(int irq, void = *data) if (ret) dev_err(chip->dev, "failed to set role switch\n"); =20 +out: /* 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); @@ -304,7 +331,30 @@ static irqreturn_t handle_eud_irq_thread(int irq, void= *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); - int ret; + struct eud_chip *chip =3D path->chip; + int ret =3D 0; + + guard(mutex)(&chip->state_lock); + + /* + * EUD is usable only in device role. Power it down for every other + * role to avoid keeping an unusable module 'ON'. chip->enabled + * preserves user's sysfs configuration and is not modified across + * role transitions. + */ + if (chip->enabled && path->num =3D=3D chip->port_idx && role !=3D path->c= urr_role) { + if (role =3D=3D USB_ROLE_DEVICE) + ret =3D enable_eud(chip); + else if (path->curr_role =3D=3D USB_ROLE_DEVICE) + ret =3D disable_eud(chip); + + if (ret) { + dev_err(chip->dev, "failed to %s EUD for role %s: %d\n", + str_enable_disable(role =3D=3D USB_ROLE_DEVICE), + usb_role_string(role), ret); + return ret; + } + } =20 /* curr_role tracks the role from EUD's point of view */ path->curr_role =3D role; @@ -434,6 +484,8 @@ static int eud_probe(struct platform_device *pdev) =20 chip->dev =3D &pdev->dev; =20 + mutex_init(&chip->state_lock); + chip->base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(chip->base)) return PTR_ERR(chip->base); @@ -473,8 +525,12 @@ static void eud_remove(struct platform_device *pdev) { struct eud_chip *chip =3D platform_get_drvdata(pdev); =20 - if (chip->enabled) + mutex_lock(&chip->state_lock); + if (chip->enabled) { disable_eud(chip); + chip->enabled =3D false; + } + mutex_unlock(&chip->state_lock); =20 device_init_wakeup(&pdev->dev, false); disable_irq_wake(chip->irq); --=20 2.34.1 From nobody Fri Sep 25 12:00:31 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 EE0AD3F12C4 for ; Sat, 12 Sep 2026 22:53:14 +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=1789253597; cv=none; b=VzTwEDrfqOOyFguxeJVkFo2C8o6MDjxkpnkYRw5KgV5H9RJCmRzxs6x/AighnT4pkOIzxFpfFB2NUp/mS6HhtQ5ivsgZD2DzTgZm5Z98YwuC826cqVG3NTeCPyBvw5oV51dkO0WJ8tD1M0aFKS5Pyt/VFpNaB4ha333jazgECqs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789253597; c=relaxed/simple; bh=rzM7FDp46PONIU3FuZdRnR6emc1m2RW++R52letOKIE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=U86qgrH44FSrwNV7Uq4AvyElsbYUDQEdGhZy8gd9ui6tBepbvYnUKVxqUigL6hrynAzMjt0o6JhZJcn5gmzkK9nCdnqg9Ml6T2y6LKySUyFzWw6GhpMpbKodg2S1d0apHmULFKgxY+UTs/pjDnYvxJ9xYxhfuF/X/1yNAZb62E0= 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=a650BmU+; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Coc0jq0C; 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="a650BmU+"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Coc0jq0C" 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 68CMjAAu927537 for ; Sat, 12 Sep 2026 22:53: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=y9biAXn7ssv b5YgyKLJsEP0aTZIozodH3BSXfrvWTnw=; b=a650BmU+K9WLJgRcW2DgzwEKaY+ RfG1z7xTXtfzL6gya+09Led+VFjt37ZE7fjjlAQofCMIAVuKDP6wXwHiVAwQ6fVg 1n94cDldCb2SEAA62CO4VP5mXzYTJ2X2Pw8khs55aroKyJNOdT9JpKFbBtVPxbDU xjG8Wr3kW+CTiPJ9NUPBNE2nz0+cpr70GIvBwNUCEo0+5LH3vKD/mUQzV1gkfi6L WXcTvrMsIDNr+B/LHYlSB1qTBdnEAHmp16Rg3bjzv/Sbm8gpWarN7ofUO1z0YYuh JWT3LX+afLEAqIJjEoGVHN6sKZGAeIsyOg5eywUKwgf1qJ+G7Cq7VoFB4tA== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9ca31c-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 12 Sep 2026 22:53:14 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2dc7337e2a7so24955385ad.0 for ; Sat, 12 Sep 2026 15:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789253593; x=1789858393; 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:content-type; bh=y9biAXn7ssvb5YgyKLJsEP0aTZIozodH3BSXfrvWTnw=; b=Coc0jq0CgEQO0HH6zi8XZSex9XuZfB6PQ0GntZLeGlVPfgiEKBWkzaaMurhlkKQTz8 hleQJmbM45IBb2v3YTIeYY3BnNNKVrUA0MrcQwr1wJec2JKIRBteFN8jtxSkjucVD6Ni rtKNBkFnfvvaCtxUC/ebHiD+P8s+nDdxLvlI6XnlDZVRYL/1iKiTIGNkXhCLJr7kEnmo vOk2jy21laMZ3cqtja6t1DadKFkM5CqVbKtgX6WexDbuZbvMbtlViV4iX2ALsCG8kAj+ y5a7SWFbWsbFmEnP7F7uH8QAmsORQBAgWMLBwQERMtWXv129dMb2+zAQ0T4FXxgZoF5V SfQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789253593; x=1789858393; 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:content-type; bh=y9biAXn7ssvb5YgyKLJsEP0aTZIozodH3BSXfrvWTnw=; b=Ex3N5wD49k6OGgxQenqInIfAguyIpneG89Fle6gj7OtMwWJ+Tl9bSiTQMZk6+86of4 GhfP92YnsfPB14bHqUIulfSfY2Ha7Nc6XwqxX8GYr2OTxwXAdgnsj8pWu12XogAsbqju mgKdfL7h+cOT5jALHur7Jmg7Zlfyb5A50e4cG7roSDbL9ZrCqJxsNuDU/8XX6QVDoKX3 RjjHEROCt/JBw1omd2tDLNjl7ZGBN9oYIF+f+1/Ld4qh1A1Xk4Bdj6E6Zel2sqAUYo4a sLANFCnBy7VNIOmrH8dDCkqwMtzjJHewZwgYGgu6zGEsr7i3NbzirqnAkVcLvE6VHF3V 5IyQ== X-Forwarded-Encrypted: i=1; AKwUvBz0YOfJpLRzEPPuC/V/7bTa2j5X9xaLL1rTm12K6QSGMgegO0zxjQA4EkMc6zFFl3n2kJzvEXeji66ezts=@vger.kernel.org X-Gm-Message-State: AFuF++mOfC8FSHwmPmnx9aNN0g3HZcS2jAruq7L+kDzxz0pbczpa97+f XKL1/Lp2V+IvfA/TpWje/N0byTj8i0KCBYkaMr9iPxoxGPH0J3S5ouwEnL34aNQm+VmAvbKWSsL 021zLuJSKoSoqkSfE6VteoMBtWKet6H8avbPEvbumXuw0m2tbaoWuBY3I0LQDaqxGak8= X-Gm-Gg: AYBFou1ALiyiRb0/h8y9MMoY7IwZziI/koGkqyC/sd+/VByZDBVyp0X2WTWjESbD5pa EdyBho+4iNELpBoL6rH76XQm0N+9uajSDgs8WNuaR6pZeu3XGGiWf2PxLiFq/T7JpeWb3L5Gmxe TS5SWgJ48pBDePIf316RfAsgG83RpEtr/PiW8lCXfizjgLe9o2ff7iUbxAZRFQOEORaqgGu0zxF 6La7PKt+LV8CUS3csiRHa5PxZxvngCnHpMOkKO7AOFuiG0kNQxBMh/myeXprZmpveeN7MiCr3g0 T1eXB5R1lFneceDKqpjVA5+JYtDcIjrU9lUSmQ/7rRiFkpMpAe7QDEViz/PvFeRy6OoqI2EOnCG MyDHDNVlyWPg7frd0GK4S0NOgKbOfGrBXlLB6NGqOjej1LchaN9UOnQ== X-Received: by 2002:a17:902:d492:b0:2c8:f34c:82c0 with SMTP id d9443c01a7336-2dd2a1d8c55mr172889615ad.2.1789253593615; Sat, 12 Sep 2026 15:53:13 -0700 (PDT) X-Received: by 2002:a17:902:d492:b0:2c8:f34c:82c0 with SMTP id d9443c01a7336-2dd2a1d8c55mr172889245ad.2.1789253593104; Sat, 12 Sep 2026 15:53:13 -0700 (PDT) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f5833fsm19741555eec.23.2026.09.12.15.53.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2026 15:53:12 -0700 (PDT) From: Elson Serrao To: Bjorn Andersson , Conor Dooley , Greg Kroah-Hartman , Konrad Dybcio , Krzysztof Kozlowski , Rob Herring Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Peter Chen Subject: [PATCH v8 7/8] usb: misc: qcom_eud: fix virtual attach/detach event handling Date: Sat, 12 Sep 2026 15:53:00 -0700 Message-Id: <20260912225301.3396556-8-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260912225301.3396556-1-elson.serrao@oss.qualcomm.com> References: <20260912225301.3396556-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-Info: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfXz+x9m8i/llHQ nQxd/g5JQ/YfW5HnMFs6K9O/eYXCZlcDIO9nMKz+NFu3gijWGmDuCOzflKHwOr2Ro3BwJ064FdL /5dV6ghCdE6d0TewBrvs98uzQ7bVIZ4= X-Proofpoint-GUID: 82WcRJ-48QaFoA8miRz9_RTbB3oBRhyT X-Authority-Analysis: v=2.4 cv=BdZNQbt2 c=1 sm=1 tr=0 ts=6aa5d7da cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=dOwNoGVJVf10FbPJOZQA:9 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-ORIG-GUID: 82WcRJ-48QaFoA8miRz9_RTbB3oBRhyT X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfXzOt8ttfQufuS Wta00AjaLpcQRiQpj1tFjJI9eXFnoGGMr1JBAVKeaq7v2TEsS1zEiUEeKjCe6IgFvOiKxEW4/Ih tYMx96BdCLpaTdJ+QhCMmzOa2FgsAXgyJdfR2gu+zvFOB8JoiwnkLMwNW3kZ3+K1gCLJZ0Qg//g 3OluKQoYRYUPKT/UiS5UZZPb83Ncpupj7zuP8cR+EZZGoAM6doJLiXcdQVJRsLN8+5a/CvwcQdA 6UeAN+l5VE2mFxQdrXWlz28AG6+qM0fPgL91pYP/hrgntbkKwDAUsa3mOe9iyAnu7oR7OANxokS myUTaT5TSrnO6/GzQTXGTl61VsdHuya8qVXhO5fgszddli3wz4NV/d30p4UyTubUab2hwL8TLSP OB/QTId+3OkP7uLjHcUY3Yn0uFMWmB+tXnDi4WzofHKi5LJsIJUczIVuy6hKUxzc/Ds8wYCkYy0 M6PSeYZDYN1N3y0wfcA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-12_07,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 adultscore=0 malwarescore=0 clxscore=1015 spamscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609120334 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. Reviewed-by: Konrad Dybcio Reviewed-by: Peter Chen 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 353c45dfd328..669e2e00dd7b 100644 --- a/drivers/usb/misc/qcom_eud.c +++ b/drivers/usb/misc/qcom_eud.c @@ -313,10 +313,26 @@ static irqreturn_t handle_eud_irq_thread(int irq, voi= d *data) if (!chip->enabled || path->curr_role !=3D USB_ROLE_DEVICE) goto out; =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 Fri Sep 25 12:00:31 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 01F863F1ABF for ; Sat, 12 Sep 2026 22:53: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=1789253599; cv=none; b=JGh0jxXV074GrBePFEBOR6nLqA4GGs6blvU2ApOOVVOJPMwpiiPIgIL35Coox/qVtGrw416xBVjxsr6BgJNO2oUGxQrMhlYha+MGum7I5WbKWc5uk/9CyMFyhWO4I9Rc6Tq9yFXaoOBmlzTKtpDvzg3oR2l7zJ0jwe600L6IBac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789253599; c=relaxed/simple; bh=5h81S+wiLRMEczDKuwMd63Le1Hq21YJ+sdFojiZDA1Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WiOZmDjWLQP8Jyg9AULibtld/K5HzkR7oIKDd5v1dnUIRPFR0D+4Vm2NWcEBoAudVZDfxL+EJMOEe+6ogIEWvuvDYM21+172eFzouQaLdlZeWOcbjJIDGHJuLblpC6L64JyglI154Ccs6J183WIn4P3fJQJCGTVABcBecuWcIT4= 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=ksjnalqz; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Cwsqc2u+; 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="ksjnalqz"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Cwsqc2u+" 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 68CLnRHe816800 for ; Sat, 12 Sep 2026 22:53:16 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=M2XxE1c7rix aVzyJRTHw6QQF+YpcgRrq2gG3nMUhGIs=; b=ksjnalqzj0MX6Mo4HwkjMcqEjbF PT2EzdV6gAHkPFTf8kiD4WvG2RNCaTWN/0ieKJp6JATvasZ6ZR7kNE90Jv6XjKv2 fFkYQ8FYzIpfvfvh78doXgRoFEiP1Xmp4f0IotKpqlrR1D7ab2TSmzez43O4ZQfc 50uXJr0q/bqdWkcBW/P+AlLM6mAK8xBwy78iS5cvhvFkRhtf1Cw0TxnNtVgnu2mf E90rfW1JNjAMUbDfoezptfq2/bD3u/WSBC7/8OU0C6xZWC+rqQnNmp8DSXfUNwwZ klU5WIUpZeLt50x4LeH4xJoO0p+mprIc7tY7MKEK8OSj+YiAlRnZn+dILow== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9ca31h-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 12 Sep 2026 22:53:15 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-cc435388657so2375118a12.3 for ; Sat, 12 Sep 2026 15:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789253595; x=1789858395; 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:content-type; bh=M2XxE1c7rixaVzyJRTHw6QQF+YpcgRrq2gG3nMUhGIs=; b=Cwsqc2u+nAN5z0zbCmyb2O45dW6/Z0GoIC6HMjgbk8gwTpbfBDRBI/CNdt+YGpSaVY yvJQJ0jvFVyaAPSYjWNda0hfb/p3yUrVaUSI0DFSSwwRSkw6Zlor4iIU3s2xZPpOApgH ylAqBJpsa6Xq6zx5masaGGgLxCQ3sr1guhfX/ArsN00/3Aqwk1YHNJwG2iurxBUOaohO F+eUzRrLFLXEGxCLkk4aVfjXjjB9jtKW6kyntX+dszQDX2iU1J+ySNqh7v2tJrIpljF1 h3YbItBFUJJRh1bcdGwdjs5O7HfHaDkDQvK9jyKNpa0IZZ6wgdmN3kjMNfgnfLtbpXOy JEQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789253595; x=1789858395; 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:content-type; bh=M2XxE1c7rixaVzyJRTHw6QQF+YpcgRrq2gG3nMUhGIs=; b=YhbT/jTkP/EA3nvvfQATNoP1pHGBZpMnyWFuLdM/eKH/6HfTmsst23tsMH2Nb75TqS Wifhrl0ZcxJyw5laQ4ulp2CGtrmLRlo5E1XAYLv7hayBaOGutkqL9NREqWMky+vut4bS BB+JBvdPVEkh6Xu5ymK96cIwx47gdh7WCvfTPZ4qIRmxQ4Rb3soKNmg2dJ51CHM1Ieh+ cuAA7mDwrUHmEFte8x7c7BnK8ZYPJRGFHt29hRms0qzmCWG6T12NNLQSJPbSVT3L8Rpr lXAdGAifiKGERfC5RW/dFEelJZVadYkQOulsfPtS+4c8/A4U+tXOBdRRImxGJuBdiID8 NhoA== X-Forwarded-Encrypted: i=1; AKwUvBwET+IgpUc44ndlb+j7Sxw++fm56pXqhfNnNMoH20EJiGP246mRiB0DnFMRt3zPWkRqE1tTqowFCft0Meo=@vger.kernel.org X-Gm-Message-State: AFuF++kAccXLV3MrLoniy9hmdImu/FzX1ZTmXtPCqciJqrH0d+WDTdN9 mQu7gcpsAsNJ6nL8I1lYwXltA1GKJmymr13nWI2m6ofgTJGqXTCRy3Ti8j7xDa6Kujg3DwtjsHG VJ1SHOEf2bLV4tFWT+RZgTRDuFrhzXgoBdyQlNFUWmhLvCANRIOKQ7UiPPiUfRX7zQjo= X-Gm-Gg: AYBFou3viBsGt54mxqLHNb/F0BHL4i5xjsf5aygg3NgYikAwPwqTJmcrY7xHAsREa+o Ti7ndeptAEYS9/MhbUkaWoTO/0Gu0YUgwV6zSWL+VIEeJg7yOedI1pPxQYyOraNXbGKTT+botxI reYzdlbGiEQq4+dwBviWtHkgoZRhnx/HrgaB+Urf5ng37RcfJWihl4dXUkIz9sBTz6arg+lfKnO zNrHAH5xbUwu3Ar+vFnR8LEwuaWPrSaFoxrK/BUEBaGUq08BtWTpTPx45iGN4JUZvhrqqs2v2jW GbQH87DINe7wPR1VjxYsi/lRiKPkTztIO9y+LSw7ysUh6FLkg7Hx+Ewph9sUox+hm3q8vWhTsBm OSIEwZmTolIkItDGa7+DQmUlzmVUxWHBITiZCP5s7Llo0up/YsitVhg== X-Received: by 2002:a05:6a20:1446:b0:3d8:1f68:59ac with SMTP id adf61e73a8af0-3db0e45d166mr8378892637.23.1789253594865; Sat, 12 Sep 2026 15:53:14 -0700 (PDT) X-Received: by 2002:a05:6a20:1446:b0:3d8:1f68:59ac with SMTP id adf61e73a8af0-3db0e45d166mr8378863637.23.1789253594373; Sat, 12 Sep 2026 15:53:14 -0700 (PDT) Received: from hu-eserrao-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f5833fsm19741555eec.23.2026.09.12.15.53.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Sep 2026 15:53:13 -0700 (PDT) From: Elson Serrao To: Bjorn Andersson , Conor Dooley , Greg Kroah-Hartman , Konrad Dybcio , Krzysztof Kozlowski , Rob Herring Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 8/8] arm64: dts: qcom: kodiak: Desribe EUD UTMI routing and connector mapping Date: Sat, 12 Sep 2026 15:53:01 -0700 Message-Id: <20260912225301.3396556-9-elson.serrao@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260912225301.3396556-1-elson.serrao@oss.qualcomm.com> References: <20260912225301.3396556-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-Info: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfX8R8+JnVXvdC9 svQxzlN0JKRMpe2P7lpW0CA/5v7d5ld8lqUqay9Cw6EoP47sor0oGdd2Bd057gz/K3mk1Ryl1nX obo5T96PtQdN1etj7btcFqQAjEPVHUM= X-Proofpoint-GUID: fEsddEQLmSAHbj2G5LZeN552m8P2Jv6P X-Authority-Analysis: v=2.4 cv=BdZNQbt2 c=1 sm=1 tr=0 ts=6aa5d7db cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=EqwfFjFrxzYmPp_XjFsA:9 a=bFCP_H2QrGi7Okbo017w:22 X-Proofpoint-ORIG-GUID: fEsddEQLmSAHbj2G5LZeN552m8P2Jv6P X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEyMDMzNCBTYWx0ZWRfXx15PSSwCQEly TrFFHLNlsCNC7q3FegeORzCMRYNjoJZYZdAiLMK04OH9xRUcXaW9kBf5EOav7NZxWB9Y+m4z+8H bJNlJrUBQCeFS7jA632AJnrv2SNEl11yMfvdstYs1dFlkanHxMBlbNUnLuvo6zzdFMgeTwkgmsZ +nqzLtkdIKJVn8s712+o8xiX1xKsbVrHPJcfLaIgGVPNEERKCpIbzvCgfyCJzj30uOuy8JOYoIt i7gf3YbNtsCdkoQ9jTKtrun2A7WJx/iN7HZlupd83fP6XpeWuLB9AHyp4QE54PDfX8xWnqPSYVj vzW9TRsE0EcENGRA1nJEDDcJhd3iiWAcSwOelJsX/whzbpSC1jp14cWWzfYsSJGetbUGXx0qs+9 OHu7axBpUX3Hcfn0XAEbPRAKOzBNbZp9f1PtKUmdhKeTDDQRhyGWFKsSE1u6FSzQfO2jWq+zyvn JLgJJz9tYcpknjxDOmg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-12_07,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 adultscore=0 malwarescore=0 clxscore=1015 spamscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609120334 Content-Type: text/plain; charset="utf-8" The existing EUD description uses a legacy single-path representation that assumes uniform UTMI routing. This was sufficient for minimal configurations where the USB port operated only in device mode and role switching was not considered. Update the description to explicitly model the topology using eud path child node and add a role-switch declaration to reflect role-dependent UTMI routing. Also on this SoC, the EUD hardware intercepts only the primary UTMI path. So remove the USB endpoint mapping to the secondary controller and associate it with the primary controller. With the intermediate EUD node now in place, update the Kodiak board descriptions to map the USB connector endpoint to the EUD instead of directly to the USB controller, reflecting the intended hardware topology. Enable the EUD by default now that the complete topology is described. Signed-off-by: Elson Serrao --- arch/arm64/boot/dts/qcom/kodiak.dtsi | 37 ++++++++++++------- .../boot/dts/qcom/qcm6490-fairphone-fp5.dts | 10 ++--- .../dts/qcom/qcm6490-particle-tachyon.dts | 10 ++--- .../boot/dts/qcom/qcm6490-shift-otter.dts | 10 ++--- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 10 ++--- .../qcom/qcs6490-thundercomm-minipc-g1iot.dts | 4 +- .../dts/qcom/qcs6490-thundercomm-rubikpi3.dts | 10 ++--- .../qcom/sm7325-motorola-dubai-common.dtsi | 4 +- .../boot/dts/qcom/sm7325-motorola-dubai.dts | 4 +- .../boot/dts/qcom/sm7325-nothing-spacewar.dts | 10 ++--- .../boot/dts/qcom/sm7325-xiaomi-taoyao.dts | 4 +- 11 files changed, 61 insertions(+), 52 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/kodiak.dtsi b/arch/arm64/boot/dts/qco= m/kodiak.dtsi index f2da3706d5c8..6c64dc9902e4 100644 --- a/arch/arm64/boot/dts/qcom/kodiak.dtsi +++ b/arch/arm64/boot/dts/qcom/kodiak.dtsi @@ -4421,12 +4421,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 { @@ -4753,16 +4747,30 @@ eud: eud@88e0000 { <0 0x88e2000 0 0x1000>; interrupts-extended =3D <&pdc 11 IRQ_TYPE_LEVEL_HIGH>; =20 - status =3D "disabled"; + #address-cells =3D <1>; + #size-cells =3D <0>; =20 - ports { - #address-cells =3D <1>; - #size-cells =3D <0>; + eud0: eud-path@0 { + reg =3D <0>; + usb-role-switch; =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_usb: endpoint { + remote-endpoint =3D <&usb_1_dwc3_hs>; + }; + }; + + port@1 { + reg =3D <1>; + + eud_con: endpoint { + }; }; }; }; @@ -4989,6 +4997,7 @@ port@0 { reg =3D <0>; =20 usb_1_dwc3_hs: endpoint { + remote-endpoint =3D <&eud_usb>; }; }; =20 diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm6= 4/boot/dts/qcom/qcm6490-fairphone-fp5.dts index f41ad446a39e..b1f1ff6b99e6 100644 --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts @@ -98,7 +98,7 @@ port@0 { reg =3D <0>; =20 pmic_glink_hs_in: endpoint { - remote-endpoint =3D <&usb_1_dwc3_hs>; + remote-endpoint =3D <&eud_con>; }; }; =20 @@ -1530,10 +1530,6 @@ &usb_1 { status =3D "okay"; }; =20 -&usb_1_dwc3_hs { - remote-endpoint =3D <&pmic_glink_hs_in>; -}; - &usb_1_hsphy { vdda-pll-supply =3D <&vreg_l10c>; vdda18-supply =3D <&vreg_l1c>; @@ -1573,3 +1569,7 @@ &wifi { qcom,calibration-variant =3D "Fairphone_5"; status =3D "okay"; }; + +&eud_con { + remote-endpoint =3D <&pmic_glink_hs_in>; +}; diff --git a/arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts b/arch/a= rm64/boot/dts/qcom/qcm6490-particle-tachyon.dts index 5bb33a8a9830..41836afd3acd 100644 --- a/arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts +++ b/arch/arm64/boot/dts/qcom/qcm6490-particle-tachyon.dts @@ -74,7 +74,7 @@ port@0 { reg =3D <0>; =20 pmic_glink_hs_in: endpoint { - remote-endpoint =3D <&usb_1_dwc3_hs>; + remote-endpoint =3D <&eud_con>; }; }; =20 @@ -828,10 +828,6 @@ &usb_1 { status =3D "okay"; }; =20 -&usb_1_dwc3_hs { - remote-endpoint =3D <&pmic_glink_hs_in>; -}; - &usb_1_hsphy { vdda-pll-supply =3D <&vreg_l10c_0p88>; vdda33-supply =3D <&vreg_l2b_3p072>; @@ -864,3 +860,7 @@ &usb_2_hsphy { &usb_dp_qmpphy_out { remote-endpoint =3D <&pmic_glink_ss_in>; }; + +&eud_con { + remote-endpoint =3D <&pmic_glink_hs_in>; +}; diff --git a/arch/arm64/boot/dts/qcom/qcm6490-shift-otter.dts b/arch/arm64/= boot/dts/qcom/qcm6490-shift-otter.dts index cf74b3664cf5..45b9318ab54e 100644 --- a/arch/arm64/boot/dts/qcom/qcm6490-shift-otter.dts +++ b/arch/arm64/boot/dts/qcom/qcm6490-shift-otter.dts @@ -84,7 +84,7 @@ port@0 { reg =3D <0>; =20 pmic_glink_hs_in: endpoint { - remote-endpoint =3D <&usb_1_dwc3_hs>; + remote-endpoint =3D <&eud_con>; }; }; =20 @@ -951,10 +951,6 @@ &usb_1 { status =3D "okay"; }; =20 -&usb_1_dwc3_hs { - remote-endpoint =3D <&pmic_glink_hs_in>; -}; - &usb_1_hsphy { vdda-pll-supply =3D <&vreg_l10c>; vdda18-supply =3D <&vreg_l1c>; @@ -985,6 +981,10 @@ &usb_dp_qmpphy_out { remote-endpoint =3D <&pmic_glink_ss_in>; }; =20 +&eud_con { + remote-endpoint =3D <&pmic_glink_hs_in>; +}; + &venus { firmware-name =3D "qcom/qcm6490/SHIFT/otter/venus.mbn"; =20 diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot= /dts/qcom/qcs6490-rb3gen2.dts index a13315bf0fb0..6520e920a844 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts @@ -211,7 +211,7 @@ port@0 { reg =3D <0>; =20 pmic_glink_hs_in: endpoint { - remote-endpoint =3D <&usb_1_dwc3_hs>; + remote-endpoint =3D <&eud_con>; }; }; =20 @@ -1402,14 +1402,14 @@ &usb_1 { status =3D "okay"; }; =20 -&usb_1_dwc3_hs { - remote-endpoint =3D <&pmic_glink_hs_in>; -}; - &usb_1_dwc3_ss { remote-endpoint =3D <&usb_dp_qmpphy_usb_ss_in>; }; =20 +&eud_con { + remote-endpoint =3D <&pmic_glink_hs_in>; +}; + &usb_1_hsphy { vdda-pll-supply =3D <&vreg_l10c_0p88>; vdda33-supply =3D <&vreg_l2b_3p072>; diff --git a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts = b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts index 31bafa2cf51d..4c4afe691d64 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-minipc-g1iot.dts @@ -77,7 +77,7 @@ port@0 { reg =3D <0>; =20 pmic_glink_hs_in: endpoint { - remote-endpoint =3D <&usb_1_dwc3_hs>; + remote-endpoint =3D <&eud_con>; }; }; =20 @@ -1052,7 +1052,7 @@ &usb_1 { status =3D "okay"; }; =20 -&usb_1_dwc3_hs { +&eud_con { remote-endpoint =3D <&pmic_glink_hs_in>; }; =20 diff --git a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts b/ar= ch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts index 13e8e62f6205..b9f92bcf84ab 100644 --- a/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts +++ b/arch/arm64/boot/dts/qcom/qcs6490-thundercomm-rubikpi3.dts @@ -93,7 +93,7 @@ port@0 { reg =3D <0>; =20 pmic_glink_hs_in: endpoint { - remote-endpoint =3D <&usb_1_dwc3_hs>; + remote-endpoint =3D <&eud_con>; }; }; =20 @@ -1098,10 +1098,6 @@ &usb_1 { status =3D "okay"; }; =20 -&usb_1_dwc3_hs { - remote-endpoint =3D <&pmic_glink_hs_in>; -}; - &usb_1_hsphy { vdda-pll-supply =3D <&vreg_l10c_0p88>; vdda33-supply =3D <&vreg_l2b_3p072>; @@ -1135,6 +1131,10 @@ &usb_dp_qmpphy_out { remote-endpoint =3D <&pmic_glink_ss_in>; }; =20 +&eud_con { + remote-endpoint =3D <&pmic_glink_hs_in>; +}; + &ufs_mem_hc { reset-gpios =3D <&tlmm 175 GPIO_ACTIVE_LOW>; vcc-supply =3D <&vreg_l7b_2p952>; diff --git a/arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi b/a= rch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi index 3860ab8508a0..2a90de989dad 100644 --- a/arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sm7325-motorola-dubai-common.dtsi @@ -96,7 +96,7 @@ port@0 { reg =3D <0>; =20 pmic_glink_hs_in: endpoint { - remote-endpoint =3D <&usb_1_dwc3_hs>; + remote-endpoint =3D <&eud_con>; }; }; =20 @@ -1429,7 +1429,7 @@ &usb_1 { status =3D "okay"; }; =20 -&usb_1_dwc3_hs { +&eud_con { remote-endpoint =3D <&pmic_glink_hs_in>; }; =20 diff --git a/arch/arm64/boot/dts/qcom/sm7325-motorola-dubai.dts b/arch/arm6= 4/boot/dts/qcom/sm7325-motorola-dubai.dts index d94571c05a59..7a97a3eedd5f 100644 --- a/arch/arm64/boot/dts/qcom/sm7325-motorola-dubai.dts +++ b/arch/arm64/boot/dts/qcom/sm7325-motorola-dubai.dts @@ -98,7 +98,7 @@ port@0 { reg =3D <0>; =20 pmic_glink_hs_in: endpoint { - remote-endpoint =3D <&usb_1_dwc3_hs>; + remote-endpoint =3D <&eud_con>; }; }; =20 @@ -1428,7 +1428,7 @@ &usb_1 { status =3D "okay"; }; =20 -&usb_1_dwc3_hs { +&eud_con { remote-endpoint =3D <&pmic_glink_hs_in>; }; =20 diff --git a/arch/arm64/boot/dts/qcom/sm7325-nothing-spacewar.dts b/arch/ar= m64/boot/dts/qcom/sm7325-nothing-spacewar.dts index 7db9ae1c3cef..540dbd247c38 100644 --- a/arch/arm64/boot/dts/qcom/sm7325-nothing-spacewar.dts +++ b/arch/arm64/boot/dts/qcom/sm7325-nothing-spacewar.dts @@ -99,7 +99,7 @@ port@0 { reg =3D <0>; =20 pmic_glink_hs_in: endpoint { - remote-endpoint =3D <&usb_1_dwc3_hs>; + remote-endpoint =3D <&eud_con>; }; }; =20 @@ -1438,10 +1438,6 @@ &usb_1 { status =3D "okay"; }; =20 -&usb_1_dwc3_hs { - remote-endpoint =3D <&pmic_glink_hs_in>; -}; - &usb_1_hsphy { vdda-pll-supply =3D <&vdd_a_usbhs_core>; vdda18-supply =3D <&vdd_a_usbhs_1p8>; @@ -1449,6 +1445,10 @@ &usb_1_hsphy { status =3D "okay"; }; =20 +&eud_con { + remote-endpoint =3D <&pmic_glink_hs_in>; +}; + &venus { firmware-name =3D "qcom/sm7325/nothing/spacewar/vpu20_1v.mbn"; status =3D "okay"; diff --git a/arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts b/arch/arm64= /boot/dts/qcom/sm7325-xiaomi-taoyao.dts index 87f267aaeec0..b0bdbcd47503 100644 --- a/arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts +++ b/arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts @@ -94,7 +94,7 @@ port@0 { reg =3D <0>; =20 pmic_glink_hs_in: endpoint { - remote-endpoint =3D <&usb_1_dwc3_hs>; + remote-endpoint =3D <&eud_con>; }; }; =20 @@ -882,7 +882,7 @@ &usb_1 { status =3D "okay"; }; =20 -&usb_1_dwc3_hs { +&eud_con { remote-endpoint =3D <&pmic_glink_hs_in>; }; =20 --=20 2.34.1