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: 13886939 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 07D50D6ACC4 for ; Wed, 27 Nov 2024 12:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=PClyYl7Ika5Ja6zjkXJG4kBEV247fyqNhlsL0vTkfT0=; b=BzVG5SCXYNeHQ3 gOo6Ait8lfKG+ihVnIwgYORKtICkOx2FQUxxe6laUdJKU4CYyeaUzjTDcedtlQvwllwx9pb0zWCuT gNEfYohR8N45TccQ6x7DB4nhKR8UrxL8Qhd45AtzK35DF1/4rOdtVu60zYWIa32fjn0mGzqmEmiX9 8VHYNZNo5vcHt8FakB4S9ZyUvd7TELq1ZAxlnGL0jLIE8ldSSHiupaFedEf91zgjuwqpsF2lud3kX 9O2J5PbB0r4ZoNzBR3I1AqV/WYRpdhgqlvtqWr5+ARkqipbsBVZHVW9MhMLuEC8j2IR5U6yHHXmCO +mjAnyjToLlRIQRvCc9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGGoo-0000000D5g3-02EP; Wed, 27 Nov 2024 12:06:54 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkM-0000000CvBa-22HW for linux-phy@lists.infradead.org; Wed, 27 Nov 2024 10:58:17 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-aa53ebdf3caso621930966b.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=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=m22/tg7vHUN3zkLNFOaI/6I7QUkKBZOPmcUCGC3pGYsTNoeXApcIqem42+MjjuyAdQ kkqJiKCA2jzJWl/JcBA2AWUYObXDDuSP4LuDZZ2WQD+8prpPQ43hMllNtHhfnUtuCf2a vaWjOYjbBP1bGhx7QZwTQ6mXZrSR7bAwZRpeB4ELPE9HqlR+UaLYrQ5NfxeL3RIi5TXa mEpIw/FCC/iIRA5CyNvBYFzXIAoCqRt8vRvpSmi2XIn85AdpQ+Kdbyo2izcmn3qh5z7z TMsJXNJzgwysnt4CLApqjxU7Ys0wuJCg+SgHoxZoNQlcB/vCgQPlAqSnBkMyRh8JvJIp DF9g== X-Forwarded-Encrypted: i=1; AJvYcCWIPkXfKiaj+NGyvfOv5AqtvsL9PoRMX0v7ZuWRKddSFFLlejSA8QWqNbnXYUxJapViblTg/B1eywY=@lists.infradead.org X-Gm-Message-State: AOJu0YwqsoR6K+e+b5Y4/rL9MQwrwDT7D/JaOE0PTRjVxFlyIDyjjbdD J63QXJCqUwlmdzAsk7hkLQ6IT/bsGTHUWEpcrY6q8dCKm4/k7dGdDVbPjYbFCVQ= X-Gm-Gg: ASbGncvUmBABJ/7BXZXO8l0L7eQH+lGLP8fVCWiYJ5kpT/fr3U0uXxRHXe7h9D3N0Sb kgvlCHPuURzhMBMafCdnxuZk0GoWZSrZGRBw3eGFgPM8QcyD1qOsudxc/2HUKVyZcSBUQPEtlqL 5viulhLXmZfh78XeCLF87DguBBpgaFC/QTNKOjtIIAeyOm5PmHVJuXrWEESqfJy3gLBSCxxV5zJ s00yjuRFwagcruWrtA1wKf7ZK5aZByESU0M3WWXpB47Z/B1NvtEtZ0dEEfPrf8z68lDgZS+Yv4T pn8duQybRZo6ny1h4kYfLes0/SCF8GFuSA== 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_521014_570BABED X-CRM114-Status: UNSURE ( 7.87 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 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.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: 13886852 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 5835ED609D2 for ; Wed, 27 Nov 2024 11:00:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=fcSsrMuW5QrDIAi0BaLQTH7GtZzYtr3oNumUg++mE+w=; b=1+DfjNYTVo30G3 H+0OuJh/+LcUH8mNqd8KZio+aiMKN296Ze9uGQ2tnEWq0tnjcaKWEQtZ8wsdmhIaOpb2O6LifnXQG NL206lI7/7OM2TuQyKF8cCoR57Ugh/tomrdBz3bbj0WA49q1TtzulCF02jP65UhezkRjD2y8tICnA XejDuvWjPKftp90evqh5a/qV9IUsVjabh8jzLbY0N+HhysGNo0RQtF/+c5KOip+ZMaN1nkQHqKhFM 0FU1TLQKJowMh1BFAGlDnMtRCykokVV2Y2sQ6jVHB7GMbuBmL8ApetaXltEV13P5nGjbD3EJdyraf uCulSQ+HsOIgQ/20VT/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFmK-0000000Cvg7-0PCE; Wed, 27 Nov 2024 11:00:16 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkN-0000000CvBd-0TJt for linux-phy@lists.infradead.org; Wed, 27 Nov 2024 10:58:17 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-53df1e0641fso374564e87.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=KAPcRkmhjm4zxrPLDIMyX0/Mgf0+ek4G2G54Uly6xpgIAaywdmMGyuSSLbggUOKQox AQjYIc9KIiynP5/TWZlsHFIvKf4wJAereQwpoNLRq4P/6MkqRORes+yJvng0guwVif4p sweCg0UP8JI0nyEmUIBhwRZ4CNplS1XzeCFpTj4janNUdmw6oVk9pIpyupDHjO5hIOCn AxE7s4q51arqn2yH4k3KtS9uJ1bcUV/RelXENj/LQU/kMJhV/75YxN3U3UXCgK8LuKXI h2GEYgeC/b//ENZBjkpkkCQd2jVkS0Fqyp/DDCFQjwABWXjvBpBvG+YIEgVmmFtu5uy6 bvLw== X-Forwarded-Encrypted: i=1; AJvYcCUb6pbU6JubsNjeCPa0HAuH/1sWeELlXhRunEJjRcnl0zwZJwh3IJMpzv9MOynUXRoGcL2dqHi7Hh4=@lists.infradead.org X-Gm-Message-State: AOJu0YyRouETJp/Gpc3SBL/tStMo+cWu/aBdmyUrjBfwkfkQgPKw9eaz RbQ+gDFHECZ+1W/7zYAaJ+GcTswjY80kIKUoblbh3sidqBBtENYjAkad8LdLD1Q= X-Gm-Gg: ASbGncu5j4KUSQ6LWdopIG4EagRputGp+mgE26t0rFNqIdUoX3lBOOyLgIEoDXfg0JO fZbYkSoD1eCeTQz7tr/2jOqZOyJh+8lcaYzQ25XLzNWqwpb2+lqs4AL6v+aEEhZ9UvYUx/jFYMu jaCyCIo4XApkzgI939b5bTqpA+wBnJ177j8Z/cM31QgpZzdkNdw119c6DMCwWo4Uzze9Ez4imCj +rL8HFlCSjdzbr84z+/byDB0PDtvVMk/RpiDk9VjUYk6h3UD1ppnjFiWz4BofEUbwNRHWOcVzXG xAE5uK455/bR8zjqtzqQO1bnFn9r++3edg== 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_147452_6CB64E16 X-CRM114-Status: UNSURE ( 8.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 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.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: 13886940 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 0BF99D6ACC5 for ; Wed, 27 Nov 2024 12:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=Za/Il2JvzBnK42z5jkf8rgxuO/NpPHnl5YdvMfo/nKA=; b=i4pQWikksjN6ud qKAP3P/nbJxDlizHyMkDq+fZEJDBFFoJJUe7TLtiZiGzO7Xn+G5MwqNfYC9pqiR/mfWXZG+P+UvvS yjTRqgF1SUU9eHAruVI41s4fSImFRlhzzGSSClQ+1VnSj/GL0YwYBRW7Plp9wICSNP45iwK6E1gr4 Dm3Qq/dECdKqXepu2AshO9lqa6eZj3f1U9MK5+FBSdbfcJSI0P2ksS14mSPQQa/dEucLfzsL7Hx+l +8Esf6xUqLPq7YsqyYM2Niz45Ti7PdLQ7I4agkm+WIODvdwZIsRkKgUeehVzZsAN1IxWRw3tqzyCZ IvSJAAsL9IGhbvG82/PA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGGoo-0000000D5g7-16Jt; Wed, 27 Nov 2024 12:06:54 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkN-0000000CvBg-0rbc for linux-phy@lists.infradead.org; Wed, 27 Nov 2024 10:58:17 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-aa503cced42so807279166b.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=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=AVCHpeFMNxYbZLqWbCj2INKnFFfPPzfTZ4JvUc8/RN+cLFgKKpvehCqSZyFEsVN/b3 0sid9dS3TbF+WfD+kKKOnj5KO6UsFCfEwh5m6uJvo+WnqCpdUuORA4e9BYyHU/qB5/XV 1WMV+SUGdje8Mf2GQ9uC9NT4ZC1h6/oxJd9RWaaQvOipSB2jQ+Y5sq5WJDvxXI6v2tXo +Q9TpCxjd37fPaLK2KYE6eYIVBU244FauIeIT9n8aBMqZxJ8FXK1K0u1DlCvItL5ARSC zX0AdXt6ZEq7YQGmnOy8j8sDxUrhsGvuyjJSIA3hN76NBJ3OfNzukSborGDP2CebRoVg IoFg== X-Forwarded-Encrypted: i=1; AJvYcCXTNB2MCvCh/1aLRub/lVaOIuqHeHWQXBDlSkyF1mcNIpPFwcXc2TPaBushT32Zhjtx8bZ8lRZ9gsw=@lists.infradead.org X-Gm-Message-State: AOJu0Ywp2w8mR6NvKOgOWqo0QPPWLTD5KDL1kmBqQupre7YuRaro4qcD wgbeGB1rqZB0okdzxN/ZGPBQSQAI0PMH6e4Rzw/ZqP2uHgt25blsvmzGoT/++VA= X-Gm-Gg: ASbGncvC87gyZfYOntLsdzynv2kgg2Uw7OvH10P0IWqAGdkfnr8IuTHkrVrVf5B6biq CjvAWEARD8iCdg8tDAzLmdtIrhM8Zgejm3ZoF7SijNBncwj1Wo0UNs7hpJDgibiqrStnnSAP3uN u3AyjaSbFSV/H3vShhGunqmO0LhY01gPlNtxDm44nDcmzKHQxfzTRCmBGurtHBVh2e2/9UMrEgP fHrz82u3dCVVL8nLzYj2GvlkxnmugfAFjDUVuQqlyacOlyYBaL3fVDBBaemib9fwtKVcxcrxbvx S33In2sbZEm3eajk/C9WfjHq2wE9kUHguA== 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_234133_890D5E5F X-CRM114-Status: UNSURE ( 8.68 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 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.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: 13886938 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 E82ABD6ACC0 for ; Wed, 27 Nov 2024 12:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=e2TsdwSYUGMRgxbbZJWQjHaJYtxux7k9zpkCiH3TMjU=; b=yupZUncfHBN/dz vMZkd8iDnMJqqqF6ob+tIAGY+EGH0JvUxzOlR24y7AdQP4HA4KXddnMK6SH7AS29LwrdnfRktjREC 2znRRdnlG7yWn1jjNDKAkvQDk1psM6CdCaq7LFxzCloATkOqfao784ou+feDD+HF2GyRkWB7s7Bvj CQIHahjptPTUN6/f1+/tGuybXCtTKz2uSU+AVqcaR7BAexCA+wnkVHEbD7ZajrTB6GGJ2bYI0RZ5C o+o7McBV+qE0Sy+5drvrgeaeg8NtglAUkQSsX121tcBFj6CCkQAK6EyR1JvgMlXg5rtEUXThDbMBJ 8s9mCicF4oUIc+SQZfOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGGoo-0000000D5gJ-2IdQ; Wed, 27 Nov 2024 12:06:54 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkO-0000000CvCW-01F9 for linux-phy@lists.infradead.org; Wed, 27 Nov 2024 10:58:18 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-aa5325af6a0so602971666b.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=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=QwbjsM8IXMxgWNFl5jj8ZsWRd0AxAg+Upt3HOkhiOfVedye9ZgAYpnqZcX8Up715cS wM7MtmIYBtdFuD4SSjOzPSGkiifsYAmUxrrk/7vRuys86I3EeI7SARGyIM8XrOHliLgy mD1Pbmh6UMlkJcTooKyh9NynTAPRDh5W6usTf+8b8Jt6zDWUiUX7FYZp61OmygVp9O51 8seqzUvlgMS6/GFt0R90UcsGvI4bUcgY1kRvv8XOh+uPSTz924UyCezrgcaGo2CSk6Wp Vm48ZcSYkI3xiHEbJT7QrJsvGlnBXGgCe4u3HCorTjxqWdrIqchxEiwuOVN1hL6awvvL dEPg== X-Forwarded-Encrypted: i=1; AJvYcCUFXnPKxdT4L2uV0XSLNnG7TvGc7HWDt6gAY1LV8M1wMDZQ63q3WSYpnuUrFDJvaqrl9M+NLpzGTmY=@lists.infradead.org X-Gm-Message-State: AOJu0YxvHVUR+R2ZcdPTy35t5LWYbMgrqX1oFe3U7iopyJ+qF6YDi+J+ f4pmRuRpnUQtcmzQTTrEpRhsOa+nsUfwNcScbPA+KJm7C9RFcUNbNtGV91ztVw4= X-Gm-Gg: ASbGnct3qMyeYvf47Pr0npkyxjrYCdYs2lzyeTQK66/C57alMTMlFioxA611CTTjfii FjfIYgLnkeIwXUHS4Y4mLMITcgCgWiiwSPOOoTiBLE2po9gL3g4JikO4N1MgwsQG/Gm/tjSnoQo pion6+YndgnBG7McA/lYND9u3F92blOnBXM9kSe9dkofEBC9rF1EM878HFv3xCzw2BNbAR+W0QW +pmN3r5kEcGH1ljtVRpr1a+0Z+nmiGBfJVlKORXFEnH+B/BqaLLiet0KiZ50sL8xM88e/ES4pdm D3pDznxO2OnunSbxV+i+jqmCrvt9OpJrlg== 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_062732_E7D23D91 X-CRM114-Status: GOOD ( 10.64 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org dev_err_probe() exists to simplify code. Signed-off-by: André 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) 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: 13886853 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 3D19FD609D1 for ; Wed, 27 Nov 2024 11:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=3C3sMPrYR6ZzHIEk+nVgeCHSf0Vye1hpO5m5cm4VmUY=; b=au/KAsS3wFgRD/ fbn6v/Y2m8hoIQxYmdkWDIzLT4wTrn0kGYuDrqYIwigmEuQxQeoNjALmk0MGQYWSGXM0BDwu157lv rHhvVK7paPYXTaCotJaT+qyZ0u/V1Ki7oSNK1ZxUHYlcOl+yhjOjHW78IZikAxKLYS6JHyRlrqe3J eJXaDkkSMYAP6+inqgXOjKUlpx9w7k/OGa0/F9F1XzTiq5pMVUwrxSg1oDSaNbUf9ReYE600ko2hz 9N3HnCVPdX3CEsGZ3Rn8Bv81kk6SfH2ZuaqYARrZ8fSS+ne2TJISHJ4j6Om3UEDSmuEO08PC3X4Q5 dVsVt1tPQ3tgnLSnI4xQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFp9-0000000CwLP-3w1D; Wed, 27 Nov 2024 11:03:11 +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 1tGFkO-0000000CvDJ-0hBi for linux-phy@lists.infradead.org; Wed, 27 Nov 2024 10:58:18 +0000 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-aa5500f7a75so503734566b.0 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=CCXjR2KuPh0F0QXcLOgZvCoVn/uD0YvsOBOWQP6kUeaxg1/N7nm/uJ6Qa/rJ82jzUU LrBC+Yn3WBGbpwy4UoIHCQEftJNK7InBuue0UqfNnQiHLO9M91Lere0kSlT9eRy5rovg xy8ElHje6XkR6S0S13aseEYNq/yOzVWA8M1leZhVERjZVfDPHEimPMeN7tUwOuTWsz42 V3aTo1in4w3A/Rki91nQ7o9H7JbICTr8FKRuPyZtg/XIZrQz++tre9Z2jWx6hkM2MGKa 1FSqRBzQlMkOfyOg3j6v7TZmQKm+91nWppD+fu4BKOGY12nOzdWTq3wPAdd/IRgOd2E0 clgg== X-Forwarded-Encrypted: i=1; AJvYcCXKo+f3oufFzQD9ILhw7OKcwbSshBzVADysGDZ3BpcfiVkeZX377XX3vJ5/ExSp3gHcgcNkgiFG0cw=@lists.infradead.org X-Gm-Message-State: AOJu0Ywbqf/JHEyQJ4QdflXtrqfCsUxlI/JOLWqIAxDOIxvuP+sQDTjC 6zhlS8SBQCjQWA5UYJL1GwPm9UNxTAuQ3fjTShwjHWvXXiCXpKuJVcVnE5EkutE= X-Gm-Gg: ASbGncv6+HnvS/Yi+v1EBbtuQpUeCs+6bvS1CIWUewrymvczlDu8BzCXVTyzUvMMelZ mQxORmneZar42v9/PUL/OV2kR1qihpmOir9UYMXatedVJcZyidcogUwHUIg56fEBM2CCvOs8gRj gEHmT5ABYn2L0XTTgsnAnfA7PPdjJJAMQnEZqeRb5owsTg/9NDgqezluzg1BbbiUlotaYBQWzKs Km+hdnYm2OiFMmviqDwivWJukdG2GN+bj6wRH4iBf8nX8vz8ZT1HaM1SX38HitM/OWRUwxaDRB7 KnwW5LEYbzPy5SyiZcDbT6WkPr2F5yeh/w== 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_202338_26625363 X-CRM114-Status: GOOD ( 12.97 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 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[] = { 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: 13886854 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 904B1D609D2 for ; Wed, 27 Nov 2024 11:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=ezq+CIUDg6X+4uAlwIW3wQw2NfcntRhpWp3hV9kxEsg=; b=EC2R0dtC9bOkHk OVxenoImzWZdiVD8PFgbMYmY29kfoHFxXKFqnQcLLrfqEBSvprbrGMtR+3tAg5icRCn1Ty+kX3Ixe iwaP2ZtFQJ1gkOANA/LCOghv5eS64RZrVFvmB2A7CpUgkXXsDHHJl/yJJC6OQ3bapcXhH8BivK4ZX bVuLtvIjGxSobZz/Is25ud9FqiZnEo/VwfiUAGy10Q90TCNRaoegr6Kkz8EZ8ZYbKR2EBz7mlWIgw X2qVVKztxa5e1b8q6q8A3BKShkaP4YzWT5UNdMk/GjeRUAOrlovZutA0FlWrsSSDlQWWhPBSoeLCe Wg9dBLmbz75QqXxTmApA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFpA-0000000CwLx-0tDt; Wed, 27 Nov 2024 11:03:12 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkP-0000000CvDT-0Jr4 for linux-phy@lists.infradead.org; Wed, 27 Nov 2024 10:58:19 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2ffc1009a06so50036921fa.2 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=ksvPT85CPrNm5l9stUBhQ3wmwZQ1reSojiWLCAVWiKJJriBBxWLRPHyh+J/t45xnPX WssYFNInN1ckc7cN9YpnmZnUWsnZ5J8JzEstcP+Jx935vToeqQo1ejunCQTwM0Im+vsy XaEs40pnJ9mEmpjS7ce7S9PYR02jdlDEJVHKDscVoH/sHo8EcEqApMZEUI7QWsbdteS+ G9hvRrGd3Zm1qWgXEkkStTIfhV7YII435Rdmkf+OvMrq/llqoof4O+pq16DRv1IuEecj 42lnABm/WcF4/RYQ8oQ2MDtSQR4GeJg4rch3oCikFwtWhOo3B9UT8fJWvNHV7Z9d1lPM pfhg== X-Forwarded-Encrypted: i=1; AJvYcCV83L6aXGiNjf+u/TKSlh4VDqxv+gtr1JpMyeGq1tbL0sNS+58A/C3Kiti1NOUFO/XJobDPNFJLJWg=@lists.infradead.org X-Gm-Message-State: AOJu0YwPNzLNeRABOoCBWX2TiyFmOkHK+jA1PpOTYRxyi6N3D501nxl2 6ft+5ddFvcy/7DZQ4nwjkxVx0W6ADXsJnvIklkxXiVsrXFZtupkq4p+He1rB4O8= X-Gm-Gg: ASbGnctQ/BFWFUgfitbajdTWr+2w4yV0vhe1Qg/j0dZ6DZoC3rQD8O758JwJdx8+euO eaF3lia42ggJTZ8mYRrhFM88uaxr2l2nDqcXrLegDkKGjdNrIW1lN1Ir3VcHD+ZJCAqr0RZ+2v7 u98aHh/A9/nSynOP246uVUo3+4U0/FakMVDgQFiR9Pr3DFjYTnivUcHco/YSlpenvOKTdC6uQqS 6hyICfXIVRUxRqIrPXUCPqMzuYsGKY5zhiqFajG08FNpRUyP/tW4jtmyl6LemfBda+oJCkqM/qc 5dvCgF5vsDIKIjqaDzY6pz7zGce9L9R74w== 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_133442_7C10AACD X-CRM114-Status: GOOD ( 10.70 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 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 = 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: 13886874 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 97258D609D2 for ; Wed, 27 Nov 2024 11:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=4/cpVX9OLXGGz3qNovpXLfnOix+cS0YAzgAdkktJBiQ=; b=NtjpWAp3cz2smh tnPgbANpG8uhJOjLLhOE+CXxPGR6kqQY7qxjbuvcG5MBIg/7q1VqbwhkbIkg3KgzypylFWimQRwjL qv1OnEdRC6co23tpGT1BUQ7gCEYm6A5d6FfL7q9ZHn+p1cXTdW/09IH2lPb8bCTRNxuS4bnIddkXI ys8tAmj/9+AV5w8wPLku4MSuOjx1IHF63YWhCEznW3RIg1kPIp/7brJjDsHC2NrocP/uSRMU4W8xi OoR+owlOpe2R6amqSfTy7UzpCZX+Y9k4tiPg/MIcqsYZ0FcOz/f2W9snxf95Ua/F+VvjFEV0eUVOx DPYa+SjPWl70j+3zXjEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFrz-0000000CwuG-1Vxv; Wed, 27 Nov 2024 11:06:07 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkP-0000000CvEH-16Jo for linux-phy@lists.infradead.org; Wed, 27 Nov 2024 10:58:19 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-aa55da18f89so399638166b.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=U4N2XAErersodGZ3dcSeWjIUVzEbSqwrMVJulZy5r+pQU0eXKsI0Fwm8UOVE5EylFo tFdNqVH0gSRTF/OFKrj1b5dX/rT6BswvaDDG4N1SAFbjhZbA1xz2aIVZMV6rXNXuEhLq zFyMOMgELg1Z7gCTB4B4Zarv7yXeKknfprGqIsHiMxFL5DgYcE+3xGckMnh7YLP7001S 162Q0cxWcMo1F5TNCN25neXUSodXAjqrFMu/2G+KYEiGVXYLXxgmeAKFW5q/8BnuEQXT p4PUX3Qc8HxsVw8S0B3SUBfv5Kyiw8pKNDaBfQYYbDvFBGovYpx64eN16dAk39foOgzA vdQw== X-Forwarded-Encrypted: i=1; AJvYcCUpKUuYGvMkKPeo2ikvDjLQGBxjY4pJeH+DkULotm9vuR/se/GntXktiMz+Sws4mBv7hRWtg1G9n1Y=@lists.infradead.org X-Gm-Message-State: AOJu0YwmpFI19d1JPq9KlYS8U6Zei8dIQSBPiPXhsyQFP02Jmum18zfZ 0ZtUAP2bnlDeg89EzqODSDrTYiTCZvkb7wp0CXOE0amXeIb/xs9dcVcwYTGKrmw= X-Gm-Gg: ASbGncuVkkNkJPTRcEgJGGBRIUeiuUeUOCVx6MorCoNQ8ZxOmQ7uAmZHSfwlLIqffRL MIIJwTGpRAkpRoBJKlnf/ug87TiPLUSXiFrVJtmqYZ7WtOgXBcq/nDuTx6qg6mOQbZfCTUUqpai +tYaRAQpNWZKXreCjHnG1Aqog9p5g6lF6LgLqOYyxbrL+ilu0W7cw31Ldb1tBvqlqDHtSd06kE0 Nn+1Jhsjoecwlr4np8CWpVtqJpWWHzWFNsyaOKbRCrO1r74SUoDprzcG7PIh5b+WmtmixdCpscO oWiVwzhraeDWMDNl0YtgbzW4jAQ3sZrnzw== 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_307633_E93303DD X-CRM114-Status: GOOD ( 21.70 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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 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 /* 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: 13886875 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 C4834D609D3 for ; Wed, 27 Nov 2024 11:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=XrI7xTwWqclxDBuo9rfVxpDkHXazxGZX470Zmy4oIdo=; b=isyAUNo1E5a72U 2Kd0yCHOAyV8SalgeqK1coh9T+A3n1+EJtDJ/pIc+//IsmkovksCaiE8nzF0HEWsuaDomOod9NEFR vYhq5+UZ5wlinrux4HFwxt4B3o9eha75e4WmpFf4+NSwXQAtkSEO/KgcUztOuIPjg7Xb/dTsz29CD OlxK/tesApeXcPJZNcXkoJiA8uWtWRTSwP0SY1UEMs9Y/yuMaadXKR+8bygAEhKQ1uasHO0fod0NO VU/ESCcrgDoqbaCsgX4LEZp/2Jxd3k3lQtnbU4RxAYDuB+QQMPJI6JMzWKhjTvijomXAt2CEP66XX dBLeS5bccOeh/2pXHpRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFsv-0000000Cx2N-2JE8; Wed, 27 Nov 2024 11:07:05 +0000 Received: from mail-ed1-f41.google.com ([209.85.208.41]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkQ-0000000CvFc-1Y4p for linux-phy@lists.infradead.org; Wed, 27 Nov 2024 10:58:20 +0000 Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5ced377447bso8939211a12.1 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=oOsWP8qmGWDtRrRMB4K6eVwZjR5vko6sxS+FlhWysgUxBiJS0SD+ZcaQx+8/pdb7Mo 3/Utl+7DKzJmtvhbse2JRd5hGzsZQx2ZKXntwJTdKkK1M3X3sDDo5aif67IS0PZYEZhU HNOOqY9XtAmm6XtadZgSgplL6ks7sXy/ESbuf/5HDm7mrCa5sMqOsPLWlAxUKkx5Fc0s nLaIfX8op25ZoyE/AHVG1VYer6k0qC22cUxgjobQZuzea0c2TaGajEPottCxoA9hDlSp 2//fY6URYcgPbWHqAjQ2vzUhu6LSjG+kt+J0uq8bzBvT5Liy5H/WumfuYq8RLAGJVm+W H/NA== X-Forwarded-Encrypted: i=1; AJvYcCUjpIdQdu4mx/y15Lfg2w7+B7ryjQLvh0wSHQ5vpt4fOMbDAiQUuIfnGPztPCLxpfBzK5lgy7r1pCw=@lists.infradead.org X-Gm-Message-State: AOJu0YzhTm/rVwHuO/EBHuCenPnHEEDkG/rhtnvveNAiWOE9/iA2/mTm q5cUXuCu4hXkch/J/+X7RJFcHbc4KFYAjhV8SHhTLYG7W3vKYh2WL3CYlNBkims= X-Gm-Gg: ASbGncsLp4T8TtUxxUp74XB5QH1HSGVjilMbkDQyReiZDwy5suJVbUy5zVi1gwDRmVU WjJF2uAztnXYa9hGKl3F/SfmKhcyzBhZVVzTdp1RVq/ZOMDedFUj2rZn+/5sDpxiehWVEjpKNuR s6si/ciaa0y4c5jJyg8nLowH6FxoiLDxI151MqtHvgwtAzZodMos9VWbgPQzyZbxTrNMs21YMTr klvd3mtnfpWOSU/bmJixp201mJpyASotvl4BsF5siE4vLH+eQDAYutK/beSHBPVj0CtSkkwZOHt S3cV0jQmnOQEZSoIH1BP8IhMVxH5oqoPYg== 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_431397_25EA1706 X-CRM114-Status: GOOD ( 18.28 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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: 13886876 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 A4811D609D3 for ; Wed, 27 Nov 2024 11:08:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :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=zPOpc0H/DNkhwh8TknNvQt6wff+iezzx7dt/coeyyRM=; b=kCm5Qg2Ufp+vAG XzkSnso0G08G9QmqIokCHPWMVQJplLRjf868mWlerkAtraZh+EH6SBHMJR3iMSc8EZeimNI61zAvY gDTf2O8f9g5t5tp9p7MiH/Wr3KDdhCEwN9v7ut6hil0GPCQwwekMPbqQrm1aBvpODwVKJYKT7Zwy2 7/w0R/5gDG0iSMYraPn+TN2rFs5RfQa2azbV+R5ItySSjc7tS20hjpEMlAleF+HeWXsPytSeXtyaS DiCHmFDFyXIgQTv1qevE4KfLha88ep7fqH998HVNnr9pa1a39XC3Ryb9EASvEXF6sWam2stACHKgz xUuBXavOWB0jXH/o+vKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tGFts-0000000CxEc-1k6G; Wed, 27 Nov 2024 11:08:04 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkV-0000000CvIl-3Q7L for linux-phy@bombadil.infradead.org; Wed, 27 Nov 2024 10:58:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=lqGYeTvXa+CcRrauQewHltxn0fZOtsvS5bEzws0xGp0=; b=b7bIui/GfYSJZnGypDd9siTuuO tFHfCnWMhr/PvK2qUKW6wiI9NN7fyeusrTndlFUm4cliShNb3Wgd47/YJ/lNLPdv/PtwIaLqOPiF8 uFuORVMEn1sSR9Xe4WHESra4ehQHM39IyVJzixSwSV8N4H2FbJG9ai6Q3/NFwJ9jo43L8n6hRTjzt Q89Cxu13InHrCf8eFHdvIWck0Ykid2KLyicyYgoMNZRKNsHoDbNzUlXo+5/PY4ogNrpThrtvm4UEz hVvKoDNEkR2WTkISAkodATCSCI6f1VedrqHQJjk+MEO4037ixnoKOIrsujomXk27f+Ree8SMozXfy 8zIXWoEw==; Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tGFkS-00000001P1D-2JRq for linux-phy@lists.infradead.org; Wed, 27 Nov 2024 10:58:22 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5cfddb70965so8097286a12.0 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=JW30TKgKtVsQnV3GBId0JL2zW7uyTmlkqM+xdJZWTKSq/xVquIiUw/ly7L1qhU/qz5 3H7ZBvxTC1kdjcgOxdbarv4tLpfxCCkjo95RrQairdez8xqBQ1WhaVXEovY6l/Q95TTo NBGcYotA/UTl5C3gX+ADhecYjbu2X+xNKY/l0Mt5Bbxm+60aAEN7tBAOAo86EWPzLlXr rPCcWd2/tWwNQ9OvzlYK5CT30s/DWCuJIOVw6Sv7Mx/zET0mluaGziYk5RM4J+v4jcBK 5OCdK5Bg46GlxEw7XMaRFDjUXmMZfI5QHWXiPpd4npV8kPeqHmiRPmxs2iYIxMXYH214 2R2Q== X-Forwarded-Encrypted: i=1; AJvYcCX6bSKCWIFivb6m0/X25FZU1wCr+x6fhgqE0IfhwKTZDlNwXmE7gnFGj3urnxS2t9mE8A0AC4Q16VY=@lists.infradead.org X-Gm-Message-State: AOJu0Yzp9aXhkFB7HcHiuc5Yw93LhZovfxTn2zXED8gzknDGSGFTyNJ1 HxjIsGTdcH4BW/va/vXc75gqcPl8baonpa9dAWQ8trD56JAVL7Ec1rF0au2/a7o= X-Gm-Gg: ASbGnctztMTcAAo1BjkLgKyNOLwPvFRz2RsY3lATJSoGImcmr2M/IZXR1faoeExdEgE Tud2h1wUWclrB8crnIqV582J30wtH0kEti9n1c60hHoA+SF+IBfYexNyGTBlKx5oZb7Mt614RbA 4lwspE6SNiDDDl15e45f5Ur65WSfLSrU7hLbclVq/RTjDhMPERucEzvsT1p18dh8tebXRVhGkyn z3+5sop33e9X7JcztipJrUv9RDnwTKZoo/TzU2FPdu/6m+p4L9twbvOsBO1l9rOs4BNe/dxEj4x f+DFsXqxO4XRZv0adZ5IcQk1ITnzlPkgEg== 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_105820_743081_C0D98286 X-CRM114-Status: GOOD ( 14.30 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=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; }