From patchwork Wed Nov 27 10:58:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13886941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CBD2CD6ACC0 for ; Wed, 27 Nov 2024 12:07:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=u3bheMto3E1kl1HdoApxqJvOhczEZkMy970AMWo89Pc=; b=pBuj1ioBwd/PEni4xb59kHEC1f ztuzGbkxtKBQtOCyEJNwLOpNHjcNly/YfyruHVSZacPPaV1bVRAKF21VbOWjmlwTIx6ImDhtR04/U NIYHe5QAxvkGyfAe+98R+Grd9UVGeGwCeiTUUUQ5j48oz0VqP8u5btaE1AU2EWe07Y/MRKrMTNBOn SWQerr+TpurVMWUAp+wnk0b034+mznLo7aROmLbmp1sC9nXsYrUCzidVmtgCT2XDWowINV6Sgm/IS mMozOseKUfqVvfmYLe8KNWgp6YI/kvKdR+taUVW4PMOMsCBm070K7ayU4kYhwMeSEu5y0zsyspc+g 4vTgU61Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGGon-0000000D5fy-26XC; Wed, 27 Nov 2024 12:06:53 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkM-0000000CvBZ-2wKi for linux-arm-kernel@lists.infradead.org; Wed, 27 Nov 2024 10:58:17 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5cfbeed072dso8571436a12.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=lists.infradead.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=d1lOrIlrHjfhHFp223Vk3vpcJ7x7uuH0++IwKL4nLSUPVT2tLqioiipKzw1UrWCqyo y+jJqoClsacTmDOECW10KfCBKpY0KCn5zT1jpV4mr8cO5cg6dH5SOytZ2dEvHqRT8brj NjmlFq6Mb5Png/Z6Om18oz0QzHUI6XJvVJEjauviK/l7G0QvOKAWTcbb0JCY9gGbMym4 +guzUgOc04PN0CdgmWL/Z5vqIhMPuIn+bgdamhHhcPObjPvEMUhaj6tier89/hu5Q38w VP4ji9MRkILqDGOfbdRM75k+flNARtCSAAcTEF6AMkdn3ol//LUeLYGzgCcf0DddzW6Y yMRw== 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=DbSw/n0mOY0EXdOmAax/Sue5Eoa4Feu6pO+7O7J8dRDzg5BSsqEdGOyFL9VcaMJ+23 KuqXtoSq2S4c2zjhbKWswpTCpMmELiBKze2FDOxszkiUoqzvUdNsEz27T/qOg4Qgcq/D I+Ay60Ekq6WlntnqiJyGg7te9WVopDs17EgVJlWXrdxAAE9w/g6IWcvPMDW+1phWXJXm Kd568OqG3qIECAStzYtFVB9uDOswXwFpI2NvQDAoK1SfBYykyr0oRyC8VHQpazck0Cys W0LEIkTrfXdxZ/juO9cTxwfLl53JeGPr2aGzQZSHuAnlzJWv3LD21hd8IM3bHX97dooy hTkw== X-Forwarded-Encrypted: i=1; AJvYcCXxE9AZHK821AFVcWC0/jKpJoZBxo5L0f3eREwU4i/Y+r6yvjmOoeQlfeCdR8X9QJwIGiRYKQGrJf+nAhr0yz4I@lists.infradead.org X-Gm-Message-State: AOJu0YyS5g3LnW+E+LzKOJUInxW4HjaILgPYhRsMBQgeH5QY6Z3AGQ7A NTSsz4CdzDuh7tz7LbUc321b1ED1OGravFXvndIyuqA5VBvvyk4H6PmUdim13cM= X-Gm-Gg: ASbGncsXnlqlFAaE+KdLXAnpGGR2lb3mSHe7v5CYM4M4ys6rVJf2hfFikFWmafqiEvS hRvaxC1DohtnX/fz4CIfy762ccvJu7v8NMUsI5oRfXs3OLZNjbgD2/nvsrzhoSpT/cEMfPDi7ZP yydW4D/oAO1xycpSeUxg6d82Jh2LH4VvLSR5ZecCxcf7YcIQNtb/BUlNRCAB9gOQUJWpfWd8E/A vvb0CerBwrMY38enEsraAzRbkbUs9dZc/5fyAKbWqjEv1LeUpQ0P18kcDx7+o8BQEUXBmjoX2ne zJnRpR7QeFp6LDeaHR/eLw/Q3AezT7H9dA== 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 MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241127_025814_730471_E52491A3 X-CRM114-Status: UNSURE ( 9.39 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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é Draszik --- .../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.yaml 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: 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. @@ -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 @@ -174,12 +186,15 @@ allOf: clocks: minItems: 2 maxItems: 2 + clock-names: items: - const: phy - const: ref + reg: maxItems: 1 + reg-names: maxItems: 1 From patchwork Wed Nov 27 10:58:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13886857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99CA2D609D1 for ; Wed, 27 Nov 2024 11:01:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EX57ICOKMzOs0eby+nVmHR92z2ekmaeMdJuyR8QQpCo=; b=gdrgacFdxkSJ1lVf9yyRzL/CzL Z5TjWmaVoQECFGPDWgDmUeyT1hhDJTMwWhAQQirvuv9SLsorVZDewnd+dKq+RSsrrVPbcOVl73IWX FnU+k7bw+H+/MfdXRlVStvypTx5F923QHZmq7OPqSDkjh6n00mesegw/s+KefTJHREu+Ps1T077b+ KzLFv/25S+KwhMb5LWhY/DJTcW5ahJ054kx0wliPtJF+KEagL/FjWGt62l5VwK5T7YJtax/ctXZvl BQq8EcuWjQV7zwDeTfHXKFzG4P2yYPjbtrZRixPq3HmhpTUEWOwYts6nRVXlJTvVFMOUI1tS+yOBa 0PmZ8iXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFnG-0000000Cvt8-2GGx; Wed, 27 Nov 2024 11:01:14 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkN-0000000CvBe-0TPj for linux-arm-kernel@lists.infradead.org; Wed, 27 Nov 2024 10:58:17 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-53df1e0641fso374565e87.1 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=lists.infradead.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=sq4rbvKR5XtGl/OUuCcj1G761sK4rIQzGLaOrWSA996qGe/OyycWHtTBv6/6K/F2Tt bYAit0XJjZEZHPNdFK026RJ7m5MXR43HjFn8lpKcI81VvyGylkiichuk7ERkIloa/q27 wYgc0j9Qd6hSo6vUE4mbi3FafqeJlccFIDjQ7f4tw+vWOnThSDnkQJB+prtaf08kBxP/ HIj44ato4q9KJw4giJ1rcIb6cWQGQyX+p9UKlBYOr9JgqwVrF+Au7xbg6CfATiW/IT/W e5RY7xn3PfPNmHAbkC3WO7lNhsCRP9d3Rp+i834ppZ5mPQdvkus5yu+VkGDSnYGs1wqf 6sGA== 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=Pgm+wuyPYHgRlfwZMd9uHOOuyR32XfS93R0tU0tK99bVvP9MCHWRY22wMXipxxC8Dh 3KLIlznXDmdxIei9ZVwdiXHjzI/UnU+qQyqi72h70edengkygeuHKABWRQSa9defSb32 VitwhBZtTxwhznfsepCu3KQRGJMHJ+NmYFpL15kMNr/8kznuJQLVu0gDGoQ8pFISjeDW V5RLPwBlDibvKgH7G53uGXGnqvSRrDBJs/OsquP7fPAaH5twiLE3I2KujOa812YiWf+k ADMWqoEr9QWSITH+6D/LWwJJ4cTE0l4DaBEcjSJqSg4EphODw6RhJ5dB6qqf2RSz/T1H PDOA== X-Forwarded-Encrypted: i=1; AJvYcCUejpupdK6SqOYszhKCfjYz5LbF1eYXLupWVm3Lz+NGsnYdN4kMTvhQAmhkZJYfOnpcH4K9XBTKK2v0B18VkYVF@lists.infradead.org X-Gm-Message-State: AOJu0YzhQuZpOf326EqIRhAtZf97sEFuOn2mfWPN7beyNql51oNONNYH RJns8jmIM3D4iNSPT5q7Vt6kZ4Qp4fa4T2jU7+SXAvqjNDmo94Jr1zUbpLuGZzQ= X-Gm-Gg: ASbGnctpwM0PfJzx5BIpCNh5Kl1aDQdSLxlQZ5k6TaQYzTG0woBfqg/q++Y19wkws+A T8fuEX7S8vm4HgQ9wCI4N1rpSmwFpI31c7z+ieR7/WxlOGNIA5XFmCW1FFZf8XD4+vD25MlkIjn 8zViWHbQBnzctG0lQkwVADZ18UcK8058hJvJ7Zb+O6RfsbV+nC37Fdc8Oez8PUO06UFk6KJ9doW qZFR6UhbK/OnFqfpgW7mCnmCQXhCMjn3zxdQOvl325fRgHuyj/UKKHfWvg6j0CGO6siHlm2wUbN EzmS7ounW48JmSTXcJckThq1biimZw66tQ== 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 MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241127_025815_147930_A7ED62E5 X-CRM114-Status: UNSURE ( 9.57 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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é Draszik --- 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.yaml 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 + orientation-switch: + $ref: /schemas/usb/usb-switch.yaml#/properties/orientation-switch + port: $ref: /schemas/graph.yaml#/properties/port description: From patchwork Wed Nov 27 10:58:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13886856 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 74A5FD609D2 for ; Wed, 27 Nov 2024 11:00:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3jtF9ci8OPnOP4Hi31zRxsQ8dcNSQiS08yT+hSgOwYg=; b=PaKbTvWteh9+BRU5gXZEVVpTlt B2nN/fiv2GxBws0ZtV5TpxcNwbmWyG8+lfJrkAJVgA1YmEo4YOP7TmsTZlGUKKzBXu2mN9h6qwRB4 5GWomAbpZw7PkkqHLr64+16dzabSO6M/I2yP+X29PXELMwZsMoqPhM2o9KJAtyyPLjsePgm+ywwr8 p0p2xo+PZcJKt22ZPEpj+DDX/1AHDOTwfHRp/jhfqrap6K3geNz5qFVzyQi9lcK93C8j/uRjI+dxn rEOSJGeupNycyMlTenrMM70gU0ggUweeyyf2XaxjVWDlDqg5DeTEhDEVK0Kq51erPDXkGiGTn0t9q vZrPCJqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFmJ-0000000Cvfz-2X5k; Wed, 27 Nov 2024 11:00:15 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkN-0000000CvBh-02Bu for linux-arm-kernel@lists.infradead.org; Wed, 27 Nov 2024 10:58:16 +0000 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a9aa8895facso1033599366b.2 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=1732705094; x=1733309894; darn=lists.infradead.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=hnFB+MNJ7DWuy+A4Ou0EgDhb6Dj70Jl0yFPve73Jxj4j4y0jhvkgZ3J3ac5nAPfJkW h238W8WFUdY01a0qfQuDkyEiodAEqrEczw327R3pWjnx/hZLroupJWN6b/l/ZQUnVy+I wbI/VUuhrS/KGY/En+G792OatlsqVRMFgrFlMoy5s5GCn5Z3avdOV76k2cejL5174o5t K75P6Qv6nBoNGDqTUvNTnRjZ/UzxSETfrmJgpxTonMQuRJa8C0YcbuFu56ScTuAvGS5A Pj/KvGX18XdejBXYoJPRTFTAfH3EBv4PzWiB6jsPFcDllaM3DBUQ2xkBVBR2GlqMG+jH 4XOA== 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=P493unkHI62Ma9HLlYQyJ28nndHlhhKOrAt6hkvUKsBiMRrxC93TmiJzINVfyTblq3 Sfn55KWIcmG+iauyrtaU3l4AeL4J4tK6IXa7LM/AQrfEe1jJhqxL31gAXG4WVNb1jrIz CqhoNPn8SqsHhknAuFjBuR2ladK+f2QkVbDLqAClFs+66GTG4cbHCeNEf4LpCBWEqC3T OEIU+1TUJm4nVRIb2LciEoWBySQzzX9UEoht9ej/eUc2ZLSByL8n7WafAVQ2i/RAJGI1 qKVTDoes4bdPK3gDGZGDX0G4IvpKMMl6SssLioNeiVShC4x3YgsYlcRpaVxJRbR2ctci lIKQ== X-Forwarded-Encrypted: i=1; AJvYcCUbS7QBzoUnAPT4/OS4zNwD8lPImr8V7MtwEYNTN+Ag4y2i5Ldyn3Kgm6fX5zqxnwtUFUG1PHTSov/BS8DNQPkc@lists.infradead.org X-Gm-Message-State: AOJu0YxSzQwfrE+a1oFAqbA2HUcMkKTTlgPJ6IBqzFWCq9+8FnxVcG2n G6YxKGYztRc68OoHAnytF3RdHJ8u/SFxxqWjoKktMCSZkal6o5vK+P1kWexD9c4= X-Gm-Gg: ASbGnctGk09IDy7m9vwlyx/dWbCBL4zr1uPRXicMB+p0CQ93Iw1GEXhCz7fzRs86dxn gJeWIGHB6DvxEOQ7JpAq0IKujeObJMBqYq/BvUoQ3gKA1t2w5BSeTDJPNKWTLEQueO/XwIId6TV t7rdyGiJs9Fn84GZY5OqGPo4XzRIDTnGWKmTkRdquhnsQZskNMbs+QuGp2vzSF68CgE3viUZzMy Jm0/KF8sJ/uJsH2weZqv8TJhu6WGCc3NqUsWtOt5VTFD02G7M4Jb9EFGmbxsYFqN6h4DJNq9lAt qoKvlwDcCvUIm4CFIz2mMao7pA+Dfe9sKw== 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 MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241127_025815_052598_159E67D7 X-CRM114-Status: GOOD ( 10.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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é Draszik --- 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.yaml 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: required: - reg-names + - orientation-switch + - port - pll-supply - dvdd-usb20-supply - vddh-usb20-supply From patchwork Wed Nov 27 10:58:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13886858 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 345B7D609D1 for ; Wed, 27 Nov 2024 11:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/xK1rXO8tid7sxZflvw8Sl0BR2j7teaHPSp5KtJr+3E=; b=sELHHAeWdPfFuzeppAgIruqTJT 7/qLn1+DMMRBNA/9Ug+kCvB6F4zMrnQkRGj+4kDSdAWjv1vjHF0Xuh1u7A/aMq5C+S39I3pxmxFz0 W3xw8B0kPX1s8pLxTK9aD3pd7vNuSJsr2cFIPBDWO/eq3iFlVbxH2R/Ui3863hXj5T0MY/5BEq568 PelrcWSxD7Mb09YWuWmmY3bqM+tU75eX6ATGghAQvFGz7HaEwvEN61BNkOvIVs4pvdpA8mVDnCuEz GfYhk5AHOaOh4Hr7iSbHGG+P2KtV9CObB7QfdxZPMZZiAMZYWZt51RlwYBDZP/Yp6YM/yPIh18tH8 1U0S5aog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFp9-0000000CwL7-1lOR; Wed, 27 Nov 2024 11:03:11 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkO-0000000CvCX-02AG for linux-arm-kernel@lists.infradead.org; Wed, 27 Nov 2024 10:58:18 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-aa52a5641f8so656877666b.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=lists.infradead.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=MdA9Qf0vLqkvbCo2x+avZcoUtsEA+Sc1PaNAFfzAVeOqJ6c2Jr09j22BY3xijthUVL RhCYqVvIudEO7MPClgiABCcVwv8c3+c440PuG4dnC3ujKztpNg6g1YsAm2wjXQ3mfgWA RbazqN9p0KNkLEo6S47pdQfCFq/wnijIpb765xabi/QU6IPjBy0hJegss4a3Rn6+24b4 g5Ex4/mN2cTma0kITdL4RlKG0HfLAXg6PD0agVdpqWFHhZ97DgX3NQ9Kuq40tejPzIAI 4A4fsq1Xv6OHq3mKU+C3HO84z2Usue+Zo2r10C4QCuNmxpXsn4f22VYXEA6iYKwgvHW7 4FuQ== 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=e04iYqdNABMSnBnQrU7WxHOlVCkXxGT/58mRZRHHNt4pjEF/x2zqvunZ+yWEYZ1pTX rYgvjWmtT1cficNkJYSnMWoddWZKQ+//cUkxhakd7uV3EuEPqY2G97Jyxan7QrdWh1l/ JrrKnW/S8OBFmuWiuocQw1GQEh/RdgrH9WJ3xaDfhm+yhw5WPdsEwvJJhfM04pljmLTg HiuwZByrL3UU6NGuswbkF0qSDDOCG/KFPTXtA8ZkQAHPre33pkzPr30pDb3eBnASmc2Q Pvfjn9LsZYVVvQttEXihneAuqo9db7oP/BzB1As/wAnotVP/hM7uHozBKbF9LcmoQcdz LVNA== X-Forwarded-Encrypted: i=1; AJvYcCVthiGiny0r171m4fU1nttpzgweFjUd0e7L2WiV1CYfzopa3iASKyqdv5BG8H32t/vO/ASie0etrd8VqEPsthKJ@lists.infradead.org X-Gm-Message-State: AOJu0Ywid/Ek4vwr3otrYMfno++XiXDmF2BE9GSFFB/1QCmIVG9WlM9M X6Ej/bZZV4CPUdKCrclnxayZXDznZBHtFiHK+dGTRRhMUFyKi/5snmJ2sm+B7Is= X-Gm-Gg: ASbGncuDh2To6BA0I1mIg3tL1/hU6f49Uvv2pTFBMPJDbAigkljSsSX70joRf2MePAQ tlZjnVRH5s2VjG1ufh1SUVTOh2RMhUUdNzua5zamo4Y4WAVi6PyovIxUDlXuBa1epkCfQy8Vee/ ECzZiVcW9IeT0VLx4+KGyrZ6Es8C4Q+aQ+JF3OFCkK83gxASL8PbKqJnzzrORom6b8K5pvG9JLM AYvuwqo1qD+U8Jh3I2VR2XBIdvxkdaey+xTdCxq/H3sRiv2ZzCn4U5FwIZFGZcqrOqZd1HqFXPR VzU5SDFRD5I9s2X3W5QcHkIonHY+6nl2vA== 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 MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241127_025816_068479_AEF82871 X-CRM114-Status: GOOD ( 12.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org dev_err_probe() exists to simplify code. Signed-off-by: André Draszik --- 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) reg_pmu = 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"); /* * 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 = 0; i < EXYNOS5_DRDPHYS_NUM; i++) { struct phy *phy = devm_phy_create(dev, NULL, drv_data->phy_ops); - 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"); phy_drd->phys[i].phy = phy; phy_drd->phys[i].index = i; @@ -1786,10 +1784,9 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev) phy_provider = 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"); return 0; } From patchwork Wed Nov 27 10:58:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13886878 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2DD24D609D2 for ; Wed, 27 Nov 2024 11:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/Ela2PSfA/tyEVDL+lOFVH15DKBPE6OrGnsuqeliWc0=; b=cBdq/wr+9raGYWaBh+BSM7LGY1 tPX3fOOU7Uv4UsLHd8Ke+ol3BmIW8o8SVc7oWyyrbM+Wqut1/uucJL/NumKnGZ/Yqa7cakgFMMehk 7LLaBOwWryxYYQ3Ihck9OCXvRlYPIElirrom2t3GXYd9D58YVQcTTv6U8hEwM2Nq/gs6Zmn3RWX7S RKqA65GTyR1yJVDpUS4EyrB/ZKJ6pWUHOLGJmCNEML6nXhlaQ54SGYilPdpja1TCJk34hv6R244CG ihWWdGHYMwHiAQ0LW7735G3+YkoBnezOHBba9fFpLg2j+yugE3fsWWNgAOMi4+FcJcH7fQZxxPrk8 iIgb03fA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFr2-0000000CwlI-0pwZ; Wed, 27 Nov 2024 11:05:08 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkO-0000000CvDK-1mEs for linux-arm-kernel@lists.infradead.org; Wed, 27 Nov 2024 10:58:19 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-aa53a971480so526246766b.1 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=1732705095; x=1733309895; darn=lists.infradead.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=ujd81bL6JTdy5OWn1xpJ5FiLkKLhUOcz/rTp8ZzsGC3MRdqJMb2Q4VA6hX8+zG+aG7 p60zv7lfvtM6s2rvjyH8vsHMsJN73S2O0uijIvhGWx4W+G7JBu72u6XLoVS7oUzh+4It vvLuccdaMvEkgTcsDaQijEDyPv8ttDucnxOXbjtGvsDmhQDMAGCga2b2QveMgLp8M01k 98DjN//RheNolSYp8p4J5RhN1Ld12F4o921h1HBLUdwC9KWsa6GqigE5OIafbk0eclJc fDSmaHT0vqd8At+DONwgC2uuc6YxB732BMSdDwsGUiEUE6j0+g8p7C/LEqZhZ97eRSZJ VPlQ== 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=sb5rqpz1jcYo5izn7gXmbMnKO1KLatEaFCf54BsDEk1J8pZdLCWmIVxUSCT9u7Nvqr jnrlqyHZO4BPd+zv6Lp26qebZYhcuSZyS73KhVKboW0Gan+ZF4zPMl8zW8iIuYV6QVEd U2qkRJBwkw9XCcJgiyjvmnf08nJMfVyt7m5YRXPGJoifgtq5MtDH6CzMdYOIwIsWdNZZ rMvw4UgG52yfK5Nxa/VxRrn4zixoRkAaQ91K3jxb4KkBXcgTGGvxUhpyabDQq9DleXRo GsdNbXmmmrtE+QytTj+1zTT4Q8DUCSWF/7KNWGbYQpvaHnY+h9pJ02DjNPCDC7C2n0+U B34w== X-Forwarded-Encrypted: i=1; AJvYcCVrkucVBgT3pVOxCGbrmtlKGK4R1Jbxm0+7qZFVUbnZlassLw8yhKHeTIOJzUpVoeP2VypZm7qAWj/11lLQPb9f@lists.infradead.org X-Gm-Message-State: AOJu0YzKcsfd/1W2elkt6cGHg9ysnFj0IjzERNG6d6LnOQYSRDXuKwRI EO2cslpdfz1BDkbgL7CZMJTSIh9ZUinwa+Wabrm1R2/bN+vWF7GyewhJtreLjXY= X-Gm-Gg: ASbGnctJ0ztKMYLg4oML9zU2SK+KT8Hb0XYtjhTvoPjroPQIukbp6jUMM7OI368zSMg CogHc/V9X4Y/r3zy0ra2wVEIJEB9o0IF3uIfrO1pYSmS6hTVlKoMEs/J/1/J+kPv5MqTD5JOB6h RxmOJbXcWuoQGFhpaLW/JXtv7UPmGFJ2Eq+hPL/UQADU0hPlB+RoOmDJjVGdwT9rEbbl7xUa8bl VUCzpds7F+glrafrBY89mq+IqXRFtH0j5zibEZ2hLEpJ17FSk1OTUAX2YL4k2blLXzmNpmGWUPg qWu44Kb5QZzJDXxx8LzbrFQG0oxniGdAyA== 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) MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241127_025816_453969_92E6775F X-CRM114-Status: GOOD ( 14.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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é Draszik --- 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[] = { 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), From patchwork Wed Nov 27 10:58:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13886877 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E0CAD609D3 for ; Wed, 27 Nov 2024 11:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=w9Ja8bSv98C0dnIrT5U7vJcSaQnvSrF1zZ95Z+KMMq8=; b=TE4/KXVW6D8vzMCi7vWL9ve2ZW q/cbzbciQ1vL4JBieOkEn22fXGWSCVnXIviRsaKvl0VICveOHZytsqLhOqXJBQUbx76WwLnLwaup2 RuXgD9bSOlA75iRhDFhpRiPo0Zxa5Ds+E7NmaNuAhzWKcOczKCXQTfyCrNhsDQ6VYXXaywSFdAE63 FzrajsUDlP4zJ26gfr9GOSKM00SqY8XNv1GvEKO+oLReY67D0Ikf81Yl1uYPMu7M3/YOePxR31cW5 r3SehsDv5MORR8i2Kz7vpgmUHD/heEVf3ZbRFkwy8b9perqH+ZruAoHb4IIUhK0MQ9p8aH0vPlHnP s6c77frg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFq5-0000000CwX2-2TpL; Wed, 27 Nov 2024 11:04:09 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkP-0000000CvDU-0PGi for linux-arm-kernel@lists.infradead.org; Wed, 27 Nov 2024 10:58:19 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2ffc3f2b3a9so49035711fa.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=lists.infradead.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=wJrNH2beePNe9xuOvn+xw0DQKjo4YW6P/FcxgYmjjPatp/8bEa9g5JA4wHPa3kUl6S hDCrEmBXS/DTdF5RYaIIU9ti8NFLeSuVW1ggiujU6CYPAgHrZpkuT4aFDP1nlinyNilj 0rpKn3mh2dR7H5jCeKBLVooz96eNPN/w2vgdCoL2mQiscH1CHkWE+erejHcH++ekyFML /GCB4cgKfucF+GjOYebp55BDMVs8fZQUBf1PAtvPUW0UpwRBngjDIdaYRXVc54X0Qg3I KTReQEAU9qkEtQCEm2lXzlIAeybCamd1XCXWHT8e4NHArkabEC+b3kJXccmw2ysEInDR brAQ== 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=hjONQ2LG6XTwZPfkOleMCNBLU+hXTRgZE055UpoUy7dRbr5RSSbcTivQ8bhunH5/hu 9VEL2nRU/5YFPwe0cjiRArZUIFxcZmhpW0Q3Yll8PKwYEwbAfvDek7jK2C0NwGz+jdjC x8VFFJb+OY/pqO6q4CSise6Y8f1bVAuTm04qEVEPR5RsEpdBTf01xQoRvJNwKvbtH3Rx 65I/OVdPjitGLoo+SnFHs3cIjONVuvv+k0jlN3Yb/1iUER5WlF3uDHheOYOg7pV5Hy0m dA5WFZPORO1AKKY6zBH6WJvM0IfOwCQgmOWzTq38+jm7g1dwgAmYf49yJpjrXk+rbCFF iOlA== X-Forwarded-Encrypted: i=1; AJvYcCXTq88BPhcHd+dpl1bZyOB9uw6okkJ0zPpz35Re/s2emSWwStABIFkbE8hJzTOn2qj75UVsWNiN1P6L9a1/D2T4@lists.infradead.org X-Gm-Message-State: AOJu0Yw9FaqHZSToLY41Z8ZRSUeuWjuxY1KTZL8VCw0Bys3DcUV37on5 VVoFxcOOcKs4EzOdxH/vlF3IIUgwgFXmYQC03rfMPWU2btRyXlWnCLyXNT3VK44= X-Gm-Gg: ASbGnct1TFRtSFJyP52iA+2Yn2W6oFvItg0Qdcm0ahcwBV7Y37xezsX0zfz/F00mfiy /gfbodYZIBB1+Z8SOO+TCsbDrtkGqVSWsJcAuOeIj8wV8w7AjcpeMDcaHJRh/bIaz+lG9ZE4AV8 mG7ULcghWN8iJgGtLS4gVP7rgWuV8WAIFheaJPtdZvnJv3KDpXAR0INfHeFy76e8RJI0jw9154d S8yjegLTCfd9s8CWfLilrgq5cnmYLYEG1E1jcTXQvuPbiWSapEfpdq3KQf9COgVblOtFhBrqxFv aaB3WV/Ef/Qtemanpq35BGVLnqngET9ysg== 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() MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241127_025817_166440_D45DB61E X-CRM114-Status: GOOD ( 12.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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é Draszik --- 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 = to_usbdrd_phy(inst); int ret; + if (inst->phy_cfg->id == EXYNOS5_DRDPHY_UTMI) { + ret = exynos850_usbdrd_phy_exit(phy); + if (ret) + return ret; + } + + exynos5_usbdrd_phy_isol(inst, true); + if (inst->phy_cfg->id != EXYNOS5_DRDPHY_UTMI) return 0; - ret = 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); } From patchwork Wed Nov 27 10:58:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13886879 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09780D609D3 for ; Wed, 27 Nov 2024 11:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AASoBGvbx8nrRldBio8kzQShrHQPCejymiRL3Jm8QQw=; b=D0MDbyBtV+HBDP6MhEqAdYBnfJ 9U3QSnDo4vGrovczRAyty3xm1eXeHd+zoT+L8K6pEvBqMhFCqbzTc21HgmQ8g7VPPAWFJRZbcZ37P GOT59kJ6UUe+tZ3cVOc2wsWSxbRgvqMxEQOEiAngES1wXtqQVvxFElMYrA6Eyrp8tVKx8Pc+rM759 77ZI3kAyjq34mTknT17FN0VknvkIWEUnFHfRvXwkpfqY3cDcurWXtjtJL4bQThs8/8JLI2O4lE6m6 ASUh2BmYzxDGSl9lxSrQzzWadxjvMv42QsFjuXbakO9VwJIRkhw17hbww1XUGSEQEcGeqhIm4zgH4 BUP3zCPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFry-0000000Cwtx-3aE2; Wed, 27 Nov 2024 11:06:06 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkP-0000000CvEI-0IZ5 for linux-arm-kernel@lists.infradead.org; Wed, 27 Nov 2024 10:58:19 +0000 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-aa55da18f89so399637966b.0 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=1732705096; x=1733309896; darn=lists.infradead.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=d8zBBulNs6saf5nas+4ngM9mRv1QeOl3NB/fzk1ackVZUcQR3zBTkZaBFFJ0l3MCa3 wtSE/86KM2Cj0tvHNaxY6i+bplKcXLZqzAlXobT7ICv+9s9GUjzmHz950+XpoFE5KujQ 2OoxGa11pWZoJJIf0s2OQsHI/UcfWqKX8K7U3ie5maIk9DGs21o0L1AodgoEm638yjV+ widnb6Xg7yn0nE7k+CCkGgAXt2LnXoUbmApRi/iSirpxj0mYxCdJ4qzlspvw81pf/GMV wk7/eme2AJIXt6Yu6Ph3c6aW/srmR4Pw99W1O9sMjumD0CoUACTXFWBLQwZHrEOXof4e ABDw== 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=tmCB0YGJXotefnYIENV+3WXDn9t/kzkMQfztZhRRmf/EvJSuZIOadNpelylkoNQA1r yds9LDQaS6L6VfZ5F1MqtSZn+EINe9f91PpB4t5l5e5eIltRWLpE4KszfB+4IFjV38KE gC3mw0ji0gbgQQeQLHuUM22wzGsnFTQxWNl0j+/oBPtaERMMxU3HD27cbHfwi+YANrhR +sGEVUDoLuCGdI/pWvbEd4nLzjex6SIu/cuhIg3fV109QtgmgWNn2PiZTWDWl6o/jPEv Str6tS3PfefQo8Zxy8B8VmHUjRup+gRnMRk0sfb8wMx+4D/MAjRxwfHu4JFmrCNiKMkm EjnA== X-Forwarded-Encrypted: i=1; AJvYcCWe7J7te1FIWnrjCHlZaAa70Ityo6kY+VkfyX9jNQqlT5YwVPb9Cn9TNQ/TGHHaBq7flBoJsq7K9UevVLw/9TOt@lists.infradead.org X-Gm-Message-State: AOJu0YznQnaz/PaYcrMq5bmEqlOOBNUsU9omP8CUOEBVoFy1sIu1Bbol pq9U0vEtSo11JNmN5k6VmrmNTV8MYG8CHP7/qa1nPIsXNf3tMo++pbiE036gGsk= X-Gm-Gg: ASbGncvAbJ9QB32Prpi3YlNWwyNH0YvpsCMfPvZn12xqm6TVB/Qj6wspDoJS+nI/o+W DShPObWJGsoIi9hbPckH5eEJtuIKgA1tejGfjll0kw7POPREjsLHwj5n5csDkqkYprDcG1AO9B3 ZomLn+zUOTwHZo10cxl0NJVwT1k7Mpxuh880cyU2z8JM3NUyaiF9ESoqjFay/q1jOeLrU8yNY+S kZsGqD8EeITblciBqJLbFunYzL1QW/1/qb2eni7fVWNSwSKbmRQ8KgvN2qDSEWl7J4nH0+R5xgi RLjWbXDaErkdfSgTWzIrHMzuGYhZBefrGg== 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 MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241127_025817_156274_3EF1D589 X-CRM114-Status: GOOD ( 23.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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é Draszik --- 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 /* Exynos USB PHY registers */ #define EXYNOS5_FSEL_9MHZ6 0x0 @@ -209,6 +210,10 @@ #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) #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 required) * @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; }; static inline @@ -647,22 +657,38 @@ exynos5_usbdrd_usbdp_g2_v4_pma_lane_mux_sel(struct exynos5_usbdrd_phy *phy_drd) /* lane configuration: USB on all lanes */ reg = readl(regs_base + EXYNOS9_PMA_USBDP_CMN_REG00B8); reg &= ~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 |= FIELD_PREP(CMN_REG00B8_LANE_MUX_SEL_DP, + ((phy_drd->orientation == 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 = readl(regs_base + EXYNOS9_PMA_USBDP_TRSV_REG0413); - reg &= ~TRSV_REG0413_OVRD_LN1_TX_RXD_COMP_EN; - reg &= ~TRSV_REG0413_OVRD_LN1_TX_RXD_EN; + if (phy_drd->orientation == TYPEC_ORIENTATION_NORMAL) { + reg &= ~TRSV_REG0413_OVRD_LN1_TX_RXD_COMP_EN; + reg &= ~TRSV_REG0413_OVRD_LN1_TX_RXD_EN; + } else { + reg |= TRSV_REG0413_OVRD_LN1_TX_RXD_COMP_EN; + reg |= TRSV_REG0413_OVRD_LN1_TX_RXD_EN; + } writel(reg, regs_base + EXYNOS9_PMA_USBDP_TRSV_REG0413); /* lane 3 */ reg = readl(regs_base + EXYNOS9_PMA_USBDP_TRSV_REG0813); - reg |= TRSV_REG0813_OVRD_LN3_TX_RXD_COMP_EN; - reg |= TRSV_REG0813_OVRD_LN3_TX_RXD_EN; + if (phy_drd->orientation == TYPEC_ORIENTATION_NORMAL) { + reg |= TRSV_REG0813_OVRD_LN3_TX_RXD_COMP_EN; + reg |= TRSV_REG0813_OVRD_LN3_TX_RXD_EN; + } else { + reg &= ~TRSV_REG0813_OVRD_LN3_TX_RXD_COMP_EN; + reg &= ~TRSV_REG0813_OVRD_LN3_TX_RXD_EN; + } writel(reg, regs_base + EXYNOS9_PMA_USBDP_TRSV_REG0813); } @@ -700,21 +726,18 @@ exynos5_usbdrd_usbdp_g2_v4_pma_check_cdr_lock(struct exynos5_usbdrd_phy *phy_drd int err; err = readl_poll_timeout( - phy_drd->reg_pma + EXYNOS9_PMA_USBDP_TRSV_REG03C3, - reg, (reg & locked) == 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 = readl_poll_timeout( - phy_drd->reg_pma + EXYNOS9_PMA_USBDP_TRSV_REG07C3, + /* lane depends on cable orientation */ + (phy_drd->reg_pma + + ((phy_drd->orientation == TYPEC_ORIENTATION_NORMAL) + ? EXYNOS9_PMA_USBDP_TRSV_REG03C3 + : EXYNOS9_PMA_USBDP_TRSV_REG07C3)), reg, (reg & locked) == 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 == TYPEC_ORIENTATION_NORMAL) + ? 0 + : 2), reg); } 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; /* 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); clk_bulk_disable_unprepare(phy_drd->drv_data->n_clks, phy_drd->clks); @@ -1203,6 +1227,8 @@ static int exynos850_usbdrd_phy_exit(struct phy *phy) if (ret) return ret; + guard(mutex)(&phy_drd->phy_mutex); + /* Set PHY clock and control HS PHY */ reg = readl(regs_base + EXYNOS850_DRD_UTMI); reg &= ~(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 = drv_data; + ret = devm_mutex_init(dev, &phy_drd->phy_mutex); + if (ret) + return ret; + if (of_property_present(dev->of_node, "reg-names")) { void __iomem *reg; From patchwork Wed Nov 27 10:58:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13886880 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13F31D609D2 for ; Wed, 27 Nov 2024 11:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=d706DhbkVyX7Vrt0xFDuDzjHOlFjZMBwKWZfTRMnyD8=; b=ByDDza8cbmJ3vHSI5tiiKQ3hcA pm1B0aIbbZ6rXiXsIK+R+PLlGvjL0vu1N5Mo97d8hBFRi+G8X2A8sPxbkyZIJKPJtbH8gIWgs6tZX ngDJWAg9oo8nam7ZOVzP0qsXI/ouzzLnN6uDb6fg5ULWPtE8rKFJqloTK21TOuD+RpbH3Nw4d/Bep wWE7w7BkPqcb/iV7QWMnhQQLI25Pid0ElRE/7YiIJkwwAaza1qI7BsfIWJzOAjItVdJ1qwvNVXLXo JCyaEwZUB41PyRbJDuTPwYqFPaKq0GRdl1NfXhupxI1CpteW+RYJL1AwDaNB4OAgHJAflXwNlsKJt uY9CtTfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFsv-0000000Cx26-0BuL; Wed, 27 Nov 2024 11:07:05 +0000 Received: from mail-ed1-f52.google.com ([209.85.208.52]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkQ-0000000CvFd-1YLa for linux-arm-kernel@lists.infradead.org; Wed, 27 Nov 2024 10:58:20 +0000 Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5cfadf851e2so8763383a12.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=lists.infradead.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=X/glmkHQ/1812aI8WCuMd4j9TSpqqcdb1FoetcDB36gDeVUpWtaSPeShKQnMOW4VMK X+3Vw8MqnpYu/9gUNI13DGtyQnemdeFRJAKeeGjrmU9IvKK4DRdOuGAhdOK470ecjpJc OPXjJ1ZwTS43Q8zKHzT79OzjM++xfQLzdQGLyZODalOcSQ2F5MCKid+2x9K4KSD/omRn LNQ349qMzzpaSVcydRsQ4QVZDWowhFQWV6ptXQx10TfzmB93PbrB93amuzTvI6n9GjGn EWy0RT0j+CXeeq9V1on1w3SgDd0rAE6uk42aabWcNcCjQMNxtFGbMgaTgIfyNIC4C5Sd OkgQ== 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=Mm2jC7ez3X9YZjP62uL4su/26un4ba1rms26N++ab0OdU4tumzvDkC8hMpX140jtpA KMfDlz01mjAspDO/u21iuNNFbxY9mkf47w/1UFKCzKKMAHZqaZKF5IvFd5t785ZytoWR l/dIm4KaDDNL7mh/+xE3KjcwjXIxRWGZ+fth/0dtjN9RuEdDFea3hgBVLJkk7W7UpV2j iw36UK3M80WWeTObpCzOKZGRyb9X6EfoYabqjh1Vf7glHvmxbuLp0n7v6qqXbh4EaXwq 7ZFAU9KSdq7cDRzpINmYnKb2nnkGCUVZIUGFgajr9vH91dnnA9KZxX7eAUXZ4G6ugaCn Ocdw== X-Forwarded-Encrypted: i=1; AJvYcCWYsSRIJDn9SL0HyNrrbp/6kkVzSr5x8BToxJCLKzUl1Pvu2gMHKNi6paU8BMk1sK//dqQ5Nrj10bJiN/PCso/6@lists.infradead.org X-Gm-Message-State: AOJu0YxRudpvW9Gvmrv3IQWQSETmyk1+FgBtg3JijCCWDprTR4xnkcyb 8u82urpAYz7jGWvJiGdbc0PkKaIwZm8r0hlPGv/ijUUwdILiK35Kf34uOmbskqU= X-Gm-Gg: ASbGncs+W8UXpOB1vs7tgJojNUchgaU0RUxUBtoB4/vUqv3R1KODJ5w4hPpuEvzQnBw d1Y4ab8AuC7PdPHkyfiFT/W6/Phh028LSj2/0czJ8fheszsNEZNlvJOG4LYAKSFhKVFACiNgq76 pkfu9ydYfBX/JHlAzkKbITj+3s/iZEgmweLqTFGoCYOA+YBKRQYhOin+1rA0DkbExzH3BQBpxvq JDfvMLB8hgI1+UolApo//LULdncxRPlRgR+sgAvGHWJDCxC0y1fzpQPVE4hXHYOOqi+zD970N2R /lI/2TSxdbuqlK0b8M2safKysYfUeKSA5w== 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 MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241127_025818_424392_24EA2B96 X-CRM114-Status: GOOD ( 19.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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é 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=n && 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; + struct typec_switch_dev *sw; enum typec_orientation orientation; }; @@ -1400,6 +1402,60 @@ static int exynos5_usbdrd_phy_clk_handle(struct exynos5_usbdrd_phy *phy_drd) return 0; } +#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 = typec_switch_get_drvdata(sw); + + scoped_guard(mutex, &phy_drd->phy_mutex) + phy_drd->orientation = orientation; + + return 0; +} + +static void exynos5_usbdrd_orien_switch_unregister(void *data) +{ + struct exynos5_usbdrd_phy *phy_drd = data; + + typec_switch_unregister(phy_drd->sw); +} + +static int exynos5_usbdrd_setup_notifiers(struct exynos5_usbdrd_phy *phy_drd) +{ + int ret; + + phy_drd->orientation = (enum typec_orientation)-1; + if (device_property_present(phy_drd->dev, "orientation-switch")) { + struct typec_switch_desc sw_desc = { }; + + sw_desc.drvdata = phy_drd; + sw_desc.fwnode = dev_fwnode(phy_drd->dev); + sw_desc.set = exynos5_usbdrd_orien_sw_set; + + phy_drd->sw = 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 = 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_drd) +{ + return 0; +} +#endif /* CONFIG_TYPEC */ + static const struct exynos5_usbdrd_phy_config phy_cfg_exynos5[] = { { .id = 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"); + ret = exynos5_usbdrd_setup_notifiers(phy_drd); + if (ret) + return ret; + dev_vdbg(dev, "Creating usbdrd_phy phy\n"); for (i = 0; i < EXYNOS5_DRDPHYS_NUM; i++) { From patchwork Wed Nov 27 10:58:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13886881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F100D609D3 for ; Wed, 27 Nov 2024 11:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lqGYeTvXa+CcRrauQewHltxn0fZOtsvS5bEzws0xGp0=; b=j/RTINaidtLMF9ExQVkBsDZTcR br2ShOVFSvTtUenSLdFUftefWyVKDzEhe2Cl7ZwK651v8lge1oBwLSl330KvTXduBqmTDcQkBd3uT vtlq3er5in06OcurQ6QIM6Ce423MRh52LsxRHSP5guxfULOLjOPGJx5KSbdudEGLAIg3V48695E/o H1nYPYavV5Blfg8SWZDHrfuq2QuMAPSiItkKQLWTbXERLMEtIzOLqOP0pmdO11DfuLyGjBFpGV2rz qiKB+W09W2eUsDc6sITrBXy9es+jnDzT8ty+yVFNkmXIAJT4XTpDtJUhBDb7hg1ZtPa1R1kdTtrB3 VYLgztmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFtr-0000000CxEL-3p6Z; Wed, 27 Nov 2024 11:08:03 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkQ-0000000CvFt-1qrH for linux-arm-kernel@lists.infradead.org; Wed, 27 Nov 2024 10:58:20 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5cedf5fe237so7796481a12.3 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=1732705097; x=1733309897; darn=lists.infradead.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=ChwcpSN7ifaKh2FA+c00VUcGJPXF8iUT9hyHdgvMZ11Mmjn6O2lYpneRnIkddcDBlR LMRT1WcDx/Cl7sDuO9dJm2Xgw5g0scwsN+CTW33V9QOJ9LKv+jRPXieE4DBU5NCaWihW FSgCsfH2jx/ubJGwC8b0K3HwciLZc5ao/DYzjZII3KTWA0zgEJXZV1GVPYmjkV+WRHWw 7PgUXL9f4uQPAb3mPBZAX/8FhkvIH9tN40WRfSkfNA1fB9e18XIpsLN2Tq50xWzaYUVi 4Rtou85fXATcK09rCYodi23h/F8A+Bwo9baU++sKB+ONtN+zAux8zV2wto6V/bL+iPxU umHg== 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=tgiBVcyH//m5Ph7D3Gvd2bfQ1IWIiyZNkwRFKjmx0STnTImEe/Dph9hniEE/7DEZKX G/3BTmg0bovF81qhWbf7/ECyyqSplryed/AsnRd5uwVq/6WZJ/24SSp9e5g2vRfeEPEk YQwxPfUsaG+Q7c1W3CWSgyRWDUYOw4yCBBZCZ+qEo9KdLNPzmquxBZLC7j9wXtPsX/gM E/KS/vGfqkWcxyG6eUwJ5AQHk9wnYzhS0/7oejIzAK/1hqlK6/mmMeObJnqzdX4T8ufm vBF4C/vCKG5zTlNwYeq1MFXmuH0wmd/l76xOYlMmCGIWVZPKlc35IL3HnAJxxUMycOyh bLMQ== X-Forwarded-Encrypted: i=1; AJvYcCX7GhS4w+vivwIdQ7CmuJH8vOCqm94zc7uOs5w0aJ7OTbpby/CyX4dSr2tw2MwB7QfTJxcdFxiiaSig4exyVO1N@lists.infradead.org X-Gm-Message-State: AOJu0Yy+qEFND6nSjXNDXrzp/JjaCTEfYXgua2xR+VlLYjnhmGzXdZc4 kSWyQ6mOSnHBxmrwYA+q99wJXjWyIJlfckG2VNrJWM/Q+L/aCF0fELWr0tL+lMA= X-Gm-Gg: ASbGncuen71EGfNptg7Dg5I+Ep2uDZEjCUTFUvfb/95uUtpJV/X/cLAt2c8SUYI1UuF byYZ0H+MpReDF19e8HBib4Sccw86tyZow85KiQMjZV1T7ubt6lRB7hcTSlesetkH/S/yKtOVczH RNBVU60hkbBVbERF9EQBjwdC/X1aAk+TRKUSUIuK1VvyBxi+KWsaX/g85PiMiqo+TK86LOfJUsd Fs4y297IDv55IWdHjIbz6m07RBcmAJsyU9l8CkaWEr8WeQcLI9JRjA4y83AHQ0xerHmB3kMzpqz 6H3/Qrbo0G84A3SkmX3IWX/DXbR7sfPhgA== 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+) MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241127_025818_501911_6435EA55 X-CRM114-Status: GOOD ( 15.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 == 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 == 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é 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 exynos5_usbdrd_phy *phy_drd) reg |= LINKCTRL_BUS_FILTER_BYPASS(0xf); writel(reg, regs_base + EXYNOS850_DRD_LINKCTRL); - reg = readl(regs_base + EXYNOS850_DRD_UTMI); - reg |= UTMI_FORCE_BVALID | UTMI_FORCE_VBUSVALID; - writel(reg, regs_base + EXYNOS850_DRD_UTMI); - - reg = readl(regs_base + EXYNOS850_DRD_HSP); - reg |= HSP_VBUSVLDEXT | HSP_VBUSVLDEXTSEL; - writel(reg, regs_base + EXYNOS850_DRD_HSP); + if (!phy_drd->sw) { + reg = readl(regs_base + EXYNOS850_DRD_UTMI); + reg |= UTMI_FORCE_BVALID | UTMI_FORCE_VBUSVALID; + writel(reg, regs_base + EXYNOS850_DRD_UTMI); + + reg = readl(regs_base + EXYNOS850_DRD_HSP); + reg |= HSP_VBUSVLDEXT | HSP_VBUSVLDEXTSEL; + writel(reg, regs_base + EXYNOS850_DRD_HSP); + } reg = readl(regs_base + EXYNOS850_DRD_SSPPLLCTL); reg &= ~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 = typec_switch_get_drvdata(sw); + int ret; + + if (phy_drd->orientation == orientation) + return 0; + + ret = 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 = phy_drd->reg_phy; + unsigned int reg; + + if (orientation == TYPEC_ORIENTATION_NONE) { + reg = readl(regs_base + EXYNOS850_DRD_UTMI); + reg &= ~(UTMI_FORCE_VBUSVALID | UTMI_FORCE_BVALID); + writel(reg, regs_base + EXYNOS850_DRD_UTMI); + + reg = readl(regs_base + EXYNOS850_DRD_HSP); + reg |= HSP_VBUSVLDEXTSEL; + reg &= ~HSP_VBUSVLDEXT; + writel(reg, regs_base + EXYNOS850_DRD_HSP); + } else { + reg = readl(regs_base + EXYNOS850_DRD_UTMI); + reg |= UTMI_FORCE_VBUSVALID | UTMI_FORCE_BVALID; + writel(reg, regs_base + EXYNOS850_DRD_UTMI); + + reg = readl(regs_base + EXYNOS850_DRD_HSP); + reg |= HSP_VBUSVLDEXTSEL | HSP_VBUSVLDEXT; + writel(reg, regs_base + EXYNOS850_DRD_HSP); + } - scoped_guard(mutex, &phy_drd->phy_mutex) phy_drd->orientation = orientation; + } + + clk_bulk_disable(phy_drd->drv_data->n_clks, phy_drd->clks); return 0; }