From nobody Mon Feb 9 13:24:29 2026 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 765C81E0DD8 for ; Wed, 27 Nov 2024 10:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705097; cv=none; b=AkxdkVcaberLuEi6ZneMbRzASEpOAF9GNX+OvLI1zdVNcHDy4w3mz3mU8R02dwfkil1DtU5IvbkdfkVz7aBDuAsRNLhfimG5M8Pd0GMbw61bI2EiAhnARrRh1fJ2lIadCWfGf4tu5cjgscn98jbt6afc8d8IIr2ljGfsvI9DXqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705097; c=relaxed/simple; bh=TfasP76fahywas4AK7WSi5yqPxkwwsGkTVawo7HIu/E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UwyRf6kuNL3jq+GdKdCOSvrG2WkJDDJkdFrSegvWYVLALLvM15E1imaPEYZfPH9Yo0o7/fGUjMAvZZC65oVTWkhjOPz5qt8kjBxVlPIBE17eZnbTGtuHYjWv9hl92fru9MUGucVsE+OW0yoxhjMhzabNA8tSdzAFZ230MobbFYA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=H9AtM3pn; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="H9AtM3pn" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a9f1d76dab1so1080094766b.0 for ; Wed, 27 Nov 2024 02:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732705093; x=1733309893; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=u3bheMto3E1kl1HdoApxqJvOhczEZkMy970AMWo89Pc=; b=H9AtM3pngNBTujVz2aYeH72mK1naCxWw82J9A04+dpIanOAW399zVQ+C1A7GIkIW9t V7tqy+kGGXyBDT3hMPztQdDRVXmOTd+gVhFAjm/y2dGk8y2plcmKOqdDyCSA9QHE8DT+ l+k22raOnG5d0LgjYgLcXUfJ2ZoWsU+DfLJzlq3WuWmUfjiyob6hz31WFnHw88qtM2PP CCPQsuaz8G76D3rZn8WwU5tAZk7t1dL5jiPCz7+hp7wnZxE7Jtg2bMWtLtRjZNSu8dRe JO8LzSHqViLyq45W4RAb6TSsFN1Wc7AxrolultMoqS55Xs83mETCXYieW9cFR2OYPVKz 7+pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732705093; x=1733309893; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u3bheMto3E1kl1HdoApxqJvOhczEZkMy970AMWo89Pc=; b=cCQYLqdvqYPJDS+JSHic98NZ50pBSok0sKW9f/M4pCoi4dWe19tVBPSj588DZusnLn NnMUTIBfcGmfjbzy3iybzuSyYzEOGOf6tPvffPrhGNhrQpOSSAf6EN+Hjzk3zxchqL1t quguM4Nxm/Pzr0Wwk9CCAweE4bhLm/Z7F6m0qePmMlhsnXGGQ7djIcDO2NiK9Kp7CMPj 9mWlEa3imM0hDJ4yaCMTudFpso9Osx0Rn2FFXU8JxH4mt/turr1yirLtQnuUDuDVpJyO p+DvduVEnF4NjR8jJRMOIfMVtE55U3ytO+9zro1b8OrdQ5jAgXySVt4Df0OTTArZf+We U4fQ== X-Forwarded-Encrypted: i=1; AJvYcCVSjuiSXHxJJi0kD/wC/TfHGYrvjgYSX2HQa/PmArU/QLDGZFgvW3KZ++6lX3kLrhxIxxq5k/kifbpecno=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/U/7pQAfM8+fBaxZ+he1I0PQyIf9CqoGaBSxULtOg1Sv2z8L2 rqd7bGJWsIT/zp8Cj8G2yqkZ/IMWluDgiTMx+ckZO5iwvzl/TPoLAC3NMdcDd9g= X-Gm-Gg: ASbGncu+plJ0J26TFiDPv5fKb0CXcdx5mIgCCAPfhoTCbk3PnmS7U69BVGLQA83i5Ht BzssLDq5Z3EIQarqBTI+dQ6fv+u1JsP7RXIjoFasWB5TF8SQBhrWvTR838xPFEA7Hsh2sIPUCPU 2RfpBZG12lp+j6b7uPoYVVNUdJgAmuMTSdZcV0hzr8VVvW+Vy+ftkhoJSO1qZCCK5IpsGuWWZsL l+5nf8Lj6BzgB4SpAnAXq54rgS1P1qhMlXExWPQo8zTpmKMhFen8l9KIfBtdkEhiTlYL8jNkxlf 6rVeyB7mO1LrXekEtILQ2Tx9lsMqBWiiOw== X-Google-Smtp-Source: AGHT+IFtopTo1T9muj6iS22tvZolqFiyxg9o/3wQpSGJ1mFMEg0qDXnVqCgHodOTVAcp8106njbuHQ== X-Received: by 2002:a17:906:3d29:b0:aa5:63a1:17cf with SMTP id a640c23a62f3a-aa580f23e33mr198057666b.20.1732705092771; Wed, 27 Nov 2024 02:58:12 -0800 (PST) Received: from puffmais.c.googlers.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa54a6db906sm412183566b.41.2024.11.27.02.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2024 02:58:12 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 27 Nov 2024 10:58:11 +0000 Subject: [PATCH 1/9] dt-bindings: phy: samsung,usb3-drd-phy: align to universal style Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241127-gs101-phy-lanes-orientation-phy-v1-1-1b7fce24960b@linaro.org> References: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> In-Reply-To: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Szyprowski , Sylwester Nawrocki , Alim Akhtar Cc: Peter Griffin , Tudor Ambarus , Sam Protsenko , Will McVicker , Roy Luo , kernel-team@android.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 In [1], Rob pointed out that we should really be separating properties with blank lines in between, which is universal style. Only where properties are booleans, empty lines are not required. Do so. Link: https://lore.kernel.org/all/20240711212359.GA3023490-robh@kernel.org/= [1] Signed-off-by: Andr=C3=A9 Draszik Reviewed-by: Peter Griffin --- .../devicetree/bindings/phy/samsung,usb3-drd-phy.yaml | 15 +++++++++++= ++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yam= l b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml index 16321cdd4919..1f8b35917b11 100644 --- a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml +++ b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml @@ -83,14 +83,19 @@ properties: =20 pll-supply: description: Power supply for the USB PLL. + dvdd-usb20-supply: description: DVDD power supply for the USB 2.0 phy. + vddh-usb20-supply: description: VDDh power supply for the USB 2.0 phy. + vdd33-usb20-supply: description: 3.3V power supply for the USB 2.0 phy. + vdda-usbdp-supply: description: VDDa power supply for the USB DP phy. + vddh-usbdp-supply: description: VDDh power supply for the USB DP phy. =20 @@ -117,6 +122,7 @@ allOf: - description: Gate of control interface AXI clock - description: Gate of control interface APB clock - description: Gate of SCL APB clock + clock-names: items: - const: phy @@ -124,10 +130,13 @@ allOf: - const: ctrl_aclk - const: ctrl_pclk - const: scl_pclk + reg: minItems: 3 + reg-names: minItems: 3 + required: - reg-names - pll-supply @@ -149,6 +158,7 @@ allOf: clocks: minItems: 5 maxItems: 5 + clock-names: items: - const: phy @@ -156,8 +166,10 @@ allOf: - const: phy_utmi - const: phy_pipe - const: itp + reg: maxItems: 1 + reg-names: maxItems: 1 =20 @@ -174,12 +186,15 @@ allOf: clocks: minItems: 2 maxItems: 2 + clock-names: items: - const: phy - const: ref + reg: maxItems: 1 + reg-names: maxItems: 1 =20 --=20 2.47.0.338.g60cca15819-goog From nobody Mon Feb 9 13:24:29 2026 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2ED5E1E0DE4 for ; Wed, 27 Nov 2024 10:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705097; cv=none; b=p/5p7BEYnYZoKgdWyzB9YtjjAUGCd0HFiMwQllTJ4NgLmD3hDlPYKU3Sh8e5Q3MwD3lD/b3K0YMW8fOb0pl6/19qveOfdAuLlOK8LZEJLephaO2FDlw82wM4wdTeRkQ1yM7iWZuDwL++QRhgYFdeOZYgCLhabSTlh9IYR5htA2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705097; c=relaxed/simple; bh=VjxgEP38+L+Ma4q4uehB1/JLcL29L3ctWPsdy4kfO1g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ptd4UuwUxN20qwGnj+RXYoAKv7k3OUGpcoXD2W1+n6TMvLCIPtuQlaURZBItmx9qDf7FXHxtFzEDKaGLLbxzzE4i7MJTynBAnCYxxzm450xacTlVftJc6Sjl8nyytJUnESml/bOxljOdmDZ99RQrH7i+iJ7qb7lukzZ4ZsU6vi0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=tSnfjJYF; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tSnfjJYF" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-53df3078a4dso161455e87.3 for ; Wed, 27 Nov 2024 02:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732705093; x=1733309893; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EX57ICOKMzOs0eby+nVmHR92z2ekmaeMdJuyR8QQpCo=; b=tSnfjJYFiH5cE+6qkupiG2hOfWrHY7ZaRffpPU6bl4YeOs6bDFLSFN3+RLGeGWzsWG ABuB4zm2NwiyEmrzhSckmLRyqwYib8tPCfLjTb6pjEBYTG+mtzBDZcQg92C88fxDwG0d xAgrrQ6kK63z30BbMrdqmgU4uw2zdy6NyU7EI6pb/pOOhruyIXGZbeYTTHLjXU4ygBvU aNTii7xGLCOvECbdo52AIsTJ1clrUpYSzrudaSfTTKZMM0mXD4guIH5MAkGehQKRqyKd yh657vVa7mK50yjHgZvMFztUjCEtyJhhPndiUfwXAqaufwaZvAJMoonuqtzKzU1YwRNk DHgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732705093; x=1733309893; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EX57ICOKMzOs0eby+nVmHR92z2ekmaeMdJuyR8QQpCo=; b=XrD6ycT/6PyxvxTocxcUvayphIAtVUHekwi3PBfeMChLFPbK1H+BwWS5ldIbTYt7T6 2es75zJMN0cwzdeSQgX/LKn5uaK1oBHrmBB2p6V/7qsyfeF2XCyzx7WljGo1aSe1A0Ga ltKfREV4vkuXtdhIsqJjYUgFTmVku+47q1r8wJFb7u18WCNF5Tvj8yN7dRuccDw8i+X7 EkdiB2OZyeBwcFYwFWJ9S1g7tPDiWtKaJnRd/n/Lh2VXr5nlS7h0iHE9G/MXaZ9bX4nj aMKpmxG/3cUCzmEYmyhY5bYWxhiSvrWF6o4qUu3PjLA6owWFN2pefNi7RdLE4Kw0xusG KinQ== X-Forwarded-Encrypted: i=1; AJvYcCULHZVg6evPRQCcHvMlNgkrJprWrDlgrEZXEe56nBZNB0XBtQAcOeYsyaSZuoqUqY3p456gKvl/8tpONoQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyISgQz8+Otv9t3yJoREu0CmrvPxFvRHSegktBfwbFRuoPaD8jx uu4KnCZcO2EsiJUe4lotu4k6JAHbDpGzJrwK4XB0PfVnTSo52ucxnGAXY0BJTQg= X-Gm-Gg: ASbGncu4a8voOdBCEy9qiT/2ad2Za+fdCVG2fT8UV4JRRnPsIffJvCyk4fTxjyHHIFk rCukrMHcc2Hkx4Ei+rWK9XUPpcR1luREAD4tvjEyT+fVzVIaOJMjF/tb/2N9WQ+FgEbauVpvq3d LkvNveRxXyFK3dO9z06Yu5YQW47MSNpIW5ehjx0ibafIcjB7iQhmjQJOt2RE9xH1ffSg0MN6t8N XkfqI8lrmTZHSrkMxqPpFto8P2HvrIdqINUEPnaepLHtZype4utu7MoKuv3IOzf46DA36tiihDn CnyKgFKOnZntBuLRzmZznsARkHj2v5sSzQ== X-Google-Smtp-Source: AGHT+IEDZQbqWW03yw4ZJpKkkOp6D2uswnTAhfUmoQ8ZqjktXEwpbL7Kj9opKFu91DPbwMPyQP7BRw== X-Received: by 2002:a05:6512:3b06:b0:53d:ab04:54ee with SMTP id 2adb3069b0e04-53df0107235mr1294962e87.41.1732705093247; Wed, 27 Nov 2024 02:58:13 -0800 (PST) Received: from puffmais.c.googlers.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa54a6db906sm412183566b.41.2024.11.27.02.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2024 02:58:12 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 27 Nov 2024 10:58:12 +0000 Subject: [PATCH 2/9] dt-bindings: phy: samsung,usb3-drd-phy: add optional orientation-switch Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241127-gs101-phy-lanes-orientation-phy-v1-2-1b7fce24960b@linaro.org> References: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> In-Reply-To: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Szyprowski , Sylwester Nawrocki , Alim Akhtar Cc: Peter Griffin , Tudor Ambarus , Sam Protsenko , Will McVicker , Roy Luo , kernel-team@android.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 orientation-switch is the standard declaration to inform the Type-C mux layer that a remote-endpoint is capable of processing orientation change messages. Add as an optional since not all versions of this phy currently support or even need the orientation-switch. Signed-off-by: Andr=C3=A9 Draszik Acked-by: Conor Dooley --- Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yam= l b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml index 1f8b35917b11..6c17a44718aa 100644 --- a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml +++ b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml @@ -51,6 +51,9 @@ properties: "#phy-cells": const: 1 =20 + orientation-switch: + $ref: /schemas/usb/usb-switch.yaml#/properties/orientation-switch + port: $ref: /schemas/graph.yaml#/properties/port description: --=20 2.47.0.338.g60cca15819-goog From nobody Mon Feb 9 13:24:29 2026 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58BB61E0DE6 for ; Wed, 27 Nov 2024 10:58:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705097; cv=none; b=V9U9tNXzxgqP79UUeE6pNk3LrH5vulOKZ5IYDfLgsh8BULeSeqAYCABXb5L2CbBDnOH/JgpW787SxKSKwK+ejOfarO440Bm0TvTKIY5LT90R/8SCTuFvYeCAhoHmJ2sKXc4JR0onDxLtAIE/vXlaZyb0ZOYJyns4MspEFZMbVgU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705097; c=relaxed/simple; bh=HoOWfskOM/L20/Qi5xKqj5oCq9iYQQhysTOwTI0G2Xo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kaoGCqvu2oj9tlHv69ytpdygmMhuTRjpmJzudzs1WuUc3PQI3tHmp3YhVMoUwiHUrJd98zVZtIrdAzrsp0V99pmQnDjFN4x8Qwx+71pW+j/oHmUdvfP2PLz+HJkRanvyoGsy9BvHhnLtAzt/hjEO5LpE+rnJCDxtXrLphMzHLz4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=INu+BY+B; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="INu+BY+B" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5cfa1ec3b94so7666383a12.2 for ; Wed, 27 Nov 2024 02:58:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732705094; x=1733309894; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=3jtF9ci8OPnOP4Hi31zRxsQ8dcNSQiS08yT+hSgOwYg=; b=INu+BY+BPm2TSfOsOAdv7Ew/mRHGZVbUAopTmZ1DCG1nvN06Qv2gKcoSwJSl73v+Em ecytZzjZBivNRAESQcitRPTzK97xhpbExVMBl45ygtUYtklCBpjgapcoxLRKw6Lo10gh 5Wj5gTjqMyg5bBWFzPhcJ5UHNZDd7lxZiC18e7TdDo6PWcXtCqYLURf/3tljvrB/2/1V rV6JpgYRSn02eG5NTTg/SEpcoqvHHUx8E4GaQYmf57nSwabokKoGapRhCkD6/VJU0lhY bi24aTXk06uWZLFTw9qwBl58BmeYPs+hMAJOW+qS4Q6mhtTYcLrtXzCyqqWHBOwm3xIb 0R5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732705094; x=1733309894; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3jtF9ci8OPnOP4Hi31zRxsQ8dcNSQiS08yT+hSgOwYg=; b=Pa07pyraoC9pF71AU/PETgZKlpAIGI0rkT/bPtoCd8je60yWPWSewhl5GylO5D62O+ SwVOTXU7cI5TxBQesEoNVl5nmqbGpgj9cfBesEEaHH5tGk/U6M9PF4pNGvbsg8j5yFBn xsunhqoHZ9+EtbUrE2T+r7gP3yOXyKtpq6YbqXKTs6bbS3oVhyAwxVoIt4XSEOgOobS3 LCrARA8Ke6Te626jSR4DnOLM3sYKW2oE/BQc8ZN/8vaGzmrwQ3PAJAT+gnc1ZhvU7dne yTX2wSSgAHjHmi9b3Et8GeKNGOjmu42QnKEpVSeQXh2tEamm/mtyGwji8aN8lR36v4Nf 8Y/w== X-Forwarded-Encrypted: i=1; AJvYcCXYsx85d8vyYMDprDDf9qtRgKLcrqgKwVPpfB2mlkr19e0BY8r1dhdJPvzVDiSFLxp2NOHss9rcXFQYeY8=@vger.kernel.org X-Gm-Message-State: AOJu0YzRjxrvJAmmgxWPNR+IZwsNUICuisFgL3TQnV+pE2Mtx6W5Jdax Pi5GJiAQpKJTUUWT5QWcOdIPUhtr8uwleY+sPLkTNyd7jrMSIfYUOK1F/qVbh3o= X-Gm-Gg: ASbGncv+8nIsPpJGS8DLa5rabBcQE0AKRHR6mDjOwBJZAGmXeqMXCiF2gFHQskXMc/E 28uNdsqSZHxeBzNsAuq0qrkOGFxoRp+PDowjj1Z9xFIhE1TOJ5FW4VUEMjjYX3cRaHS+bHPjiY0 j6uaCS2n5PV+9s5ZJw1jhkKN2s1zI9CwwJ9TQoj0wvBmqqBhaGX/A+h8zXrcHbjFA5UDHDXPC04 H5+k1srek33MNhLamUw33A0G3XJWbJk5c0HZYVr5NNmwxgqTzCjIQPHesp4BkcXWhlt6gm7FQJ1 Jk2ddtO/GMcpNLB6Qc7BNUW33pqyCI/3tA== X-Google-Smtp-Source: AGHT+IGpI0XPyLOxUc3SxNULKeFDjg8DEK2PQJHajpwT4G6OmiaLmyMslU+q4NFnVHObUoaipseY+w== X-Received: by 2002:a17:907:7711:b0:aa5:12dc:2e19 with SMTP id a640c23a62f3a-aa58107690fmr187546066b.52.1732705093727; Wed, 27 Nov 2024 02:58:13 -0800 (PST) Received: from puffmais.c.googlers.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa54a6db906sm412183566b.41.2024.11.27.02.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2024 02:58:13 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 27 Nov 2024 10:58:13 +0000 Subject: [PATCH 3/9] dt-bindings: phy: samsung,usb3-drd-phy: gs101: require Type-C properties Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241127-gs101-phy-lanes-orientation-phy-v1-3-1b7fce24960b@linaro.org> References: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> In-Reply-To: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Szyprowski , Sylwester Nawrocki , Alim Akhtar Cc: Peter Griffin , Tudor Ambarus , Sam Protsenko , Will McVicker , Roy Luo , kernel-team@android.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 The USB PHY on gs101 needs to be configured based on the orientation of the connector. For that the DTS needs a link between the phy's port and a TCPCi, and we'll need to inform the phy driver that it should handle the orientation (register a handler). Update the schema to enforce that by requiring the orientation-switch and port properties (on gs101 only). Signed-off-by: Andr=C3=A9 Draszik Reviewed-by: Peter Griffin --- Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yam= l b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml index 6c17a44718aa..0659fc1ce13e 100644 --- a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml +++ b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml @@ -142,6 +142,8 @@ allOf: =20 required: - reg-names + - orientation-switch + - port - pll-supply - dvdd-usb20-supply - vddh-usb20-supply --=20 2.47.0.338.g60cca15819-goog From nobody Mon Feb 9 13:24:29 2026 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EFDB1E0DED for ; Wed, 27 Nov 2024 10:58:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705098; cv=none; b=dzY+VXt7KPsazMCy2Z3hbLCM/PryMnR5i2GDhM84H0w2ovrbKP37QS9qNRC19bNss6nB3ip2utbjpDsPOOEcKSprCaf1T1IRWqUadCAtrgXYgC2Sk51Zq1h/tKgAB8mUW6yHR46Nha9Ppf8FFA3eQ/+XJvw3XQvMKwjnSBH+h0M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705098; c=relaxed/simple; bh=56S6FPhiczc/qLI1wqqGxrJUgzjsmjSd5EAzkBeA1wI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rnN18oeUoEbxCxiLD6k8V2lLlWwCgS6c/ALgNv+EFyBT6sSPPBBt4L5VMMs0ESSyfpDiEc+4WWmr2Fn9tqBPIYYbkU2BjG6TpbHtb5So5PJH/xZT12zZtQzUvaaJ7orpcdUqyUCP782bbGZQiJ5rE9jSLQ7F7BCakAOopg2Xapg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=bJ0L2mqQ; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bJ0L2mqQ" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5cfddc94c83so8216076a12.3 for ; Wed, 27 Nov 2024 02:58:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732705094; x=1733309894; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/xK1rXO8tid7sxZflvw8Sl0BR2j7teaHPSp5KtJr+3E=; b=bJ0L2mqQQbMtT1P/XBzdguApdhpViNXjwt/8e9Arfw678Al5oIULF6vMKm/TOK27pa owCIAriwrGj6kXkvKr7eeLPZt7Qiy3hKiO7dJc/s7D29bBqnJOu3hBpwNHXDC5y9nP+y Cbvyr/dMf/t42s2qJp8j1xOAzjWMd0lzImcgpvqBykis4jb3UpGrleMoBKGFQAPqcdjr OskiNa6J+o+PJIz+t0ESs9j2s32xvFjrObnbb65kypoyW0Ik5J2R+W1e3K3GF481x/9i FfeAs1cozf71pbQQVN4M+YjYvRHEDOJ/Bscrx4h0phklxg0Uiq2b6hqrz9RgjAlYr4/6 0VUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732705094; x=1733309894; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/xK1rXO8tid7sxZflvw8Sl0BR2j7teaHPSp5KtJr+3E=; b=EOPX9oo3dRTVGCXbGTx5BH3r/OctdRqFs8ZSfAucN0U4n2lIulXWWHKSX5K4UoLE4K wh2j38yrR/5ZQi8KJhvLdRG6vD702aVLQiYfyb1OEcSAdt9W/Fp08wSBqcQEvH/jXcHo 4OcBKkfVxW+9eM3/v+HHM5X+XwU69vj60/OtPpHgT88RuoG9EsfXYtnvKxQg5SW6jtRB 4C9aDeF5cGjJxIBOvgmve3o41f2LSCGzt2pZM1ecK64A2U2TR87i14zJ6qG7UKoQO+Vq MlT9gqCtEbkZP9CCjN+MZ/uyco13xcqhYUOStE9g2jPpfie5Es4kktRU4o2rB7+X95JD xlFA== X-Forwarded-Encrypted: i=1; AJvYcCXZMVjw/QS5cXQkr4vaTaZxfrWusQu32i4Cv+bT2rXelo9CFH9sh+biwnGMNk5dxeuKJAnzTIOdIL7kr6I=@vger.kernel.org X-Gm-Message-State: AOJu0YzUMOITGLEvP0kR5Gvx8Vipct3kKKKrwKc9EimiEYmNgh2VmUxE I5Dx9PYgx23EKlbkFi/eCKkrAOVmh7+6/6kQwo8PXvrIm8SsdKeNcfnMavLuzeQ= X-Gm-Gg: ASbGncu82FZVsyMpIjwcabsVtI1pvB2iaz3CCGj5+G7Uu56UswoisSog5aq/9+cmnBg iUX20DS+gOl22/TanP4dgzMeQlEDF86GVsUjJtagmhHz0+W/C9YLgEbLU8hZ15L7wTWVi+hO3gx aAqhpWWKjsso9p7LHDvQJayosxVbRN7+kUof1ZPCsAGlkuWrZsk9bLWXugZN5ihPRTkCwUkw7V9 VR4OQqD2XEl92yfDTVVkZtUCATHcVzRzJsFC/hiciY/lh9ab6Qy3z/vxi53kCgmkAdmQfO0QYXu A5bDNacPH+IkCD0UGlN1WplPU//Lz96UJQ== X-Google-Smtp-Source: AGHT+IFg+ahvle9uWHq2KZqsvbKtQxnkarL+5juw3kuxAh2lY4VSQel9JXoaUYp7iW98tOctHLx83w== X-Received: by 2002:a17:906:31c1:b0:aa5:31f5:922a with SMTP id a640c23a62f3a-aa580f1e0d4mr204197766b.19.1732705094209; Wed, 27 Nov 2024 02:58:14 -0800 (PST) Received: from puffmais.c.googlers.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa54a6db906sm412183566b.41.2024.11.27.02.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2024 02:58:13 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 27 Nov 2024 10:58:14 +0000 Subject: [PATCH 4/9] phy: exynos5-usbdrd: convert to dev_err_probe Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241127-gs101-phy-lanes-orientation-phy-v1-4-1b7fce24960b@linaro.org> References: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> In-Reply-To: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Szyprowski , Sylwester Nawrocki , Alim Akhtar Cc: Peter Griffin , Tudor Ambarus , Sam Protsenko , Will McVicker , Roy Luo , kernel-team@android.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 dev_err_probe() exists to simplify code. Signed-off-by: Andr=C3=A9 Draszik Reviewed-by: Krzysztof Kozlowski Reviewed-by: Peter Griffin --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung= /phy-exynos5-usbdrd.c index c421b495eb0f..ceae4b47cece 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -1725,10 +1725,9 @@ static int exynos5_usbdrd_phy_probe(struct platform_= device *pdev) =20 reg_pmu =3D syscon_regmap_lookup_by_phandle(dev->of_node, "samsung,pmu-syscon"); - if (IS_ERR(reg_pmu)) { - dev_err(dev, "Failed to lookup PMU regmap\n"); - return PTR_ERR(reg_pmu); - } + if (IS_ERR(reg_pmu)) + return dev_err_probe(dev, PTR_ERR(reg_pmu), + "Failed to lookup PMU regmap\n"); =20 /* * Exynos5420 SoC has multiple channels for USB 3.0 PHY, with @@ -1759,10 +1758,9 @@ static int exynos5_usbdrd_phy_probe(struct platform_= device *pdev) for (i =3D 0; i < EXYNOS5_DRDPHYS_NUM; i++) { struct phy *phy =3D devm_phy_create(dev, NULL, drv_data->phy_ops); =20 - if (IS_ERR(phy)) { - dev_err(dev, "Failed to create usbdrd_phy phy\n"); - return PTR_ERR(phy); - } + if (IS_ERR(phy)) + return dev_err_probe(dev, PTR_ERR(phy), + "Failed to create usbdrd_phy phy\n"); =20 phy_drd->phys[i].phy =3D phy; phy_drd->phys[i].index =3D i; @@ -1786,10 +1784,9 @@ static int exynos5_usbdrd_phy_probe(struct platform_= device *pdev) =20 phy_provider =3D devm_of_phy_provider_register(dev, exynos5_usbdrd_phy_xlate); - if (IS_ERR(phy_provider)) { - dev_err(phy_drd->dev, "Failed to register phy provider\n"); - return PTR_ERR(phy_provider); - } + if (IS_ERR(phy_provider)) + return dev_err_probe(phy_drd->dev, PTR_ERR(phy_provider), + "Failed to register phy provider\n"); =20 return 0; } --=20 2.47.0.338.g60cca15819-goog From nobody Mon Feb 9 13:24:29 2026 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72E291E0DF8 for ; Wed, 27 Nov 2024 10:58:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705098; cv=none; b=ukX10ZEiC6csTvd4yD0i6QI9sgf4LE/abxe62pvXT9E+HdurIyzMmY1OH3LNPNhQ4p28ST/kD3+8nw8pU3Q7Yzo1lnoydl41PvuLec17ldbzPUmB3IY30e8wKrwRwJ5HgHZTWNhcnYg9X0vveuWRjLaGZ9mdZucltVQqP+PiLOA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705098; c=relaxed/simple; bh=pxF3U2AMX2kAxO2vFBTnPKHJ/z4C1rX/30GUiYdACRE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sE8gR1W9Wqn27z0w6F2sxm7aGQvYS+d9jMCfWZCbagl7NWo1sD3DL0+PtRhQOkLyLy/DExeb++yY4wnG0gZtVMUFck+ARtjc+d8g8YLZK/Yp/YI5cbp6o+F6M6y9KmxlzCLGhLBxh7qO7wztx6p6OudQsthBOQfQqvGesD+3XiE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=S15Rmw1e; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="S15Rmw1e" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a9a68480164so906415066b.3 for ; Wed, 27 Nov 2024 02:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732705095; x=1733309895; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/Ela2PSfA/tyEVDL+lOFVH15DKBPE6OrGnsuqeliWc0=; b=S15Rmw1emeUL+6bNDFXxR7jiWwCjw9EaYm8h33Z0wSY5VYjy/IyasPZgOBv06sj9k4 Ihq2M25tNINVu9D/pUrWWpjoPxLue3+CFtM9zlgVDsZ8CG4qbf7qGr38FQwRT4dPDtS1 fm+P3LEpOdt3E2m6GKfn5iQ+eJmxge4/4vMi+ZpfC7Mh63R4B9YGRuzb4iq2yXOY6TZO W7XlRw8ofwNUHVLPKy8HIuHU6XpmklKW1zGh44wL3IuI9Krde+bmCxiBKmkAEkiBKtCd fo7IuFm7IMxgDjnrOCTY3Zb/eENlzgS4cJNjKx9hIFwIXlhr17THfi6yHWDCkubNnTXj 713Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732705095; x=1733309895; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/Ela2PSfA/tyEVDL+lOFVH15DKBPE6OrGnsuqeliWc0=; b=FaTlpyhZpP37tSuv1cnGE6xcu8+cOFsyeSFdby5J3SnpMwn0BhWnXwQzYkC6JK4xeg 5ejgBxeU+HnVFR66x1KUNQ7xhJVX/W8mL0Xmyz0Mc5dlDE93G9Nz7t7qmM08YGahbktY 9QsdhD/EjsmU0BBA5mCvt6EI1vJN7DKQVsNApCtmQvOp2dsNzeMUJYY60ktXprtMm9DZ CNaL4+DcNl7NDiUewEIWkcHsVanzVLiBQWQBZ8K8rN2mIIjIOTW50X9ySkHFMRvNa6jd HtMWuu7sVQl/MHcWZNMS6Ub7vHXQx0wRMJhHE/KbsvrIxMPToDAK+rUKq6dfhZ+G/Z4e Oi2g== X-Forwarded-Encrypted: i=1; AJvYcCV9qb0d7DrEwIWTsZRR7e2NexThuX3xnhHXFOItGsYHh8AQyBbJs44qs4/+VdCrPndaPgr/4za9Z3ZlFcU=@vger.kernel.org X-Gm-Message-State: AOJu0YwE9O01gEZoVhkB82gzPjtAqqgJb8R2qZanBWxMKH+vb0SH3adD WPLzzaShraQx5oHixIeS9E3XGDLJhimIcLDtWXajvbDIJrPkRk7EtaRSkt6SuiI= X-Gm-Gg: ASbGncuGl1xBc1gZ1pczaXcz+E18J+VOHpKDFOtdv0XaXZVSdCLDAzc5Ng1SGu+bWFS ret1q9Bxo7KZJF/pcyFgIXTSfFoBS+o1DA/Qx2PiN/ZParBUqG5DaRZijh+uJ411ZPHcfEgubm9 uF/kWEWYqeb3d5QAMkV7mKG6bH5KQFvtzObtNw6VyJjlV1P6epu9vROpJK5NJAoj2sYZYzExgem GiJWQTNpB+G1FH5EcMeRMDcP/LY4fz8X5Qw8zaiY6gujCg0uWUdZpb7PkGezswkRCDly+4/cbcN rPgWrb5+GpUkqI54a2ybTFq7xD5p0gVrCg== X-Google-Smtp-Source: AGHT+IGGy57a01XH3UbpX0NsvNr8Tj73NtCtISVWPxqvv7KY3oEK4Rqy5+2NoX4k6+nU1RKiz62pMw== X-Received: by 2002:a17:907:7da4:b0:aa5:43c4:da78 with SMTP id a640c23a62f3a-aa58108aaa2mr177836266b.51.1732705094719; Wed, 27 Nov 2024 02:58:14 -0800 (PST) Received: from puffmais.c.googlers.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa54a6db906sm412183566b.41.2024.11.27.02.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2024 02:58:14 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 27 Nov 2024 10:58:15 +0000 Subject: [PATCH 5/9] phy: exynos5-usbdrd: fix EDS distribution tuning (gs101) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241127-gs101-phy-lanes-orientation-phy-v1-5-1b7fce24960b@linaro.org> References: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> In-Reply-To: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Szyprowski , Sylwester Nawrocki , Alim Akhtar Cc: Peter Griffin , Tudor Ambarus , Sam Protsenko , Will McVicker , Roy Luo , kernel-team@android.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 This code's intention is to configure lane0 and lane2 tunings, but for lane2 there is a typo and it ends up tuning something else. Fix the typo, as it doesn't appear to make sense to apply different tunings for lane0 vs lane2. The same typo appears to exist in the bootloader, hence we restore the original value in the typo'd registers as well. This can be removed once / if the bootloader is updated. Note that this is incorrect in the downstream driver as well - the values had been copied from there. Signed-off-by: Andr=C3=A9 Draszik Reviewed-by: Peter Griffin Tested-by: Peter Griffin --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung= /phy-exynos5-usbdrd.c index ceae4b47cece..2a724d362c2d 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -1510,8 +1510,11 @@ static const struct exynos5_usbdrd_phy_tuning gs101_= tunes_pipe3_preinit[] =3D { PHY_TUNING_ENTRY_PMA(0x09e0, -1, 0x00), PHY_TUNING_ENTRY_PMA(0x09e4, -1, 0x36), PHY_TUNING_ENTRY_PMA(0x1e7c, -1, 0x06), - PHY_TUNING_ENTRY_PMA(0x1e90, -1, 0x00), - PHY_TUNING_ENTRY_PMA(0x1e94, -1, 0x36), + PHY_TUNING_ENTRY_PMA(0x19e0, -1, 0x00), + PHY_TUNING_ENTRY_PMA(0x19e4, -1, 0x36), + /* fix bootloader bug */ + PHY_TUNING_ENTRY_PMA(0x1e90, -1, 0x02), + PHY_TUNING_ENTRY_PMA(0x1e94, -1, 0x0b), /* improve LVCC */ PHY_TUNING_ENTRY_PMA(0x08f0, -1, 0x30), PHY_TUNING_ENTRY_PMA(0x18f0, -1, 0x30), --=20 2.47.0.338.g60cca15819-goog From nobody Mon Feb 9 13:24:29 2026 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 131621E0E07 for ; Wed, 27 Nov 2024 10:58:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705099; cv=none; b=GBV7tS9UGobkp4/Z1dsvyZQCqb2cTeuZfQOTg3W9NeaWxcc6FiBSehjWFaNzcGGpLeHx6UoE6MYkPCYa1voLyMLmxHf0NTlYnq0ur0BbnHfrqNKq1WqIriOaaLXCtnvr/5bkfBI/QolwgCsEwZ1Lz34FD++qA7r4MmC0cwITOac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705099; c=relaxed/simple; bh=tKaJ8XmsgFD3GQxgQIZteM0dQdO1QVEogrJL/zBu9vw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FK6shknN/mlo++l57rZL/DrdNVdF8sPgEEEAMKWiB60lknytqaIUNooPXyX8vfEpDO6Gp2cXFzUjaoxdBwGJFApVXWdS3z8AHD4iNrZN8iizFUwyo+dpSQedPQZB4gDFti3BcfREqyt3GER9OF+5V6gfah4Sm/bXfk7IataNdxA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Ujw/fRqS; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ujw/fRqS" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2ffc3f2b3a9so49035741fa.1 for ; Wed, 27 Nov 2024 02:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732705095; x=1733309895; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=w9Ja8bSv98C0dnIrT5U7vJcSaQnvSrF1zZ95Z+KMMq8=; b=Ujw/fRqSokWUTYujzyoPLG6nTy50DI2hXvfB/p3z7pdWNRpjEZsR5uERnSE5uJ9tDa 3tDDiRsBNV12ceYCteeplalW7ZQ4sDGWQlTmSGJVb0W0KAShBIK7fdr+BF9GKL+WBx9x +GzXm6bxQcFNJcQnwLNFKTCKy0PzzOv0LvX7roufg+UE0LM0co64qIXxrwYybnxhedAh Rb9xZ7kXlQuC/JA/3eObN36b/9X5GWZgTzF1IerRldiLlX/BPfuwDqdO7I0fDJu3qFQO ANCuIw1zd9FRms5bAM+yguVJctxLJC/mWulb28TEw/V8DEOGCaYj8W5Aqwv7Fg+0dL7+ IB0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732705095; x=1733309895; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w9Ja8bSv98C0dnIrT5U7vJcSaQnvSrF1zZ95Z+KMMq8=; b=hmqI23pVySTWqhKo6Pm0OPhw5YuSKOXBqH3qhHki31AfGGJfw9UAu6EwjkmA6wDw90 DGRJV/H8umN/dRqCH1TMYlxaqhGP8NqAxdbj5ZN8RzB08a9ctU+KotKi/TSTSarASpud 4MzdxzZS6k4os/7jvxIjuf3MlLhf/LPZlNdid283iFih5M8nPxFe/FxdmNPrkBgxL1qW yyX6vjaYCx8+v/fnavD95tnMqFPtv7fzcLl/nhSUAmAIYqn8Ueccoqa0OMduaF+fWS2E nycECZ1OM7YgQJ+LLqm2PY6XQdSLv+kt0mrkeFHt2fhGtfvIJwXbDBL1orEl46WAKEVG nCKw== X-Forwarded-Encrypted: i=1; AJvYcCVgiABI9RobDqCSdT6v9MA+0YK5QtynL74e5auvbcMBqd69+w2J8YJUF5/0G3531gf+e6UdhQ23NueyiUs=@vger.kernel.org X-Gm-Message-State: AOJu0Yxk9n3FAgBtz9RDH9pWD1copj2GYm/DXmm0gfDEQo4gK+dukGpD PEDgHdw6BFbXBIXjWC4OEVHnRhBEAmqYmLknq+Fsz3LTIiK7K+RaIA9dOrSQFP4= X-Gm-Gg: ASbGncsiuo+Ukhfopy5xFTJl2KXUf+EFV2kMZkbTIzyJUvuaAPI6lH+5g2nYzE4DF6U DjlaR+14NjXVQpzTozKRsyZAc9ixg+72VhKkr7ixXxfX03+y9+FqTGgqK2kgMk6akEHlFnYLVyZ R17qgLcuHuIHS1StNVyZ0POkTNl9rPh+4ATKWsyzhOHgSF4zOE+qPYq9qnhjdiJira+Q5639sGE LRMuAwLEXB/jx/D+u5a159lFrFR9IQjgiCHV0pA8/YQSkznynrTJ+X48AuMSCkJVmBqQibGYYwJ U/jxcFkZKBOMhU3rUyrHKJui+aDv/72udQ== X-Google-Smtp-Source: AGHT+IGFJqt4+X9+b9OZ9iJ+1uoSSp1Y782XmdGaTyXXLw7W9wq9YHlHSBg308ZxZ/fLYqnCqQPhog== X-Received: by 2002:a05:651c:b24:b0:2ff:c4b2:496b with SMTP id 38308e7fff4ca-2ffd5fcc1c9mr16671261fa.7.1732705095196; Wed, 27 Nov 2024 02:58:15 -0800 (PST) Received: from puffmais.c.googlers.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa54a6db906sm412183566b.41.2024.11.27.02.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2024 02:58:14 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 27 Nov 2024 10:58:16 +0000 Subject: [PATCH 6/9] phy: exynos5-usbdrd: gs101: ensure power is gated to SS phy in phy_exit() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241127-gs101-phy-lanes-orientation-phy-v1-6-1b7fce24960b@linaro.org> References: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> In-Reply-To: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Szyprowski , Sylwester Nawrocki , Alim Akhtar Cc: Peter Griffin , Tudor Ambarus , Sam Protsenko , Will McVicker , Roy Luo , kernel-team@android.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 We currently don't gate the power to the SS phy in phy_exit(). Shuffle the code slightly to ensure the power is gated to the SS phy as well. Signed-off-by: Andr=C3=A9 Draszik Reviewed-by: Krzysztof Kozlowski Reviewed-by: Peter Griffin --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung= /phy-exynos5-usbdrd.c index 2a724d362c2d..c1ce6fdeef31 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -1296,14 +1296,17 @@ static int exynos5_usbdrd_gs101_phy_exit(struct phy= *phy) struct exynos5_usbdrd_phy *phy_drd =3D to_usbdrd_phy(inst); int ret; =20 + if (inst->phy_cfg->id =3D=3D EXYNOS5_DRDPHY_UTMI) { + ret =3D exynos850_usbdrd_phy_exit(phy); + if (ret) + return ret; + } + + exynos5_usbdrd_phy_isol(inst, true); + if (inst->phy_cfg->id !=3D EXYNOS5_DRDPHY_UTMI) return 0; =20 - ret =3D exynos850_usbdrd_phy_exit(phy); - if (ret) - return ret; - - exynos5_usbdrd_phy_isol(inst, true); return regulator_bulk_disable(phy_drd->drv_data->n_regulators, phy_drd->regulators); } --=20 2.47.0.338.g60cca15819-goog From nobody Mon Feb 9 13:24:29 2026 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A6631E0DE3 for ; Wed, 27 Nov 2024 10:58:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705100; cv=none; b=LzhdkJjzwtU83m3cOinIAft1/jWMwFz/tYGWsiJGQ0IEQbFJsIkqFKWKOqq4q7gIxacgRwz3X0aSXGPSXpKlq1eyPvf5uicIcIgh56cZIJ7vmN7xw3pRQggdxziWONLrrTWW3RWm/wd5cyR8XuNd9ORg82GTJZie7Qk1QzQsCfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705100; c=relaxed/simple; bh=3z+3OrrHs0XCZfDLz7XD+u9amGrH0EuaZhr9cul7jPI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lJH0fbQP93ODqIZyhOqrjugAIVpivcGjXNeCo1AoGulnPK/VtkhNIyPbd8eKKyjrstcbIJaQpSArTDgUPD5fMvQjaifBkG3ONEEnG7oeYMzX8UrFomTs8Wpo3k+LPq4HMVwoJuqYCB3mtkRabARkcpi5F6ycOeUGj/GnlCExF2A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dkTjMth6; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dkTjMth6" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-aa51d32fa69so702537366b.2 for ; Wed, 27 Nov 2024 02:58:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732705096; x=1733309896; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AASoBGvbx8nrRldBio8kzQShrHQPCejymiRL3Jm8QQw=; b=dkTjMth6t2njsoqbCIA4Sn69SIcdE3UcAAQmN4hjZmgWks7qcZqqkvK+UtI9n3OQLT H56G/eiEY2k2nPV7pSW9+j7fBh4+FDb7BUEVviVR3/w9mLzXNSbLEs7TQEIQ3dxV0L6y ZngkvNDlhtpH2aZnZgfPgCenoJ+uKwbPQfFw+Ov+YF4SSnh7C9mziU5lDoWu+8ghEfym ejCnqM1VsX9aWAf6GLkj49ykpuFpy6HC+cqm/OySzywwabhw0LfcMMNe3l44rRGrhbu+ rKqsYxfhNntxYBIUGiK/KURz3zaTObewhbaV+Js9CtBB87ts+a+bEzNyNGwfpiUX3Ztc A0Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732705096; x=1733309896; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AASoBGvbx8nrRldBio8kzQShrHQPCejymiRL3Jm8QQw=; b=tqGUUgTNBfb1VbZin7se9eGZMatBgNiNMTY6pDLu+us3GnaDA7x1UWdWlM3oQg4Yt4 MjJhJnCtFjKC2zqJ6hPfWEDKiMARuqR4qQiergyFhPeh4qda/Hd4RY4aXmSaf1tMZGaK 8VGJPyFDCrpFqUm3RwFvav897BrVxOpmpqOHke6nic9vUm3j1IkZasLcIersdupVeQLF vV0q6QwFeOdFlMFKGET3HSvp3zOKay9O8EodIUM+65gO1/BA5PPW+4lkyO9iGsdyC65c PYwz4aLD6yxVzYGZ4YF1p2VVmTqF0UJXuv+nRSfJ32/eFhB+y52n0WLRPCCqyOP7OGkZ rWSw== X-Forwarded-Encrypted: i=1; AJvYcCXoTH5FzQ6IGfn3qXPCV54t0ZKmdP3WWARbD+i8hOQ2TjtdESxOvH8lRi+717hW81TER35rmCqHIOiYG9o=@vger.kernel.org X-Gm-Message-State: AOJu0YytWap6zlxzVyb3CwH+4nRXPJIUFD43Fkw+bYVJ2j4i3UpBbilf 0J5PgJXe+s3wkKOFNJD7X0lSpeTqZquyLwn/dDS9iN5cZiXOmFEvpqqc6Dh8ItU= X-Gm-Gg: ASbGnctSjv06DgSJwATzWIecFbpM1XGTvn+A96LplzVS4yigeuZ39HWcGhuVe/L6y6n RjHcyZB501Le5OKdgKzrjvr8XSW7aDxDNw4HP8Wes5cBYi1/KFoHCwWTLck0VsgqfRS0anYZn+I tnAcHguUbZxwywuuMUmq/O93e/OOcCZptRxtk8z5bhwthtH62OSUqqCj7JBmlz5DdWDdOVPrAi4 hgMLoIDQXgFwkZTnvAwnnbmHlfsHfG2H7CpONF6HjSHqwEJHmVT0FtYnxdyP4nisq4+t/OY4PEp sNXg8+34n1EAp+ZuNZpPA4gRECflAhcwbQ== X-Google-Smtp-Source: AGHT+IF3uxkslq060bQu5IOXE2CVt35TZdsY8S2FoowTgID7ALlXsIj3b2YpVReHJiVUCHWHrA1DAQ== X-Received: by 2002:a17:907:7819:b0:aa5:b2b:f236 with SMTP id a640c23a62f3a-aa580f353f3mr179583566b.28.1732705095696; Wed, 27 Nov 2024 02:58:15 -0800 (PST) Received: from puffmais.c.googlers.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa54a6db906sm412183566b.41.2024.11.27.02.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2024 02:58:15 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 27 Nov 2024 10:58:17 +0000 Subject: [PATCH 7/9] phy: exynos5-usbdrd: gs101: configure SS lanes based on orientation Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241127-gs101-phy-lanes-orientation-phy-v1-7-1b7fce24960b@linaro.org> References: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> In-Reply-To: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Szyprowski , Sylwester Nawrocki , Alim Akhtar Cc: Peter Griffin , Tudor Ambarus , Sam Protsenko , Will McVicker , Roy Luo , kernel-team@android.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 USB SS lanes need to be configured based the connector orientation - at most two lanes will be in use for USB (and the remaining two for alternate modes like DP). For the USB link to come up in SS, the lane configuration registers have to be programmed accordingly. While we still need a way to be notified of the actual connector orientation and then reprogram the registers accordingly (at the moment the configuration happens just once during phy_init() and never again), we can prepare the code doing the configuration to take the orientation into account. Do so. Note: the mutex is needed to synchronize this with the upcoming connector orientation callback. Signed-off-by: Andr=C3=A9 Draszik Reviewed-by: Peter Griffin Tested-by: Peter Griffin --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 72 ++++++++++++++++++++++------= ---- 1 file changed, 51 insertions(+), 21 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung= /phy-exynos5-usbdrd.c index c1ce6fdeef31..1a34e9b4618a 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -23,6 +23,7 @@ #include #include #include +#include =20 /* Exynos USB PHY registers */ #define EXYNOS5_FSEL_9MHZ6 0x0 @@ -209,6 +210,10 @@ =20 #define EXYNOS9_PMA_USBDP_CMN_REG00B8 0x02e0 #define CMN_REG00B8_LANE_MUX_SEL_DP GENMASK(3, 0) +#define CMN_REG00B8_LANE_MUX_SEL_DP_LANE3 BIT(3) +#define CMN_REG00B8_LANE_MUX_SEL_DP_LANE2 BIT(2) +#define CMN_REG00B8_LANE_MUX_SEL_DP_LANE1 BIT(1) +#define CMN_REG00B8_LANE_MUX_SEL_DP_LANE0 BIT(0) =20 #define EXYNOS9_PMA_USBDP_CMN_REG01C0 0x0700 #define CMN_REG01C0_ANA_LCPLL_LOCK_DONE BIT(7) @@ -383,11 +388,13 @@ struct exynos5_usbdrd_phy_drvdata { * @clks: clocks for register access * @core_clks: core clocks for phy (ref, pipe3, utmi+, ITP, etc. as requir= ed) * @drv_data: pointer to SoC level driver data structure + * @phy_mutex: mutex protecting phy_init/exit & TCPC callbacks * @phys: array for 'EXYNOS5_DRDPHYS_NUM' number of PHY * instances each with its 'phy' and 'phy_cfg'. * @extrefclk: frequency select settings when using 'separate * reference clocks' for SS and HS operations * @regulators: regulators for phy + * @orientation: TypeC connector orientation - normal or flipped */ struct exynos5_usbdrd_phy { struct device *dev; @@ -397,6 +404,7 @@ struct exynos5_usbdrd_phy { struct clk_bulk_data *clks; struct clk_bulk_data *core_clks; const struct exynos5_usbdrd_phy_drvdata *drv_data; + struct mutex phy_mutex; struct phy_usb_instance { struct phy *phy; u32 index; @@ -406,6 +414,8 @@ struct exynos5_usbdrd_phy { } phys[EXYNOS5_DRDPHYS_NUM]; u32 extrefclk; struct regulator_bulk_data *regulators; + + enum typec_orientation orientation; }; =20 static inline @@ -647,22 +657,38 @@ exynos5_usbdrd_usbdp_g2_v4_pma_lane_mux_sel(struct ex= ynos5_usbdrd_phy *phy_drd) /* lane configuration: USB on all lanes */ reg =3D readl(regs_base + EXYNOS9_PMA_USBDP_CMN_REG00B8); reg &=3D ~CMN_REG00B8_LANE_MUX_SEL_DP; - writel(reg, regs_base + EXYNOS9_PMA_USBDP_CMN_REG00B8); - /* - * FIXME: below code supports one connector orientation only. It needs - * updating once we can receive connector events. + * USB on lanes 0 & 1 in normal mode, or 2 & 3 if reversed, DP on the + * other ones. */ + reg |=3D FIELD_PREP(CMN_REG00B8_LANE_MUX_SEL_DP, + ((phy_drd->orientation =3D=3D TYPEC_ORIENTATION_NORMAL) + ? (CMN_REG00B8_LANE_MUX_SEL_DP_LANE3 + | CMN_REG00B8_LANE_MUX_SEL_DP_LANE2) + : (CMN_REG00B8_LANE_MUX_SEL_DP_LANE1 + | CMN_REG00B8_LANE_MUX_SEL_DP_LANE0))); + writel(reg, regs_base + EXYNOS9_PMA_USBDP_CMN_REG00B8); + /* override of TX receiver detector and comparator: lane 1 */ reg =3D readl(regs_base + EXYNOS9_PMA_USBDP_TRSV_REG0413); - reg &=3D ~TRSV_REG0413_OVRD_LN1_TX_RXD_COMP_EN; - reg &=3D ~TRSV_REG0413_OVRD_LN1_TX_RXD_EN; + if (phy_drd->orientation =3D=3D TYPEC_ORIENTATION_NORMAL) { + reg &=3D ~TRSV_REG0413_OVRD_LN1_TX_RXD_COMP_EN; + reg &=3D ~TRSV_REG0413_OVRD_LN1_TX_RXD_EN; + } else { + reg |=3D TRSV_REG0413_OVRD_LN1_TX_RXD_COMP_EN; + reg |=3D TRSV_REG0413_OVRD_LN1_TX_RXD_EN; + } writel(reg, regs_base + EXYNOS9_PMA_USBDP_TRSV_REG0413); =20 /* lane 3 */ reg =3D readl(regs_base + EXYNOS9_PMA_USBDP_TRSV_REG0813); - reg |=3D TRSV_REG0813_OVRD_LN3_TX_RXD_COMP_EN; - reg |=3D TRSV_REG0813_OVRD_LN3_TX_RXD_EN; + if (phy_drd->orientation =3D=3D TYPEC_ORIENTATION_NORMAL) { + reg |=3D TRSV_REG0813_OVRD_LN3_TX_RXD_COMP_EN; + reg |=3D TRSV_REG0813_OVRD_LN3_TX_RXD_EN; + } else { + reg &=3D ~TRSV_REG0813_OVRD_LN3_TX_RXD_COMP_EN; + reg &=3D ~TRSV_REG0813_OVRD_LN3_TX_RXD_EN; + } writel(reg, regs_base + EXYNOS9_PMA_USBDP_TRSV_REG0813); } =20 @@ -700,21 +726,18 @@ exynos5_usbdrd_usbdp_g2_v4_pma_check_cdr_lock(struct = exynos5_usbdrd_phy *phy_drd int err; =20 err =3D readl_poll_timeout( - phy_drd->reg_pma + EXYNOS9_PMA_USBDP_TRSV_REG03C3, - reg, (reg & locked) =3D=3D locked, sleep_us, timeout_us); - if (!err) - return; - - dev_err(phy_drd->dev, - "timed out waiting for CDR lock (l0): %#.8x, retrying\n", reg); - - /* based on cable orientation, this might be on the other phy port */ - err =3D readl_poll_timeout( - phy_drd->reg_pma + EXYNOS9_PMA_USBDP_TRSV_REG07C3, + /* lane depends on cable orientation */ + (phy_drd->reg_pma + + ((phy_drd->orientation =3D=3D TYPEC_ORIENTATION_NORMAL) + ? EXYNOS9_PMA_USBDP_TRSV_REG03C3 + : EXYNOS9_PMA_USBDP_TRSV_REG07C3)), reg, (reg & locked) =3D=3D locked, sleep_us, timeout_us); if (err) dev_err(phy_drd->dev, - "timed out waiting for CDR lock (l2): %#.8x\n", reg); + "timed out waiting for CDR(l%d) lock: %#.8x\n", + ((phy_drd->orientation =3D=3D TYPEC_ORIENTATION_NORMAL) + ? 0 + : 2), reg); } =20 static void exynos5_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd) @@ -1184,7 +1207,8 @@ static int exynos850_usbdrd_phy_init(struct phy *phy) return ret; =20 /* UTMI or PIPE3 specific init */ - inst->phy_cfg->phy_init(phy_drd); + scoped_guard(mutex, &phy_drd->phy_mutex) + inst->phy_cfg->phy_init(phy_drd); =20 clk_bulk_disable_unprepare(phy_drd->drv_data->n_clks, phy_drd->clks); =20 @@ -1203,6 +1227,8 @@ static int exynos850_usbdrd_phy_exit(struct phy *phy) if (ret) return ret; =20 + guard(mutex)(&phy_drd->phy_mutex); + /* Set PHY clock and control HS PHY */ reg =3D readl(regs_base + EXYNOS850_DRD_UTMI); reg &=3D ~(UTMI_DP_PULLDOWN | UTMI_DM_PULLDOWN); @@ -1701,6 +1727,10 @@ static int exynos5_usbdrd_phy_probe(struct platform_= device *pdev) return -EINVAL; phy_drd->drv_data =3D drv_data; =20 + ret =3D devm_mutex_init(dev, &phy_drd->phy_mutex); + if (ret) + return ret; + if (of_property_present(dev->of_node, "reg-names")) { void __iomem *reg; =20 --=20 2.47.0.338.g60cca15819-goog From nobody Mon Feb 9 13:24:29 2026 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D152C1E1027 for ; Wed, 27 Nov 2024 10:58:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705100; cv=none; b=P9Xuo4t+KRJAbgvocxtwkZqrEfTJKfEyabAgOxMDERlmq5suqP566EsR4KJaK2lOca+4XBQSS1maeIEQKlTSaiwkMAZYQ48TJ5mCr2Jbl9Ekd9SkORQXU/YQhAwqdO4RUKUWrQ22zCDppAcW0MZ1Z+0bx207SK2azTbE1uCgmUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705100; c=relaxed/simple; bh=vk7GIuuXZP08z7cZz70iwdNsc2i3/+3u12QICuVoPos=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xi0cclNOOjsHkEYBOafepemTT5E7+eeMRLLlmdfbgMCBEVgJwHgH/9i46oKv0E4DaqY3myRBK3EMlJIUiLdi2W5xe+L+Q7aeIpllWBXJJrQQ9VUkPYfRweiTbPfse8TL1BScW13Fu/19qTtkHMt23xnVH3eXut8ibH6aSnEOY20= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=salSG196; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="salSG196" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-aa53ebdf3caso621942766b.2 for ; Wed, 27 Nov 2024 02:58:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732705096; x=1733309896; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=d706DhbkVyX7Vrt0xFDuDzjHOlFjZMBwKWZfTRMnyD8=; b=salSG196y6wK2I5JWoLs//OavpnukJ2L/bH6L4E1B1wi1RL89W8m2ACS8GrSYDHlKg CP2kak4ZZ6DMmdtPe0dSz1PeODSrfw15oPzyAXydGaOuidIl/zSvDrpbphuv1pdmPdAd Ba8drnvW4P6Ds6cEka9KQKAspONxwX4X6T+UPtQizC2iBhztGnI10fEJjEYW22HATLhU UCSiS8GPovq8fpgoqSvO2KmnrEGpjuEB1jjw9nRC4q/La0/VGB99pZXEndlcMULpP6zq 9EtW+JxUvUoUzBSwFz2WtmdWAyrng911vugz47g8tQATq8S0svlUo8F1Pt09ch94/Cam OLAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732705096; x=1733309896; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d706DhbkVyX7Vrt0xFDuDzjHOlFjZMBwKWZfTRMnyD8=; b=JMKdbMGz7fAY9wsUJUAaDkf9bsc83LEdoz7b0Vxbq0yXYIYieREbHY7LZ7bwQsFNEa OpksggD7y1bQsFHORlqHLtcVJPXcCBd//dBA4imuNDZghKCs9WC/35oW/XEg1j6ot9b1 qvLGIdjtaKifg4fxrYxvmqIA+V/YaP2Rkni03gO438lVvGYJt3AFccO0JPj8OiOqiAk/ iumc4L78FhrOTf2oUKm+8qUzXrwDCpRJ+wOHfA8iDuMnqH/f7yswfQtv6E2A2cwgR3OD r10uTzJ+L3Tnfi3kEDnphZSftKH2XJ0DpRkhGRSFOs2zy1ZLdGB0fLMwjxm8Mv95qZpW wCGw== X-Forwarded-Encrypted: i=1; AJvYcCX3mwAGy4vb1e/QbRbCE+NpIrWehXUAP3xMp2icwjjb/8uyxWJSS5gcdJZMoTkvypbCWQa4XBXLAoS3RVU=@vger.kernel.org X-Gm-Message-State: AOJu0Ywmtj7bPl0YyBJqlPZkqVy/mBMPbJw3qnuv/M2x5NubKV2/Bk/n 9kyopIATN33ltXhW3zPETihTGWUvu38EiHoV0ucVtRm1LRmFf76R7uh/lIP7G/M= X-Gm-Gg: ASbGncvdjlIo3/JzCEDjAHgmL1BZIoN/wm5QsOK9x5ZRpiEUKXCtjtR1OYRccel/fPt iV1k4GXMS68rxDoOp1ohf5qDrmrWQnJvgRZ4tXGJpE0aocXkHCexSaCeqOVfIgUzRX+jGGuexaP p/rs/okecvY6xGEun7C4HTGtHTgV7hf38S3rXalcgT3YtbpeET+Rzf+/QP4TGws+AX+tX9lvXfB 1LIVc44Ide99B3b7U5z/1XSqOufSoFQOy8xdAnnwSJfSlkYs6Z/oLu+SOUtQ56ATf8COskSfJIj bHBEV1FwBsgCVdARLqfNUUG7M9/ssCdeAA== X-Google-Smtp-Source: AGHT+IFxyNLQvFsWnKU+TtOMetky+Uzt8fcx1BHPsN1RlACtIuFqEyfUvWmlfpzjndBcHn9MinYV7Q== X-Received: by 2002:a17:906:3cb1:b0:a9f:508:5f5a with SMTP id a640c23a62f3a-aa58103dcf8mr225475566b.40.1732705096199; Wed, 27 Nov 2024 02:58:16 -0800 (PST) Received: from puffmais.c.googlers.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa54a6db906sm412183566b.41.2024.11.27.02.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2024 02:58:15 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 27 Nov 2024 10:58:18 +0000 Subject: [PATCH 8/9] phy: exynos5-usbdrd: subscribe to orientation notifier if required Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241127-gs101-phy-lanes-orientation-phy-v1-8-1b7fce24960b@linaro.org> References: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> In-Reply-To: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Szyprowski , Sylwester Nawrocki , Alim Akhtar Cc: Peter Griffin , Tudor Ambarus , Sam Protsenko , Will McVicker , Roy Luo , kernel-team@android.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 gs101's SS phy needs to be configured differently based on the connector orientation, as the SS link can only be established if the mux is configured correctly. The code to handle programming of the mux is in place already, this commit now adds the missing pieces to subscribe to the Type-C orientation switch event. Note that for this all to work we rely on the USB controller re-initialising us. It should invoke our .exit() upon cable unplug, and during cable plug we'll receive the orientation event after which we expect our .init() to be called. Above reinitialisation happens if the DWC3 controller can enter runtime suspend automatically. For the DWC3 driver, this is an opt-in: echo auto > /sys/devices/.../11110000.usb/power/control Once done, things work as long as the UDC is not bound as otherwise it stays busy because it doesn't cancel / stop outstanding TRBs. For now we have to manually unbind the UDC in that case: echo "" > sys/kernel/config/usb_gadget/.../UDC Signed-off-by: Andr=C3=A9 Draszik --- drivers/phy/samsung/Kconfig | 1 + drivers/phy/samsung/phy-exynos5-usbdrd.c | 60 ++++++++++++++++++++++++++++= ++++ 2 files changed, 61 insertions(+) diff --git a/drivers/phy/samsung/Kconfig b/drivers/phy/samsung/Kconfig index f10afa3d7ff5..fc7bd1088576 100644 --- a/drivers/phy/samsung/Kconfig +++ b/drivers/phy/samsung/Kconfig @@ -80,6 +80,7 @@ config PHY_EXYNOS5_USBDRD tristate "Exynos5 SoC series USB DRD PHY driver" depends on (ARCH_EXYNOS && OF) || COMPILE_TEST depends on HAS_IOMEM + depends on TYPEC || (TYPEC=3Dn && COMPILE_TEST) depends on USB_DWC3_EXYNOS select GENERIC_PHY select MFD_SYSCON diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung= /phy-exynos5-usbdrd.c index 1a34e9b4618a..2010d25ee817 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -394,6 +394,7 @@ struct exynos5_usbdrd_phy_drvdata { * @extrefclk: frequency select settings when using 'separate * reference clocks' for SS and HS operations * @regulators: regulators for phy + * @sw: TypeC orientation switch handle * @orientation: TypeC connector orientation - normal or flipped */ struct exynos5_usbdrd_phy { @@ -415,6 +416,7 @@ struct exynos5_usbdrd_phy { u32 extrefclk; struct regulator_bulk_data *regulators; =20 + struct typec_switch_dev *sw; enum typec_orientation orientation; }; =20 @@ -1400,6 +1402,60 @@ static int exynos5_usbdrd_phy_clk_handle(struct exyn= os5_usbdrd_phy *phy_drd) return 0; } =20 +#if IS_ENABLED(CONFIG_TYPEC) +static int exynos5_usbdrd_orien_sw_set(struct typec_switch_dev *sw, + enum typec_orientation orientation) +{ + struct exynos5_usbdrd_phy *phy_drd =3D typec_switch_get_drvdata(sw); + + scoped_guard(mutex, &phy_drd->phy_mutex) + phy_drd->orientation =3D orientation; + + return 0; +} + +static void exynos5_usbdrd_orien_switch_unregister(void *data) +{ + struct exynos5_usbdrd_phy *phy_drd =3D data; + + typec_switch_unregister(phy_drd->sw); +} + +static int exynos5_usbdrd_setup_notifiers(struct exynos5_usbdrd_phy *phy_d= rd) +{ + int ret; + + phy_drd->orientation =3D (enum typec_orientation)-1; + if (device_property_present(phy_drd->dev, "orientation-switch")) { + struct typec_switch_desc sw_desc =3D { }; + + sw_desc.drvdata =3D phy_drd; + sw_desc.fwnode =3D dev_fwnode(phy_drd->dev); + sw_desc.set =3D exynos5_usbdrd_orien_sw_set; + + phy_drd->sw =3D typec_switch_register(phy_drd->dev, &sw_desc); + if (IS_ERR(phy_drd->sw)) + return dev_err_probe(phy_drd->dev, + PTR_ERR(phy_drd->sw), + "Failed to register TypeC orientation switch\n"); + + ret =3D devm_add_action_or_reset(phy_drd->dev, + exynos5_usbdrd_orien_switch_unregister, + phy_drd); + if (ret) + return dev_err_probe(phy_drd->dev, ret, + "Failed to register TypeC orientation devm action\n"); + } + + return 0; +} +#else /* CONFIG_TYPEC */ +static int exynos5_usbdrd_setup_notifiers(struct exynos5_usbdrd_phy *phy_d= rd) +{ + return 0; +} +#endif /* CONFIG_TYPEC */ + static const struct exynos5_usbdrd_phy_config phy_cfg_exynos5[] =3D { { .id =3D EXYNOS5_DRDPHY_UTMI, @@ -1789,6 +1845,10 @@ static int exynos5_usbdrd_phy_probe(struct platform_= device *pdev) if (ret) return dev_err_probe(dev, ret, "failed to get regulators\n"); =20 + ret =3D exynos5_usbdrd_setup_notifiers(phy_drd); + if (ret) + return ret; + dev_vdbg(dev, "Creating usbdrd_phy phy\n"); =20 for (i =3D 0; i < EXYNOS5_DRDPHYS_NUM; i++) { --=20 2.47.0.338.g60cca15819-goog From nobody Mon Feb 9 13:24:29 2026 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69D8E1E1045 for ; Wed, 27 Nov 2024 10:58:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705100; cv=none; b=V8NUJSHgNk8C9tmiHCaybBIU3R5E5DHR6qtPix1jdCkMS7vGfmZ+UXuVLbsHFYKL56Nq0ladeAevX/4TuHBynpsPoPDz0mg/Anpow2Lu7IxFM/tV20ZAo6mtGGXAJfgsUU0RSiBYYlPeevqrGSbsF0gSClsKQuCj92d8f74oJWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732705100; c=relaxed/simple; bh=DEjXbk2ZL7RN6klD/z2w1DAkclajULASsORJFiQ9lKI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fEmNWu/cKGjQa5Xd067wjIvI/PSZomw7VeergOXnfa8DjmB49AClKEWcUdq8UpsA3haaVLtEJUa/IyBjeAYej/QpkN8Kn8yOaFX5yTZA4UPmvVawQmAMiw64WIRh9ZFGmFQv5geIz1nr7qsL5gLWTpmOqB6KPL6xysQFQBXT20c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=G6SEZ68F; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="G6SEZ68F" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-aa535eed875so633852166b.3 for ; Wed, 27 Nov 2024 02:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732705097; x=1733309897; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=lqGYeTvXa+CcRrauQewHltxn0fZOtsvS5bEzws0xGp0=; b=G6SEZ68FWhwqE154WNWR4XmEMmHzJLSNNL4p2xDZTTPqI/2j48w3mpJlw2HVxjY6mm /qH/5JF86T+Diio/fV0XKhiap7w8trM/YQ/sdozacIqcT8J7IBz/wOhIarbYo1qUITxP FilVFRIvNmyp4LGdPelTj6u+cEEPWn5bGdfaylkoU9aFTgyLdNxQJFWPwRCPs0oLekE1 ShBRDE0iJdd2aB5m8PpU6ByTgVbHzm9xFOQeZ9wqiMcLB2S83Z5EdAgCAxGiiF3+C7RB BHnS2jWYmLDiQuiJsNQqUE4lsOgnjn+PDq65M6YnE7wHmQ2FH5ygObqv20O0IJhdqaEs IkKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732705097; x=1733309897; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lqGYeTvXa+CcRrauQewHltxn0fZOtsvS5bEzws0xGp0=; b=aSbAXiP7lhuJbeDjq0XalORXx1AbQwR2ybZuow8ll6nteY4GXVgVyVBGkt/8Le4auA I6U6jyK7b9yVPKpS791TLDoBoUdjESBb+LjHtm48GoRKkP//2Slv/c1PPCs8qY1OCeDu 7paB3bh+MBxKVCqOcKKEXrswTph+01Aj5MweKTs4nF9KToyDBCPOxOcTt94Aprdxht+j W1QJ9yXetEz8IWFAfAkWz54vZr+D0DxsiAcPXuxbFhVBarQM1Ruj/UOcCnlAjS+AVJTJ qerNss6AlIfjUMx52Jfq9PiaQX/GDLnB+0mL5BcZBe88tXr39j/lJ14wlZZsaWojxagk 3WvQ== X-Forwarded-Encrypted: i=1; AJvYcCVVA23lI0xeTa1WVugpuoL7XpkROcI6RDAB4zh7s+AZ6Ah5zCjuYYJM/VwO1MD1zV2DcKDI3ErnFKRdxWE=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3iiSdYcgBhj6NcF29ke4ugsUpe8lvvuHUWAFDGnaThQci37GW ZrPOr+AXsBwtgAMWxVCeUEpfAwyWvltZccz18/Pv0AMd3g2TM2EybZtytLczD1s= X-Gm-Gg: ASbGncsQ/hQZmzMe6rPEbhYuaqAYArzcxfUKBBRCphOfggmP5o2wRkVcdXz5UmDHYcO sdDcCkC/4Xwz/VMt2bYm45l/SWQ3E3W3N2TELQLruhR6jH0hc72ff6jlnT3rbcPP+enU1WR4nBK GMM0v6QVAQoyVio/xsCWJDTBPcIXvxsRFk4bQ9sZQCU8R4QqJbvJE6dV//d3et/G3yCupD/HI4Z OAYmmmEEnbxnJaz4Z718L1GIKrykQLTduACi5Pj23r7oHUUdPO0X8KrXoj3irWRsCZeYRxU4DMO OGKd+pdP56spKZpJOkirZyf/eIVPseNWzQ== X-Google-Smtp-Source: AGHT+IGfxl8jje43Ziyzp10Eq1Sbw1hY/V6VsB8QGc/5pAdKJlSGGUSbGZ9QxG2adkSeh2QmDqCL0g== X-Received: by 2002:a17:907:7637:b0:aa5:4adc:5a1f with SMTP id a640c23a62f3a-aa580f58e93mr163841166b.33.1732705096651; Wed, 27 Nov 2024 02:58:16 -0800 (PST) Received: from puffmais.c.googlers.com (64.227.90.34.bc.googleusercontent.com. [34.90.227.64]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa54a6db906sm412183566b.41.2024.11.27.02.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2024 02:58:16 -0800 (PST) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Wed, 27 Nov 2024 10:58:19 +0000 Subject: [PATCH 9/9] phy: exynos5-usbdrd: allow DWC3 runtime suspend with UDC bound (E850+) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241127-gs101-phy-lanes-orientation-phy-v1-9-1b7fce24960b@linaro.org> References: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> In-Reply-To: <20241127-gs101-phy-lanes-orientation-phy-v1-0-1b7fce24960b@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Szyprowski , Sylwester Nawrocki , Alim Akhtar Cc: Peter Griffin , Tudor Ambarus , Sam Protsenko , Will McVicker , Roy Luo , kernel-team@android.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, =?utf-8?q?Andr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 To make USB runtime suspend work when a UDC has been bound, the phy needs to inform the USBDRD controller (DWC3) that Vbus and bvalid are gone, so that it can in turn raise the respective gadget interrupt with event =3D=3D DWC3_DEVICE_EVENT_DISCONNECT, which will cause the USB stack to clean up, allowing DWC3 to enter runtime suspend. On e850 and gs101 this isn't working, as the respective signals are not directly connected, and instead this driver uses override bits in the PHY IP to set those signals. It currently forcefully sets them to 'on', so the above mentioned interrupt will not be raised, preventing runtime suspend. To detect that state, update this driver to act on the TCPC's orientation signal - when orientation =3D=3D NONE, Vbus is gone and we can clear the respective bits. Similarly, for other orientation values we re-enable them. This makes runtime suspend work on platforms with a TCPC (like Pixel6), while keeping compatibility with platforms without (e850-96). With runtime suspend working, USB-C cable orientation detection now also fully works on such platforms, and the link comes up as Superspeed as expected irrespective of the cable orientation and whether UDC / gadget are configured and active. Signed-off-by: Andr=C3=A9 Draszik --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 53 +++++++++++++++++++++++++++-= ---- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung= /phy-exynos5-usbdrd.c index 2010d25ee817..4882158df1a5 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -1136,13 +1136,15 @@ static void exynos850_usbdrd_utmi_init(struct exyno= s5_usbdrd_phy *phy_drd) reg |=3D LINKCTRL_BUS_FILTER_BYPASS(0xf); writel(reg, regs_base + EXYNOS850_DRD_LINKCTRL); =20 - reg =3D readl(regs_base + EXYNOS850_DRD_UTMI); - reg |=3D UTMI_FORCE_BVALID | UTMI_FORCE_VBUSVALID; - writel(reg, regs_base + EXYNOS850_DRD_UTMI); - - reg =3D readl(regs_base + EXYNOS850_DRD_HSP); - reg |=3D HSP_VBUSVLDEXT | HSP_VBUSVLDEXTSEL; - writel(reg, regs_base + EXYNOS850_DRD_HSP); + if (!phy_drd->sw) { + reg =3D readl(regs_base + EXYNOS850_DRD_UTMI); + reg |=3D UTMI_FORCE_BVALID | UTMI_FORCE_VBUSVALID; + writel(reg, regs_base + EXYNOS850_DRD_UTMI); + + reg =3D readl(regs_base + EXYNOS850_DRD_HSP); + reg |=3D HSP_VBUSVLDEXT | HSP_VBUSVLDEXTSEL; + writel(reg, regs_base + EXYNOS850_DRD_HSP); + } =20 reg =3D readl(regs_base + EXYNOS850_DRD_SSPPLLCTL); reg &=3D ~SSPPLLCTL_FSEL; @@ -1407,9 +1409,44 @@ static int exynos5_usbdrd_orien_sw_set(struct typec_= switch_dev *sw, enum typec_orientation orientation) { struct exynos5_usbdrd_phy *phy_drd =3D typec_switch_get_drvdata(sw); + int ret; + + if (phy_drd->orientation =3D=3D orientation) + return 0; + + ret =3D clk_bulk_prepare_enable(phy_drd->drv_data->n_clks, phy_drd->clks); + if (ret) { + dev_err(phy_drd->dev, "Failed to enable PHY clocks(s)\n"); + return ret; + } + + scoped_guard(mutex, &phy_drd->phy_mutex) { + void __iomem * const regs_base =3D phy_drd->reg_phy; + unsigned int reg; + + if (orientation =3D=3D TYPEC_ORIENTATION_NONE) { + reg =3D readl(regs_base + EXYNOS850_DRD_UTMI); + reg &=3D ~(UTMI_FORCE_VBUSVALID | UTMI_FORCE_BVALID); + writel(reg, regs_base + EXYNOS850_DRD_UTMI); + + reg =3D readl(regs_base + EXYNOS850_DRD_HSP); + reg |=3D HSP_VBUSVLDEXTSEL; + reg &=3D ~HSP_VBUSVLDEXT; + writel(reg, regs_base + EXYNOS850_DRD_HSP); + } else { + reg =3D readl(regs_base + EXYNOS850_DRD_UTMI); + reg |=3D UTMI_FORCE_VBUSVALID | UTMI_FORCE_BVALID; + writel(reg, regs_base + EXYNOS850_DRD_UTMI); + + reg =3D readl(regs_base + EXYNOS850_DRD_HSP); + reg |=3D HSP_VBUSVLDEXTSEL | HSP_VBUSVLDEXT; + writel(reg, regs_base + EXYNOS850_DRD_HSP); + } =20 - scoped_guard(mutex, &phy_drd->phy_mutex) phy_drd->orientation =3D orientation; + } + + clk_bulk_disable(phy_drd->drv_data->n_clks, phy_drd->clks); =20 return 0; } --=20 2.47.0.338.g60cca15819-goog