From patchwork Fri Mar 21 13:58:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 14025481 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 6D0EFC36001 for ; Fri, 21 Mar 2025 14:00:45 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BgoWaKG+YadDj9CrjHgtw/aIkjrQ4C+pmVQj9v4Fkg0=; b=OJxpldrAoPW4Er ylChytFde2Iv5jb74KGpSJnsvBhP0cP2IdhHESLdLWvMrI7AH1wKINB4oTvtl+XvmpoTbqy/s7CZW Y8FrFnoYnfW0YlVM18iutoqQPaCmPA45ArkTl6fCJTZn+5T/sPGdRF1DuiovanjnFLNep9na3ZfUn Z3WdUfatQTtN31V2GUDgVwLExfYNr2YoLdDVpgmd2S5X7D9cNux6f5Eo37ES9JRgvv8yaiW3Covtu IlS6N9Bd18i6ZJRVkNHRQE5pG3isGEL0CCXgdl1uMKc9uSDq2dID4YrHXM+65K0Xcqh/5+yMQ5Y3p DFwGJX89WIF5rKbveYfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvcvV-0000000F0ss-0rRN; Fri, 21 Mar 2025 14:00:45 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvctp-0000000F0UQ-0ur3; Fri, 21 Mar 2025 13:59:02 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-39133f709f5so1091056f8f.0; Fri, 21 Mar 2025 06:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742565539; x=1743170339; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bHKxmG8ByngkXQTkMpyDFQIrJdv7U/tLvQeFlUSDHEw=; b=meTjGJgawbi/mOKKgR/8vzmNIdRr4kahbZpH7iVJ8FXD6vz1Py/Sri1BpseJCilRah wmm5XkeBi3h/XVkPzAEiY9YS7eY/rZNqdBdhu1arG4slo3YTgJKWTRtZi9mJy5oFNvbm +G5lQGRFMDwoWaPjmhbNcnDHWU6sQ0U2AF+ierU8qDrPu+watBh7MjHFz71+lHl9/kIj 9Jv2XI1OSNMj3woFYvObVwPgrxuXnTxGjFio1gZ8WBubbZwlPk/ygMWtDI95Xjws4tPK TL+Brp8bgHqiVB8JmZfmlG5BEujn7RsmVCNaSHVwc2OUk4toYUyEvfDmR4N0pkS8Ea4U rc7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742565539; x=1743170339; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bHKxmG8ByngkXQTkMpyDFQIrJdv7U/tLvQeFlUSDHEw=; b=cWdbsWXKMFZZ6VZEGlVN2onPEWD8S4PlfDrVy32lBbq8LplHYTMIEKgoG51QWCxqeL orl7OM+UA+NgjrCe2AksEhAr2kTlpmAPmoTayLDuGXoi4fNPhKvGXrdoWdPUZututwNH fgRvbxZWzuD2Y4A0qhiurg1abwKQuVEMenl/MAT6onT9vjXfNjjg3SiBg8jvit7SrXHk yImAhtdOh7xNDJpiMOGb6v/osQMQ7U9YQPQJeZ4wUU5pdr1hbkIoQpFsSQAy1uGkTTsO m/bHMAgX6gq6UdQncLbQCQpzscsC3m6pClFMpCcQDq66z9I8oslBp+Ek8U5o4tZBR7YH OPtw== X-Forwarded-Encrypted: i=1; AJvYcCWXFvnmY16QHr6DDopD9U+5Y4Hh+ubecvF877DN+HCUw+9VKLj0L38KkG/1uWcvYOn+a3qJZP3P3Luw@lists.infradead.org, AJvYcCXOVHmSW2Isr1bb2MR8fmylB6cgiM8DWjx5tUKACZfaf7aE0e8rAum2r9XLW1zlkl758pG3u6pMXeY49BLJBTMn@lists.infradead.org X-Gm-Message-State: AOJu0Yz6KHbKb6Vvp5lFIoZ3AlaUbmmeOFTsyGHvECPpnXHZyrDlxADE uEveHZ2osemU/DAqJRVDesR5+MJ4MymVHHWcFLT16u9ID0qUJ/pI X-Gm-Gg: ASbGncvSKiWPsI9+8nlEHqRaGm+PRr+r+TlgLOaxbUwzdehFdraCWvUPz+Z0NSGDJ4o yq+PeetBx8He0+4iSFWKsTk5kUL/iCwv2za3QW9BE3wVu60w2CTsZG+QWsL+7aOBOnHFlIoYanA eA3NGkFFVQndnKT8kXj2ni7+DyI2Xuc++0Ws2KYkDEeky2GmM0s5ndUPPGX7m3oq62jREbT9i27 yMuGeGVOTuwZjrcYljiUNBj7THcTX5h+plSGvzK8C8hhhodCDvDUoWbsHX1MnIV6zMYeJwwZ+ZK iihz/67ZF/qMc79JP5K+tq97FyahwETM+EGIwtvcYHP+UJbhcPnTmF0jSEPK2Vn003Ry30V+Kmh wa8p47P8EwT2zd8yAlO6b X-Google-Smtp-Source: AGHT+IE4BN38JBiKx76BxP/6BUTVPP+3ckbM6pNBbK+SmHspfVRVwIu2YBrzhMH7wBCy1RoE1+z6EQ== X-Received: by 2002:a05:6000:1445:b0:390:e655:f998 with SMTP id ffacd0b85a97d-3997f909fa6mr2839938f8f.26.1742565539267; Fri, 21 Mar 2025 06:58:59 -0700 (PDT) Received: from ivaylo-T580.. (91-139-201-119.stz.ddns.bulsat.com. [91.139.201.119]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9e6651sm2437162f8f.75.2025.03.21.06.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 06:58:58 -0700 (PDT) From: Ivaylo Ivanov To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Philipp Zabel , Marek Szyprowski , Sylwester Nawrocki , Abel Vesa Cc: linux-arm-msm@vger.kernel.org, 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 Subject: [PATCH v3 01/10] dt-bindings: phy: add exynos2200 eusb2 phy support Date: Fri, 21 Mar 2025 15:58:45 +0200 Message-ID: <20250321135854.1431375-2-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> References: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_065901_254454_C46F29B7 X-CRM114-Status: UNSURE ( 8.66 ) 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 As Samsung has been using the same Synopsys eUSB2 IP in Exynos2200, albeit with a different register layout, rename qcom,snps-eusb2-phy to snps,eusb2-phy and drop mentions of it being only for Qualcomm SoCs in the binding description. Document the exynos2200 eUSB2 compatible. Unlike the currently documented Qualcomm SoCs, it doesn't provide reset lines for reset control and uses more clocks. Signed-off-by: Ivaylo Ivanov --- ...nps-eusb2-phy.yaml => snps,eusb2-phy.yaml} | 62 ++++++++++++++++--- 1 file changed, 54 insertions(+), 8 deletions(-) rename Documentation/devicetree/bindings/phy/{qcom,snps-eusb2-phy.yaml => snps,eusb2-phy.yaml} (59%) diff --git a/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml b/Documentation/devicetree/bindings/phy/snps,eusb2-phy.yaml similarity index 59% rename from Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml rename to Documentation/devicetree/bindings/phy/snps,eusb2-phy.yaml index 142b3c883..87f2c6756 100644 --- a/Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml +++ b/Documentation/devicetree/bindings/phy/snps,eusb2-phy.yaml @@ -1,16 +1,16 @@ # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) %YAML 1.2 --- -$id: http://devicetree.org/schemas/phy/qcom,snps-eusb2-phy.yaml# +$id: http://devicetree.org/schemas/phy/snps,eusb2-phy.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Qualcomm SNPS eUSB2 phy controller +title: SNPS eUSB2 phy controller maintainers: - Abel Vesa description: - eUSB2 controller supports LS/FS/HS usb connectivity on Qualcomm chipsets. + eUSB2 controller supports LS/FS/HS usb connectivity. properties: compatible: @@ -23,6 +23,7 @@ properties: - qcom,x1e80100-snps-eusb2-phy - const: qcom,sm8550-snps-eusb2-phy - const: qcom,sm8550-snps-eusb2-phy + - const: samsung,exynos2200-snps-eusb2-phy reg: maxItems: 1 @@ -31,12 +32,12 @@ properties: const: 0 clocks: - items: - - description: ref + minItems: 1 + maxItems: 3 clock-names: - items: - - const: ref + minItems: 1 + maxItems: 3 resets: maxItems: 1 @@ -62,7 +63,52 @@ required: - clock-names - vdd-supply - vdda12-supply - - resets + +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,sm8550-snps-eusb2-phy + + then: + properties: + reg: + maxItems: 1 + + clocks: + items: + - description: ref + + clock-names: + items: + - const: ref + + required: + - resets + + - if: + properties: + compatible: + contains: + enum: + - samsung,exynos2200-snps-eusb2-phy + + then: + properties: + + clocks: + items: + - description: Reference clock + - description: Bus (APB) clock + - description: Control clock + + clock-names: + items: + - const: ref + - const: bus + - const: ctrl additionalProperties: false From patchwork Fri Mar 21 13:58:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 14025506 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 95AFDC36001 for ; Fri, 21 Mar 2025 14:02: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: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QMhPkqDm/Xdsqm8oQfB+WtKOjvrKO7DnlLoQIHR2HRA=; b=zYL5rozkIF/tGg QUxbrsPqEFhO0EVyISUg2LRmM9vKnt8H+/LsOxkeS4wbDA5/CzgpU7VSxB5AhFOh/10CzbCVo3HZb jz//+YPeUoJ7cNXxeV5R1a4c4jpPcwligKjO4YzDpFoZ2nQCQDXzSPkBbV78BaQYMu/LE6K14mngb YN/hZIzGUcxHlGsy9eeVIJRwV7fupg2JuqUlGJq08p4yHON8D0vga4LzKmltKdKhw4EiWUiTTNTuq uW270KiizPiTUbbf2el/dOB/bSGeYN7Wlt+5lUwb18F29DCvxw4LTzBveK+xXTyeK1xL2k+wpXgDP 1tn32bsk1NzGkzEMns1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvcxA-0000000F1JW-1Utu; Fri, 21 Mar 2025 14:02:28 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvctq-0000000F0Ux-1Rip; Fri, 21 Mar 2025 13:59:03 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-39141ffa9fcso1802851f8f.0; Fri, 21 Mar 2025 06:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742565541; x=1743170341; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YIPPP5ujVDHuio5jUo3vfs/ZWMgoIwqmA1jTNPm5vS8=; b=N/+f448kqs3NbHr0b+a0T78dD57V9yME1WsFmHjtyOA/5nOkOnMzWD02gwy5SRj84Q LGcs2Uk6Pk1N5HFg83N/L7bYgO7ETLmsiCoDzP4Co1TfO0b7XNYDtqWMNRI2M8SoQrZV 7vgZQq76rw980QmTWnP+f+h2MehhkpGFFcl3kp/RjYfhGvJrKfW4r6lROWqXUjz9fo3r 0DmzhxAlBhxlwCP0B5j5vDeoBd0k3BadiIYNqRnYVk+9+R3w05vpS/gWj6KjE4Fj/pZF dnmZ16QnMhZpV2cPfEmhNGdyB2B0uSfQgA3n0Tk2D4QbTGdjuBj1ygsBsHtj8bCU5F6x Gdgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742565541; x=1743170341; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YIPPP5ujVDHuio5jUo3vfs/ZWMgoIwqmA1jTNPm5vS8=; b=tHadnJpeXoT4dtKxDrjgvHZk7aNOm6g3va3dZpaBkYEQImhqvtGFH/80qdr2UiHaFL pON4tN4t941AyFeOElhOtVLaR7e39vjae69emVbFN6wDNz10LyikLnGj6BMZCLSbha+l /s1fO0Xq/PikkLFbAe9KQis5Apz9HqgL2JUODvG7Cz3RvYwh9VFE8uwB0sqhm9O6CnkG nHMsL+KF3OeBTEcF6om8gwAo8lLQTrkTLpM+besisPRD9qo36jxoYZ4hC6zypFaJla+Q l5PKuj9NYIQdmNZSVpnhX4V3RrjXybzm2GI1NzO+OE48Zsd11t7aseTj+W8HSv1u8w+f 6NEw== X-Forwarded-Encrypted: i=1; AJvYcCV1JbMtcxrNH23/ami9UaxVMkMW1Q9DDxz4akyDDJED+LBSNv7lVnJ5ksYKRNaiOk+G7V47yrKGaA3Smvou2Nff@lists.infradead.org, AJvYcCVPrn3vi/qxxHJy1wyOY0nVc0SgXp7iGgzo4IXCzNb3sH7E8apj31sMCQVvZOFiIg37RWozZ6VrAnSI@lists.infradead.org X-Gm-Message-State: AOJu0YxZNMMQmfMDjDD2NP9pZ/TNOiII1MDOHCXINAri9mhqn0JD/1RK DXG3rKGq/u7j8e3NMkIvG+8AjGIKEicP0IRmvwB+7HVVBFFu6lGT X-Gm-Gg: ASbGncvuCMoi7obOynu5kk+NLID9mjnsk8aM4CEr/ze6twNWwIqQpLtV/uT32QbrXYp 1jpZK/Y0eYqiX7TNZ/yTgGI0eXaVv6WedKa4KfPPTPoluobyGMYiHE/DfasAU4YiUA6/81Nv1+P GSS4rZJMVdE/LuZf83pwlWZe/YiAecEtZ88VLjrJZh8oxExgpvTMlkRrXM4ySVqD09Z2605twZz 04sHxGaUDsiCze1MrZtMr01exrxFtrK4dh2EgIkuqHkOw36Rp4B/smCNIBtyx0B85ohZQi6muOq S/l8cR9oIRPAM5mgwh8dfWQJKKtzSJeFYUHl9DvLIPUl5gTLtNy2vBszpuSIQ2SZn4+/9aq26zU h/4p16hkprA4MM52OSgoJoeyHTNZz9VM= X-Google-Smtp-Source: AGHT+IFPFP42aVOYqjs1M5n27C94uUx314miaX7k0Qe1RphsqIE1/Aq6oAnk++IxGDHQycnfkPWZLg== X-Received: by 2002:a5d:6485:0:b0:391:4231:414 with SMTP id ffacd0b85a97d-3997f9397e6mr3645126f8f.40.1742565540690; Fri, 21 Mar 2025 06:59:00 -0700 (PDT) Received: from ivaylo-T580.. (91-139-201-119.stz.ddns.bulsat.com. [91.139.201.119]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9e6651sm2437162f8f.75.2025.03.21.06.58.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 06:59:00 -0700 (PDT) From: Ivaylo Ivanov To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Philipp Zabel , Marek Szyprowski , Sylwester Nawrocki , Abel Vesa Cc: linux-arm-msm@vger.kernel.org, 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 Subject: [PATCH v3 02/10] dt-bindings: phy: samsung,usb3-drd-phy: add exynos2200 support Date: Fri, 21 Mar 2025 15:58:46 +0200 Message-ID: <20250321135854.1431375-3-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> References: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_065902_382964_76E2DAA7 X-CRM114-Status: GOOD ( 10.65 ) 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 Document support for Exynos2200. As the USBDRD 3.2 4nm controller consists of Synopsys eUSB2.0 phy and USBDP/SS combophy, which will be handled by external drivers, define only the bus clocked used by the link controller. Signed-off-by: Ivaylo Ivanov --- .../bindings/phy/samsung,usb3-drd-phy.yaml | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml index 16321cdd4..819e4afe6 100644 --- a/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml +++ b/Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml @@ -26,6 +26,7 @@ properties: compatible: enum: - google,gs101-usb31drd-phy + - samsung,exynos2200-usb32drd-phy - samsung,exynos5250-usbdrd-phy - samsung,exynos5420-usbdrd-phy - samsung,exynos5433-usbdrd-phy @@ -33,24 +34,32 @@ properties: - samsung,exynos850-usbdrd-phy clocks: - minItems: 2 + minItems: 1 maxItems: 5 clock-names: - minItems: 2 + minItems: 1 maxItems: 5 description: | - At least two clocks:: + Typically two clocks:: - Main PHY clock (same as USB DRD controller i.e. DWC3 IP clock), used for register access. - PHY reference clock (usually crystal clock), used for PHY operations, associated by phy name. It is used to determine bit values for clock settings register. For Exynos5420 this is given as 'sclk_usbphy30' - in the CMU. + in the CMU. It's not needed for Exynos2200. "#phy-cells": const: 1 + phys: + maxItems: 1 + description: + Phandle to USBDRD-underlying high-speed PHY + + phy-names: + const: hs + port: $ref: /schemas/graph.yaml#/properties/port description: @@ -137,6 +146,27 @@ allOf: - vdda-usbdp-supply - vddh-usbdp-supply + - if: + properties: + compatible: + contains: + enum: + - samsung,exynos2200-usb32drd-phy + then: + properties: + clocks: + maxItems: 1 + clock-names: + items: + - const: phy + reg: + maxItems: 1 + reg-names: + maxItems: 1 + required: + - phys + - phy-names + - if: properties: compatible: From patchwork Fri Mar 21 13:58:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 14025507 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 BF2C3C36000 for ; Fri, 21 Mar 2025 14:04:11 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YWX2J1QeX442lrFakINUFVf3P+zt0z7+3Ngv04Zzv6w=; b=e6m8NlYbFdp16I Tj8e2XQ7W4+AaFCJ+nqUjxfDbg2WDV8gBzi5zshyy/xshiH/hD/mM4JOOho1RobwPKmmcrs/6DLKm eQ/Bm8xb9jfqPBkG8p1Yf6crcWwhE5fZu/JJzg8hN0afknRtWP1lHUW6S/1jhyblQHink4hJXRsac UuerhfFjKku0y3Kcn7E8mDOWEMHx3ZuHRAwHpfThPjJT89bjkOBEwApMLb5zbtGkHgFGb1d7/bIOC IGDK27yINDS9UGcNUmR1Wd4c0btkiES/IifLDQ3e/ydWedQpgYAVe7Zk6yhl0lK11Ka9T5dY2c0Z/ BwBlYDXLtWxOUnVcVYmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvcyp-0000000F1lb-1aB9; Fri, 21 Mar 2025 14:04:11 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvcts-0000000F0Vc-03mf; Fri, 21 Mar 2025 13:59:05 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3965c995151so1057403f8f.1; Fri, 21 Mar 2025 06:59:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742565542; x=1743170342; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w5bLkk6uqPyWirFskOF6TYLbFYm64XVe1/MBmiWZndA=; b=NC5M5YR6OVJJ10T3VbCtx0ZCSCg5Gv5ow4rZL3NE/TPgpa/HXgYlJJTqgv9h63k+6S Sg2iSdmXbDpV66gKF5ysSJYE5RZv7HTwmlXqfx+dYtwLUzN01+4WSUY5SMWxvTf1QEOi 3MuasQWYAdVSv/QVKr8dVmod4abBeB9HBBPnGfVQ+/EiO0Z7vwTScTbSmUoAk5mRfaBw vJ2ouFzdmBwOsUmVTOKoIvm9Pwo98pcbcOMjhvmMDkYRrvvyQM+STDf3tcd4xWNJS3cA yVGKViUmGusU8oPFSz6+TK3YGsA5tBEgBVENBsdf+1+U6S55C4ilkd/enZ9mmdMF2ITJ sOyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742565542; x=1743170342; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w5bLkk6uqPyWirFskOF6TYLbFYm64XVe1/MBmiWZndA=; b=L/4QIexRgdYTUGyO1bOS1LDBHFPXJvFT8gBMKdNZOQ1yeZL+jpuqN+U1vJL1Z9Kl3G SUvsnxagPw8FE8PK4T7shoccte4CRWplXlV+JRAu6a7eojfcXAzFEiKYC7EfJD+CNqXP YK3XId4MmI4lNHTXES103EPLzTWF5B1CX5QTLtm4iiqdT65LdSiOU2BhT0TYCZbdhjBi uPCsn4oy3Ml3bSBQvH51nbWMRrCRUYhQDS3+EGNKxoUeZ5+VnSwlqCZ3op0Wvhvs2fze Wzz47WSGP/reR9XXaesv2bHoUOGU+iQT8tuHEoTsVnXmfkbmLHYr8wjzAe7tKjo1gPBW srLg== X-Forwarded-Encrypted: i=1; AJvYcCWF379LcQSZt8ANkxWrCuYdtoAL/7cIyOosnPeEzAcbdPpjm/c8tI7m62LfDWKkn6WleXVZVx3iAeIr@lists.infradead.org, AJvYcCWk0J4jBW8rCAQsO7RacvyBnqjAxojXJrbjsIfhIJypNyeCDgcO3raX+e/LjhoET9kJsFxMN8GPUh8y9t+ODgxn@lists.infradead.org X-Gm-Message-State: AOJu0Yy0uw3t0wW0UP7/yk3EQTUs3+MVWSbvr9jdxQSya1ElwYxGqbue /0uYOEd4Jijgz9Bgy6P6kFPueTE26PmfIYEIH+e/bisweVFv0h9D X-Gm-Gg: ASbGnctemfeih1AjpX02ItOUUovAlH9VfFWxI/gSnz6JOpLy7KVtZsb2Dwse5uaf5U8 /aqEAxoFYPRziD+pko6KMZajv2lEHgwBlXayW4xTI+6EJWxemedniCGrjwZGSRYwzmmZP1kzhap GtWIudEmfl0OHc56KYICciHuf8swUjAtjmxlwqyDatwcqNqCXMB53/JCv0MKI2e2w4tGR2URusY zASJjRvB6/aBKbGxFfIcPBD0m2faBpbhVjveCc9z2g6Lp1+kDfzt0J4+SuAr7EELfCrnrcT8rMF oRB3lAqIpa/QPaivF6lgsQiQGUeaGck0GlExKmJZ9BQb9XmpdUkS3OB0dc4X1B8ghzb4oXdeqEo nnL95oryvlSgO7CVk9cPw X-Google-Smtp-Source: AGHT+IHNOmMa9KW3MUdMo1gO9oj/91uP7LkUin/DdC6+LBE4xrKRJwfNY8vmAFeiFQoQQMTRjkFDAQ== X-Received: by 2002:a5d:584b:0:b0:390:f9a5:bd79 with SMTP id ffacd0b85a97d-3997f90ab9emr3286675f8f.26.1742565542199; Fri, 21 Mar 2025 06:59:02 -0700 (PDT) Received: from ivaylo-T580.. (91-139-201-119.stz.ddns.bulsat.com. [91.139.201.119]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9e6651sm2437162f8f.75.2025.03.21.06.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 06:59:01 -0700 (PDT) From: Ivaylo Ivanov To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Philipp Zabel , Marek Szyprowski , Sylwester Nawrocki , Abel Vesa Cc: linux-arm-msm@vger.kernel.org, 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 Subject: [PATCH v3 03/10] phy: move phy-qcom-snps-eusb2 out of its vendor sub-directory Date: Fri, 21 Mar 2025 15:58:47 +0200 Message-ID: <20250321135854.1431375-4-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> References: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_065904_051057_3EB0215E X-CRM114-Status: GOOD ( 12.53 ) 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 As not only Qualcomm, but also Samsung is using the Synopsys eUSB2 IP (albeit with a different register layout) in their newer SoCs, move the driver out of its vendor sub-directory and rename it to phy-snps-eusb2. Signed-off-by: Ivaylo Ivanov Suggested-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov --- drivers/phy/Kconfig | 8 ++++++++ drivers/phy/Makefile | 1 + .../{qualcomm/phy-qcom-snps-eusb2.c => phy-snps-eusb2.c} | 0 drivers/phy/qualcomm/Kconfig | 9 --------- drivers/phy/qualcomm/Makefile | 1 - 5 files changed, 9 insertions(+), 10 deletions(-) rename drivers/phy/{qualcomm/phy-qcom-snps-eusb2.c => phy-snps-eusb2.c} (100%) diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 8d58efe99..11c166204 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -43,6 +43,14 @@ config PHY_PISTACHIO_USB help Enable this to support the USB2.0 PHY on the IMG Pistachio SoC. +config PHY_SNPS_EUSB2 + tristate "SNPS eUSB2 PHY Driver" + depends on OF && (ARCH_QCOM || COMPILE_TEST) + select GENERIC_PHY + help + Enable support for the USB high-speed SNPS eUSB2 phy on select + SoCs. The PHY is usually paired with a Synopsys DWC3 USB controller. + config PHY_XGENE tristate "APM X-Gene 15Gbps PHY support" depends on HAS_IOMEM && OF && (ARCH_XGENE || COMPILE_TEST) diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index e281442ac..c670a8dac 100644 --- a/drivers/phy/Makefile +++ b/drivers/phy/Makefile @@ -9,6 +9,7 @@ obj-$(CONFIG_PHY_CAN_TRANSCEIVER) += phy-can-transceiver.o obj-$(CONFIG_PHY_LPC18XX_USB_OTG) += phy-lpc18xx-usb-otg.o obj-$(CONFIG_PHY_XGENE) += phy-xgene.o obj-$(CONFIG_PHY_PISTACHIO_USB) += phy-pistachio-usb.o +obj-$(CONFIG_PHY_SNPS_EUSB2) += phy-snps-eusb2.o obj-$(CONFIG_USB_LGM_PHY) += phy-lgm-usb.o obj-$(CONFIG_PHY_AIROHA_PCIE) += phy-airoha-pcie.o obj-$(CONFIG_PHY_NXP_PTN3222) += phy-nxp-ptn3222.o diff --git a/drivers/phy/qualcomm/phy-qcom-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c similarity index 100% rename from drivers/phy/qualcomm/phy-qcom-snps-eusb2.c rename to drivers/phy/phy-snps-eusb2.c diff --git a/drivers/phy/qualcomm/Kconfig b/drivers/phy/qualcomm/Kconfig index 846f8c995..914547068 100644 --- a/drivers/phy/qualcomm/Kconfig +++ b/drivers/phy/qualcomm/Kconfig @@ -125,15 +125,6 @@ config PHY_QCOM_QUSB2 PHY which is usually paired with either the ChipIdea or Synopsys DWC3 USB IPs on MSM SOCs. -config PHY_QCOM_SNPS_EUSB2 - tristate "Qualcomm SNPS eUSB2 PHY Driver" - depends on OF && (ARCH_QCOM || COMPILE_TEST) - select GENERIC_PHY - help - Enable support for the USB high-speed SNPS eUSB2 phy on Qualcomm - chipsets. The PHY is paired with a Synopsys DWC3 USB controller - on Qualcomm SOCs. - config PHY_QCOM_EUSB2_REPEATER tristate "Qualcomm SNPS eUSB2 Repeater Driver" depends on OF && (ARCH_QCOM || COMPILE_TEST) diff --git a/drivers/phy/qualcomm/Makefile b/drivers/phy/qualcomm/Makefile index eb60e950a..2121e92df 100644 --- a/drivers/phy/qualcomm/Makefile +++ b/drivers/phy/qualcomm/Makefile @@ -15,7 +15,6 @@ obj-$(CONFIG_PHY_QCOM_QMP_USB) += phy-qcom-qmp-usb.o obj-$(CONFIG_PHY_QCOM_QMP_USB_LEGACY) += phy-qcom-qmp-usb-legacy.o obj-$(CONFIG_PHY_QCOM_QUSB2) += phy-qcom-qusb2.o -obj-$(CONFIG_PHY_QCOM_SNPS_EUSB2) += phy-qcom-snps-eusb2.o obj-$(CONFIG_PHY_QCOM_EUSB2_REPEATER) += phy-qcom-eusb2-repeater.o obj-$(CONFIG_PHY_QCOM_USB_HS) += phy-qcom-usb-hs.o obj-$(CONFIG_PHY_QCOM_USB_HSIC) += phy-qcom-usb-hsic.o From patchwork Fri Mar 21 13:58:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 14025508 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 A8C25C36000 for ; Fri, 21 Mar 2025 14:05:53 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e5rdGFCuJrNHXVaKt8BLPhSoUAZSHjA7rO37B2WM2t0=; b=r3LUacxhY5HqNy RQ4R0h8E2nVEaoUWy8b8rV7lLSjlf7xvWYb6fw78iEGfrlbdwnos/2jtTldweHQHgQ1EfYWBF50/p my8lbh1Q+Xwy6US4OLV7gsAFnHDoRI0jg7Wqmw9MxXTxqqHi2uJLihGg2ej09cWiZQOoZSAOdJE9t /57Z1r9ppJw4bAuuUt4zs7f3OCFruMbeh30fCLJelzpVi/G6Va+H7Ez3cLweHp6wOsNXqQ669en+l KhT6wkPGXmzei9Da+iwHwjCSPUsiQ23LRWR9ybrB5Z81rXqzNGGxBB1yIorTOS4WB9xAG6PjX6ub0 327UhbapDLxzLuhXrnmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvd0T-0000000F27M-1QjS; Fri, 21 Mar 2025 14:05:53 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvctt-0000000F0W5-16oC; Fri, 21 Mar 2025 13:59:06 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-39141ffa9fcso1802897f8f.0; Fri, 21 Mar 2025 06:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742565544; x=1743170344; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I+G5XKLXnsjT0t04w7zApTjDNVwodljF6Xa/DfGbxTo=; b=Gk9hnCKvoTFqHY8Lst5lOc5HK7JWzA8vF+zwIarmfwNUIWbT2O5t0QG5Rs6vX+XquB g5QdBaCo6eIDqW/tfcjXc+o1rJdA3hx340Pd0Seq3IMMct1wTCNB3AQdyPuX8hIWe2SB v6nKAQ8GIHhlEbDiS9b2Qes0F+bv3ZED2Bfbrb3pWbLakoek0u58G3vN2c6C+7kIWqRB RuxqwAh3P0H2eRbFej59vQRe108jCzFhKcAEmO7CfWJGGAxHR4A6rzZk3RHMVGdMzTKn 9b2uzCts4y6NWXRIVmj6vGDrHzIUTJVyOaiWVcl4cgy5brk54RV3MmpMqq89LkPoQY5s pPeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742565544; x=1743170344; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I+G5XKLXnsjT0t04w7zApTjDNVwodljF6Xa/DfGbxTo=; b=AbO/JWPVEHas4GSS2mZ5C+46ImZwynaiSoxSNxMCcTxeTV5Mj9kIcvTgajahR4s7Wz L1xOId0AjaArJdUMtd/04au58dRrWL5HfokY6oWnNYrDnY8GX4yCOZWF4f/wPiLc+BPt 93zp7vl2EcplF6lONbpDASxuZor9mqbvTx1+VMMDAbPEwpqb2JUuvxLC4XIdse5WQmLI laEgowvgkSm40kMTl1EiDZB8oSDx9VAH3XwyOooi85LiKXx3LFbedeNjFdgNgNUa8yDE nx1htoA4m/goR+mRoz30joy9fCiQeMV8IAeoHbTG9lvH/Lrodhv9tAzPOP/+4hsMkO7W pTTg== X-Forwarded-Encrypted: i=1; AJvYcCUa+80zlCXCF9mq2lSw7IhIkKlV5vDx73im7oDxTdRr5sWNLSqHQgVGvl78RZpsYDrZuxVZYGoQqfltTdDCXiMa@lists.infradead.org, AJvYcCWb0tVxcqD468ykiuYOK/cCrqUf3cNRKnIO7RL+zJg8wtsdQWwtN08RqdEamX6oyImJGnRZVXWm0pbC@lists.infradead.org X-Gm-Message-State: AOJu0YzChHchr7wA6R3Op7aPFh+v3QQcHsj7xV/5+fsTuaVA6HV2PbMK FMoi7kqqRC/72k+gK9JEs3I3RxTBQ3kryHxV6BwPx9J8+Dh5K5Wo X-Gm-Gg: ASbGncukR6nZuJM+HQ5XQGwMljKLLJZlUuELJyPn1qS3IiISN0JwhmtwYLdfkLHhRPi 3ycaK3TmIDJ/flA3t/kn1ZP/ti1pnzfgO+xeXSQjscq5FHtMuD8DBDIqvGFOiNH1MyzmiOyFmWw REaS+SbW6nPBmVyG8YOytJQxVDBUHB1CL42Na7cyo9aM3Z+4lHzHL4MnxMuZFPOCo/H8xDLk86b kqqo2G18fo2tT3DxMNgPvpER7qYlOjvl1z/D50yfvmcroXwGa1ZL9mbwvHAXLBVH4xbUOgant2Q DpAUTCiIw1mlDtpF8Zm1VWozGsWRgS5fyEnjWs8RSGQ6gy7R/qSZMVXii1DyrcxsJuyCu4d9Hyk CBI1vmQbfjfP8C+Y0XCl/ X-Google-Smtp-Source: AGHT+IFKfqglKy6unbExfxvsFYJAMzRfF8Xb7sXWGXsVaDBguWXoVT05UEhV400UKIAEyMg4TnkG+Q== X-Received: by 2002:a05:6000:1ac9:b0:390:fbdd:994d with SMTP id ffacd0b85a97d-3997f910670mr3640019f8f.27.1742565543606; Fri, 21 Mar 2025 06:59:03 -0700 (PDT) Received: from ivaylo-T580.. (91-139-201-119.stz.ddns.bulsat.com. [91.139.201.119]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9e6651sm2437162f8f.75.2025.03.21.06.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 06:59:03 -0700 (PDT) From: Ivaylo Ivanov To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Philipp Zabel , Marek Szyprowski , Sylwester Nawrocki , Abel Vesa Cc: linux-arm-msm@vger.kernel.org, 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 Subject: [PATCH v3 04/10] phy: phy-snps-eusb2: refactor constructs names Date: Fri, 21 Mar 2025 15:58:48 +0200 Message-ID: <20250321135854.1431375-5-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> References: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_065905_463590_5B1DE355 X-CRM114-Status: GOOD ( 14.04 ) 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 As the driver now resides outside the phy subdirectory under a different name, refactor all definitions, structures and functions to explicitly specify what code is Qualcomm-specific and what is not. Signed-off-by: Ivaylo Ivanov Reviewed-by: Dmitry Baryshkov --- drivers/phy/phy-snps-eusb2.c | 256 +++++++++++++++++------------------ 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c index 1484691a4..405278c18 100644 --- a/drivers/phy/phy-snps-eusb2.c +++ b/drivers/phy/phy-snps-eusb2.c @@ -13,15 +13,15 @@ #include #include -#define USB_PHY_UTMI_CTRL0 (0x3c) +#define QCOM_USB_PHY_UTMI_CTRL0 (0x3c) #define SLEEPM BIT(0) #define OPMODE_MASK GENMASK(4, 3) #define OPMODE_NONDRIVING BIT(3) -#define USB_PHY_UTMI_CTRL5 (0x50) +#define QCOM_USB_PHY_UTMI_CTRL5 (0x50) #define POR BIT(1) -#define USB_PHY_HS_PHY_CTRL_COMMON0 (0x54) +#define QCOM_USB_PHY_HS_PHY_CTRL_COMMON0 (0x54) #define PHY_ENABLE BIT(0) #define SIDDQ_SEL BIT(1) #define SIDDQ BIT(2) @@ -30,15 +30,15 @@ #define FSEL_19_2_MHZ_VAL (0x0) #define FSEL_38_4_MHZ_VAL (0x4) -#define USB_PHY_CFG_CTRL_1 (0x58) +#define QCOM_USB_PHY_CFG_CTRL_1 (0x58) #define PHY_CFG_PLL_CPBIAS_CNTRL_MASK GENMASK(7, 1) -#define USB_PHY_CFG_CTRL_2 (0x5c) +#define QCOM_USB_PHY_CFG_CTRL_2 (0x5c) #define PHY_CFG_PLL_FB_DIV_7_0_MASK GENMASK(7, 0) #define DIV_7_0_19_2_MHZ_VAL (0x90) #define DIV_7_0_38_4_MHZ_VAL (0xc8) -#define USB_PHY_CFG_CTRL_3 (0x60) +#define QCOM_USB_PHY_CFG_CTRL_3 (0x60) #define PHY_CFG_PLL_FB_DIV_11_8_MASK GENMASK(3, 0) #define DIV_11_8_19_2_MHZ_VAL (0x1) #define DIV_11_8_38_4_MHZ_VAL (0x0) @@ -46,73 +46,73 @@ #define PHY_CFG_PLL_REF_DIV GENMASK(7, 4) #define PLL_REF_DIV_VAL (0x0) -#define USB_PHY_HS_PHY_CTRL2 (0x64) +#define QCOM_USB_PHY_HS_PHY_CTRL2 (0x64) #define VBUSVLDEXT0 BIT(0) #define USB2_SUSPEND_N BIT(2) #define USB2_SUSPEND_N_SEL BIT(3) #define VBUS_DET_EXT_SEL BIT(4) -#define USB_PHY_CFG_CTRL_4 (0x68) +#define QCOM_USB_PHY_CFG_CTRL_4 (0x68) #define PHY_CFG_PLL_GMP_CNTRL_MASK GENMASK(1, 0) #define PHY_CFG_PLL_INT_CNTRL_MASK GENMASK(7, 2) -#define USB_PHY_CFG_CTRL_5 (0x6c) +#define QCOM_USB_PHY_CFG_CTRL_5 (0x6c) #define PHY_CFG_PLL_PROP_CNTRL_MASK GENMASK(4, 0) #define PHY_CFG_PLL_VREF_TUNE_MASK GENMASK(7, 6) -#define USB_PHY_CFG_CTRL_6 (0x70) +#define QCOM_USB_PHY_CFG_CTRL_6 (0x70) #define PHY_CFG_PLL_VCO_CNTRL_MASK GENMASK(2, 0) -#define USB_PHY_CFG_CTRL_7 (0x74) +#define QCOM_USB_PHY_CFG_CTRL_7 (0x74) -#define USB_PHY_CFG_CTRL_8 (0x78) +#define QCOM_USB_PHY_CFG_CTRL_8 (0x78) #define PHY_CFG_TX_FSLS_VREF_TUNE_MASK GENMASK(1, 0) #define PHY_CFG_TX_FSLS_VREG_BYPASS BIT(2) #define PHY_CFG_TX_HS_VREF_TUNE_MASK GENMASK(5, 3) #define PHY_CFG_TX_HS_XV_TUNE_MASK GENMASK(7, 6) -#define USB_PHY_CFG_CTRL_9 (0x7c) +#define QCOM_USB_PHY_CFG_CTRL_9 (0x7c) #define PHY_CFG_TX_PREEMP_TUNE_MASK GENMASK(2, 0) #define PHY_CFG_TX_RES_TUNE_MASK GENMASK(4, 3) #define PHY_CFG_TX_RISE_TUNE_MASK GENMASK(6, 5) #define PHY_CFG_RCAL_BYPASS BIT(7) -#define USB_PHY_CFG_CTRL_10 (0x80) +#define QCOM_USB_PHY_CFG_CTRL_10 (0x80) -#define USB_PHY_CFG0 (0x94) +#define QCOM_USB_PHY_CFG0 (0x94) #define DATAPATH_CTRL_OVERRIDE_EN BIT(0) #define CMN_CTRL_OVERRIDE_EN BIT(1) -#define UTMI_PHY_CMN_CTRL0 (0x98) +#define QCOM_UTMI_PHY_CMN_CTRL0 (0x98) #define TESTBURNIN BIT(6) -#define USB_PHY_FSEL_SEL (0xb8) +#define QCOM_USB_PHY_FSEL_SEL (0xb8) #define FSEL_SEL BIT(0) -#define USB_PHY_APB_ACCESS_CMD (0x130) +#define QCOM_USB_PHY_APB_ACCESS_CMD (0x130) #define RW_ACCESS BIT(0) #define APB_START_CMD BIT(1) #define APB_LOGIC_RESET BIT(2) -#define USB_PHY_APB_ACCESS_STATUS (0x134) +#define QCOM_USB_PHY_APB_ACCESS_STATUS (0x134) #define ACCESS_DONE BIT(0) #define TIMED_OUT BIT(1) #define ACCESS_ERROR BIT(2) #define ACCESS_IN_PROGRESS BIT(3) -#define USB_PHY_APB_ADDRESS (0x138) +#define QCOM_USB_PHY_APB_ADDRESS (0x138) #define APB_REG_ADDR_MASK GENMASK(7, 0) -#define USB_PHY_APB_WRDATA_LSB (0x13c) +#define QCOM_USB_PHY_APB_WRDATA_LSB (0x13c) #define APB_REG_WRDATA_7_0_MASK GENMASK(3, 0) -#define USB_PHY_APB_WRDATA_MSB (0x140) +#define QCOM_USB_PHY_APB_WRDATA_MSB (0x140) #define APB_REG_WRDATA_15_8_MASK GENMASK(7, 4) -#define USB_PHY_APB_RDDATA_LSB (0x144) +#define QCOM_USB_PHY_APB_RDDATA_LSB (0x144) #define APB_REG_RDDATA_7_0_MASK GENMASK(3, 0) -#define USB_PHY_APB_RDDATA_MSB (0x148) +#define QCOM_USB_PHY_APB_RDDATA_MSB (0x148) #define APB_REG_RDDATA_15_8_MASK GENMASK(7, 4) static const char * const eusb2_hsphy_vreg_names[] = { @@ -121,7 +121,7 @@ static const char * const eusb2_hsphy_vreg_names[] = { #define EUSB2_NUM_VREGS ARRAY_SIZE(eusb2_hsphy_vreg_names) -struct qcom_snps_eusb2_hsphy { +struct snps_eusb2_hsphy { struct phy *phy; void __iomem *base; @@ -135,17 +135,17 @@ struct qcom_snps_eusb2_hsphy { struct phy *repeater; }; -static int qcom_snps_eusb2_hsphy_set_mode(struct phy *p, enum phy_mode mode, int submode) +static int snps_eusb2_hsphy_set_mode(struct phy *p, enum phy_mode mode, int submode) { - struct qcom_snps_eusb2_hsphy *phy = phy_get_drvdata(p); + struct snps_eusb2_hsphy *phy = phy_get_drvdata(p); phy->mode = mode; return phy_set_mode_ext(phy->repeater, mode, submode); } -static void qcom_snps_eusb2_hsphy_write_mask(void __iomem *base, u32 offset, - u32 mask, u32 val) +static void snps_eusb2_hsphy_write_mask(void __iomem *base, u32 offset, + u32 mask, u32 val) { u32 reg; @@ -158,65 +158,65 @@ static void qcom_snps_eusb2_hsphy_write_mask(void __iomem *base, u32 offset, readl_relaxed(base + offset); } -static void qcom_eusb2_default_parameters(struct qcom_snps_eusb2_hsphy *phy) +static void qcom_eusb2_default_parameters(struct snps_eusb2_hsphy *phy) { /* default parameters: tx pre-emphasis */ - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_9, - PHY_CFG_TX_PREEMP_TUNE_MASK, - FIELD_PREP(PHY_CFG_TX_PREEMP_TUNE_MASK, 0)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_9, + PHY_CFG_TX_PREEMP_TUNE_MASK, + FIELD_PREP(PHY_CFG_TX_PREEMP_TUNE_MASK, 0)); /* tx rise/fall time */ - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_9, - PHY_CFG_TX_RISE_TUNE_MASK, - FIELD_PREP(PHY_CFG_TX_RISE_TUNE_MASK, 0x2)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_9, + PHY_CFG_TX_RISE_TUNE_MASK, + FIELD_PREP(PHY_CFG_TX_RISE_TUNE_MASK, 0x2)); /* source impedance adjustment */ - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_9, - PHY_CFG_TX_RES_TUNE_MASK, - FIELD_PREP(PHY_CFG_TX_RES_TUNE_MASK, 0x1)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_9, + PHY_CFG_TX_RES_TUNE_MASK, + FIELD_PREP(PHY_CFG_TX_RES_TUNE_MASK, 0x1)); /* dc voltage level adjustement */ - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_8, - PHY_CFG_TX_HS_VREF_TUNE_MASK, - FIELD_PREP(PHY_CFG_TX_HS_VREF_TUNE_MASK, 0x3)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_8, + PHY_CFG_TX_HS_VREF_TUNE_MASK, + FIELD_PREP(PHY_CFG_TX_HS_VREF_TUNE_MASK, 0x3)); /* transmitter HS crossover adjustement */ - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_8, - PHY_CFG_TX_HS_XV_TUNE_MASK, - FIELD_PREP(PHY_CFG_TX_HS_XV_TUNE_MASK, 0x0)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_8, + PHY_CFG_TX_HS_XV_TUNE_MASK, + FIELD_PREP(PHY_CFG_TX_HS_XV_TUNE_MASK, 0x0)); } -static int qcom_eusb2_ref_clk_init(struct qcom_snps_eusb2_hsphy *phy) +static int qcom_eusb2_ref_clk_init(struct snps_eusb2_hsphy *phy) { unsigned long ref_clk_freq = clk_get_rate(phy->ref_clk); switch (ref_clk_freq) { case 19200000: - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_HS_PHY_CTRL_COMMON0, - FSEL_MASK, - FIELD_PREP(FSEL_MASK, FSEL_19_2_MHZ_VAL)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL_COMMON0, + FSEL_MASK, + FIELD_PREP(FSEL_MASK, FSEL_19_2_MHZ_VAL)); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_2, - PHY_CFG_PLL_FB_DIV_7_0_MASK, - DIV_7_0_19_2_MHZ_VAL); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_2, + PHY_CFG_PLL_FB_DIV_7_0_MASK, + DIV_7_0_19_2_MHZ_VAL); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_3, - PHY_CFG_PLL_FB_DIV_11_8_MASK, - DIV_11_8_19_2_MHZ_VAL); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_3, + PHY_CFG_PLL_FB_DIV_11_8_MASK, + DIV_11_8_19_2_MHZ_VAL); break; case 38400000: - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_HS_PHY_CTRL_COMMON0, - FSEL_MASK, - FIELD_PREP(FSEL_MASK, FSEL_38_4_MHZ_VAL)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL_COMMON0, + FSEL_MASK, + FIELD_PREP(FSEL_MASK, FSEL_38_4_MHZ_VAL)); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_2, - PHY_CFG_PLL_FB_DIV_7_0_MASK, - DIV_7_0_38_4_MHZ_VAL); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_2, + PHY_CFG_PLL_FB_DIV_7_0_MASK, + DIV_7_0_38_4_MHZ_VAL); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_3, - PHY_CFG_PLL_FB_DIV_11_8_MASK, - DIV_11_8_38_4_MHZ_VAL); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_3, + PHY_CFG_PLL_FB_DIV_11_8_MASK, + DIV_11_8_38_4_MHZ_VAL); break; default: @@ -224,15 +224,15 @@ static int qcom_eusb2_ref_clk_init(struct qcom_snps_eusb2_hsphy *phy) return -EINVAL; } - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_3, - PHY_CFG_PLL_REF_DIV, PLL_REF_DIV_VAL); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_3, + PHY_CFG_PLL_REF_DIV, PLL_REF_DIV_VAL); return 0; } -static int qcom_snps_eusb2_hsphy_init(struct phy *p) +static int snps_eusb2_hsphy_init(struct phy *p) { - struct qcom_snps_eusb2_hsphy *phy = phy_get_drvdata(p); + struct snps_eusb2_hsphy *phy = phy_get_drvdata(p); int ret; ret = regulator_bulk_enable(ARRAY_SIZE(phy->vregs), phy->vregs); @@ -265,73 +265,73 @@ static int qcom_snps_eusb2_hsphy_init(struct phy *p) goto disable_ref_clk; } - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG0, - CMN_CTRL_OVERRIDE_EN, CMN_CTRL_OVERRIDE_EN); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG0, + CMN_CTRL_OVERRIDE_EN, CMN_CTRL_OVERRIDE_EN); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_UTMI_CTRL5, POR, POR); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_UTMI_CTRL5, POR, POR); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_HS_PHY_CTRL_COMMON0, - PHY_ENABLE | RETENABLEN, PHY_ENABLE | RETENABLEN); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL_COMMON0, + PHY_ENABLE | RETENABLEN, PHY_ENABLE | RETENABLEN); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_APB_ACCESS_CMD, - APB_LOGIC_RESET, APB_LOGIC_RESET); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_APB_ACCESS_CMD, + APB_LOGIC_RESET, APB_LOGIC_RESET); - qcom_snps_eusb2_hsphy_write_mask(phy->base, UTMI_PHY_CMN_CTRL0, TESTBURNIN, 0); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_UTMI_PHY_CMN_CTRL0, TESTBURNIN, 0); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_FSEL_SEL, - FSEL_SEL, FSEL_SEL); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_FSEL_SEL, + FSEL_SEL, FSEL_SEL); /* update ref_clk related registers */ ret = qcom_eusb2_ref_clk_init(phy); if (ret) - goto disable_ref_clk; + return ret; - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_1, - PHY_CFG_PLL_CPBIAS_CNTRL_MASK, - FIELD_PREP(PHY_CFG_PLL_CPBIAS_CNTRL_MASK, 0x1)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_1, + PHY_CFG_PLL_CPBIAS_CNTRL_MASK, + FIELD_PREP(PHY_CFG_PLL_CPBIAS_CNTRL_MASK, 0x1)); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_4, - PHY_CFG_PLL_INT_CNTRL_MASK, - FIELD_PREP(PHY_CFG_PLL_INT_CNTRL_MASK, 0x8)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_4, + PHY_CFG_PLL_INT_CNTRL_MASK, + FIELD_PREP(PHY_CFG_PLL_INT_CNTRL_MASK, 0x8)); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_4, - PHY_CFG_PLL_GMP_CNTRL_MASK, - FIELD_PREP(PHY_CFG_PLL_GMP_CNTRL_MASK, 0x1)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_4, + PHY_CFG_PLL_GMP_CNTRL_MASK, + FIELD_PREP(PHY_CFG_PLL_GMP_CNTRL_MASK, 0x1)); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_5, - PHY_CFG_PLL_PROP_CNTRL_MASK, - FIELD_PREP(PHY_CFG_PLL_PROP_CNTRL_MASK, 0x10)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_5, + PHY_CFG_PLL_PROP_CNTRL_MASK, + FIELD_PREP(PHY_CFG_PLL_PROP_CNTRL_MASK, 0x10)); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_6, - PHY_CFG_PLL_VCO_CNTRL_MASK, - FIELD_PREP(PHY_CFG_PLL_VCO_CNTRL_MASK, 0x0)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_6, + PHY_CFG_PLL_VCO_CNTRL_MASK, + FIELD_PREP(PHY_CFG_PLL_VCO_CNTRL_MASK, 0x0)); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_CFG_CTRL_5, - PHY_CFG_PLL_VREF_TUNE_MASK, - FIELD_PREP(PHY_CFG_PLL_VREF_TUNE_MASK, 0x1)); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_5, + PHY_CFG_PLL_VREF_TUNE_MASK, + FIELD_PREP(PHY_CFG_PLL_VREF_TUNE_MASK, 0x1)); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_HS_PHY_CTRL2, - VBUS_DET_EXT_SEL, VBUS_DET_EXT_SEL); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL2, + VBUS_DET_EXT_SEL, VBUS_DET_EXT_SEL); /* set default parameters */ qcom_eusb2_default_parameters(phy); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_HS_PHY_CTRL2, - USB2_SUSPEND_N_SEL | USB2_SUSPEND_N, - USB2_SUSPEND_N_SEL | USB2_SUSPEND_N); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL2, + USB2_SUSPEND_N_SEL | USB2_SUSPEND_N, + USB2_SUSPEND_N_SEL | USB2_SUSPEND_N); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_UTMI_CTRL0, SLEEPM, SLEEPM); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_UTMI_CTRL0, SLEEPM, SLEEPM); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_HS_PHY_CTRL_COMMON0, - SIDDQ_SEL, SIDDQ_SEL); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL_COMMON0, + SIDDQ_SEL, SIDDQ_SEL); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_HS_PHY_CTRL_COMMON0, - SIDDQ, 0); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL_COMMON0, + SIDDQ, 0); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_UTMI_CTRL5, POR, 0); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_UTMI_CTRL5, POR, 0); - qcom_snps_eusb2_hsphy_write_mask(phy->base, USB_PHY_HS_PHY_CTRL2, - USB2_SUSPEND_N_SEL, 0); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL2, + USB2_SUSPEND_N_SEL, 0); return 0; @@ -344,9 +344,9 @@ static int qcom_snps_eusb2_hsphy_init(struct phy *p) return ret; } -static int qcom_snps_eusb2_hsphy_exit(struct phy *p) +static int snps_eusb2_hsphy_exit(struct phy *p) { - struct qcom_snps_eusb2_hsphy *phy = phy_get_drvdata(p); + struct snps_eusb2_hsphy *phy = phy_get_drvdata(p); clk_disable_unprepare(phy->ref_clk); @@ -357,18 +357,18 @@ static int qcom_snps_eusb2_hsphy_exit(struct phy *p) return 0; } -static const struct phy_ops qcom_snps_eusb2_hsphy_ops = { - .init = qcom_snps_eusb2_hsphy_init, - .exit = qcom_snps_eusb2_hsphy_exit, - .set_mode = qcom_snps_eusb2_hsphy_set_mode, +static const struct phy_ops snps_eusb2_hsphy_ops = { + .init = snps_eusb2_hsphy_init, + .exit = snps_eusb2_hsphy_exit, + .set_mode = snps_eusb2_hsphy_set_mode, .owner = THIS_MODULE, }; -static int qcom_snps_eusb2_hsphy_probe(struct platform_device *pdev) +static int snps_eusb2_hsphy_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; - struct qcom_snps_eusb2_hsphy *phy; + struct snps_eusb2_hsphy *phy; struct phy_provider *phy_provider; struct phy *generic_phy; int ret, i; @@ -405,7 +405,7 @@ static int qcom_snps_eusb2_hsphy_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(phy->repeater), "failed to get repeater\n"); - generic_phy = devm_phy_create(dev, NULL, &qcom_snps_eusb2_hsphy_ops); + generic_phy = devm_phy_create(dev, NULL, &snps_eusb2_hsphy_ops); if (IS_ERR(generic_phy)) { dev_err(dev, "failed to create phy %d\n", ret); return PTR_ERR(generic_phy); @@ -418,25 +418,25 @@ static int qcom_snps_eusb2_hsphy_probe(struct platform_device *pdev) if (IS_ERR(phy_provider)) return PTR_ERR(phy_provider); - dev_info(dev, "Registered Qcom-eUSB2 phy\n"); + dev_info(dev, "Registered Snps-eUSB2 phy\n"); return 0; } -static const struct of_device_id qcom_snps_eusb2_hsphy_of_match_table[] = { +static const struct of_device_id snps_eusb2_hsphy_of_match_table[] = { { .compatible = "qcom,sm8550-snps-eusb2-phy", }, { }, }; -MODULE_DEVICE_TABLE(of, qcom_snps_eusb2_hsphy_of_match_table); +MODULE_DEVICE_TABLE(of, snps_eusb2_hsphy_of_match_table); -static struct platform_driver qcom_snps_eusb2_hsphy_driver = { - .probe = qcom_snps_eusb2_hsphy_probe, +static struct platform_driver snps_eusb2_hsphy_driver = { + .probe = snps_eusb2_hsphy_probe, .driver = { - .name = "qcom-snps-eusb2-hsphy", - .of_match_table = qcom_snps_eusb2_hsphy_of_match_table, + .name = "snps-eusb2-hsphy", + .of_match_table = snps_eusb2_hsphy_of_match_table, }, }; -module_platform_driver(qcom_snps_eusb2_hsphy_driver); -MODULE_DESCRIPTION("Qualcomm SNPS eUSB2 HS PHY driver"); +module_platform_driver(snps_eusb2_hsphy_driver); +MODULE_DESCRIPTION("SNPS eUSB2 HS PHY driver"); MODULE_LICENSE("GPL"); From patchwork Fri Mar 21 13:58:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 14025513 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 B418AC36000 for ; Fri, 21 Mar 2025 14:07:35 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LIxMKnmkobBX7kXPQFzh7SxNjRgZwgX/o+bXC0i1HYM=; b=Z7fXnUIv5JD2uR 15j0GlLvqFzjown+Bt8D7yAa5WfW8bN+xU/6WcUGP6Ene6gjb2LLRsXNyUgmktfI2SxtEJoEX9MY8 uETTwu2hPNN8eQGA8Pc6ykySyBOYrzAQHEHrNUa94b7JGLUb2R6HUF/9mRLk6Iv7dunY7vDhC6jnc BvjoOr9Gz4VV5Y1fxxKNwfbAMxebf/fapxP9WDDhPUcpg36B9F0J4LVoRIC1Mu9pjmVFHOSzbyU0n b17copVZdvRuBDpNFN3jj7qOCmLM3sjBuR7MH7yq2U0W1+TwSWYqJSt4cuW5zKiOOLQpbEsL+B4gj L8OA7bfecd2GEbLbtYIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvd27-0000000F2SR-22qN; Fri, 21 Mar 2025 14:07:35 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvctu-0000000F0Wi-2JqO; Fri, 21 Mar 2025 13:59:07 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-39133f709f5so1091143f8f.0; Fri, 21 Mar 2025 06:59:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742565545; x=1743170345; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dL00t3QE4ASPpAeBNPhfJbN60yp6PFJbIaqm4DRKcSA=; b=VZNzdnVqMnDGfynH0zu1ovmn8V13pPHVAjJGzUWiS9qSC4LrkVTr3P4kCOPiVva7lc Gf51V20tkS35OAOUahZkWARVNwedXhxQ8Q/ILZBRz4HqBcgyat+M56sfXU6q/WQ+3lr0 aqoIfCMJisECXAtkMuTGwmOGiTSDBvYUSR5AVlRRB/eJLsoJyGzRHDP1GW8bMvsK7JnQ ssv5jYDNDgKCWjuSgC/YRoKEi8GbvFhB4xOVq+bXcZsq2SQcKekzsDw3ofBGOkYXO74i 0firu/y9gQuQEUYa7y786+/BIyf/PAMRRnGVXEGgIZyYvyHOXlf/ykDQchmzhdDJ7oMW jJbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742565545; x=1743170345; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dL00t3QE4ASPpAeBNPhfJbN60yp6PFJbIaqm4DRKcSA=; b=KskmrTfXQGYPBOhvH8gKLNNaP2XfB8oHCCWtzI+Fn/tqMfU9rJYnXYF4/xuX4UJ5Y0 etTleEU3+zBX0ru+Rw7a0U44PhnO/HjNWttJmV7fuoe+EPGEf72Cn/qkExt312d4VK33 8vi8Y5gbYEm96xGjX0TeWSH54vm19StVfzS7rbrNQ6HH+j4y0bxvTyktYCJHphPT/RQG uYZPe36qH2YHgaVdufesEPROgSMZWa76LGI/ZR8EC7wHuZeKom8l/51RsD8x0DES63iq l+kCtLQClfTGSxjJFxbocK8DHqZlgviMmIJo7HRxibZ/t0p9m8QE030XxmLGd+8QMKcz hAKQ== X-Forwarded-Encrypted: i=1; AJvYcCUc84C2msXBTZDazUCKn7TH/K+//GT5l5Pxs8qEp4t1wMXZ6AaTpD0e1jCqZD+EG4WpZ5SoBf5L9x+qN52lRI0n@lists.infradead.org, AJvYcCX/STkjSRiFdHTsR+GwH8T+YLvmVUTJNLKJtyCXmXfhk7M+abtNUcIMPL2hMoSTVz7qAlR0Gietg2BY@lists.infradead.org X-Gm-Message-State: AOJu0YzX7HEtkhX3qnlys4hNJNqT1FRwSuVcVHsdrIH2YogecE9z3ppj ooKzc3MJEuYPH4wuuauKlzEyGKHVhpt2FU3B8hARoCyJgH+ibb7vScamHg== X-Gm-Gg: ASbGnctNul192uEe0DYw8oWLOqRO5YHqYTGiKTVqNiieOgm1KXOWIudyJBedTv5M5oq bisNy9rX41KmiDUYtlPS30BUuQF4IQ8dvBhDLzdPRDJWnYEr0TV9A4PKDfVWsbOuRVsFBL7yQUj eBTlJvvlUNf7WDOgd0eWWuQKjbZY9ixON/bpUj4p99V3Wyq1pSy1S6dhc/N9t4QY888fG3eAqoK BV9v9PQWjWtRJBuywZ3Aif9OBQKuSZndHXXDS+z/E03Edz2R8AdOK7edD8zZAqVMLZ8KT1Mvf7T i6/CMsPJpKQU2ruRoFPiLjoM6byiW5HbLKOl633VmdYoi8cKxgZT9K/5lOBKKQQLtKjRtG4qgPL xg8dSKSQXrxhoGf2lyOzK X-Google-Smtp-Source: AGHT+IFquZF4hd4nWmTPWqI68wVcBaR6V5d+ZVDKcCwV1vPKm3ReaFGvjX+0+VE46ogmhHCnIcBjWg== X-Received: by 2002:a5d:64e4:0:b0:38f:3b9b:6f91 with SMTP id ffacd0b85a97d-3997f8fa8f5mr3266881f8f.12.1742565545103; Fri, 21 Mar 2025 06:59:05 -0700 (PDT) Received: from ivaylo-T580.. (91-139-201-119.stz.ddns.bulsat.com. [91.139.201.119]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9e6651sm2437162f8f.75.2025.03.21.06.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 06:59:04 -0700 (PDT) From: Ivaylo Ivanov To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Philipp Zabel , Marek Szyprowski , Sylwester Nawrocki , Abel Vesa Cc: linux-arm-msm@vger.kernel.org, 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 Subject: [PATCH v3 05/10] phy: phy-snps-eusb2: split phy init code Date: Fri, 21 Mar 2025 15:58:49 +0200 Message-ID: <20250321135854.1431375-6-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> References: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_065906_602253_DF03522E X-CRM114-Status: GOOD ( 15.27 ) 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 current phy init consists of hardware power-up, as well as QCOM-specific eUSB2 init code. Split it into two parts, to make room for such non-QCOM init code. Signed-off-by: Ivaylo Ivanov Reviewed-by: Dmitry Baryshkov --- drivers/phy/phy-snps-eusb2.c | 96 +++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 33 deletions(-) diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c index 405278c18..fa878389f 100644 --- a/drivers/phy/phy-snps-eusb2.c +++ b/drivers/phy/phy-snps-eusb2.c @@ -121,6 +121,10 @@ static const char * const eusb2_hsphy_vreg_names[] = { #define EUSB2_NUM_VREGS ARRAY_SIZE(eusb2_hsphy_vreg_names) +struct snps_eusb2_phy_drvdata { + int (*phy_init)(struct phy *p); +}; + struct snps_eusb2_hsphy { struct phy *phy; void __iomem *base; @@ -133,6 +137,8 @@ struct snps_eusb2_hsphy { enum phy_mode mode; struct phy *repeater; + + const struct snps_eusb2_phy_drvdata *data; }; static int snps_eusb2_hsphy_set_mode(struct phy *p, enum phy_mode mode, int submode) @@ -230,41 +236,11 @@ static int qcom_eusb2_ref_clk_init(struct snps_eusb2_hsphy *phy) return 0; } -static int snps_eusb2_hsphy_init(struct phy *p) +static int qcom_snps_eusb2_hsphy_init(struct phy *p) { struct snps_eusb2_hsphy *phy = phy_get_drvdata(p); int ret; - ret = regulator_bulk_enable(ARRAY_SIZE(phy->vregs), phy->vregs); - if (ret) - return ret; - - ret = phy_init(phy->repeater); - if (ret) { - dev_err(&p->dev, "repeater init failed. %d\n", ret); - goto disable_vreg; - } - - ret = clk_prepare_enable(phy->ref_clk); - if (ret) { - dev_err(&p->dev, "failed to enable ref clock, %d\n", ret); - goto disable_vreg; - } - - ret = reset_control_assert(phy->phy_reset); - if (ret) { - dev_err(&p->dev, "failed to assert phy_reset, %d\n", ret); - goto disable_ref_clk; - } - - usleep_range(100, 150); - - ret = reset_control_deassert(phy->phy_reset); - if (ret) { - dev_err(&p->dev, "failed to de-assert phy_reset, %d\n", ret); - goto disable_ref_clk; - } - snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG0, CMN_CTRL_OVERRIDE_EN, CMN_CTRL_OVERRIDE_EN); @@ -334,6 +310,52 @@ static int snps_eusb2_hsphy_init(struct phy *p) USB2_SUSPEND_N_SEL, 0); return 0; +} + +static const struct snps_eusb2_phy_drvdata sm8550_snps_eusb2_phy = { + .phy_init = qcom_snps_eusb2_hsphy_init, +}; + +static int snps_eusb2_hsphy_init(struct phy *p) +{ + struct snps_eusb2_hsphy *phy = phy_get_drvdata(p); + int ret; + + ret = regulator_bulk_enable(ARRAY_SIZE(phy->vregs), phy->vregs); + if (ret) + return ret; + + ret = phy_init(phy->repeater); + if (ret) { + dev_err(&p->dev, "repeater init failed. %d\n", ret); + goto disable_vreg; + } + + ret = clk_prepare_enable(phy->ref_clk); + if (ret) { + dev_err(&p->dev, "failed to enable ref clock, %d\n", ret); + goto disable_vreg; + } + + ret = reset_control_assert(phy->phy_reset); + if (ret) { + dev_err(&p->dev, "failed to assert phy_reset, %d\n", ret); + goto disable_ref_clk; + } + + usleep_range(100, 150); + + ret = reset_control_deassert(phy->phy_reset); + if (ret) { + dev_err(&p->dev, "failed to de-assert phy_reset, %d\n", ret); + goto disable_ref_clk; + } + + ret = phy->data->phy_init(p); + if (ret) + goto disable_ref_clk; + + return 0; disable_ref_clk: clk_disable_unprepare(phy->ref_clk); @@ -371,6 +393,7 @@ static int snps_eusb2_hsphy_probe(struct platform_device *pdev) struct snps_eusb2_hsphy *phy; struct phy_provider *phy_provider; struct phy *generic_phy; + const struct snps_eusb2_phy_drvdata *drv_data; int ret, i; int num; @@ -378,6 +401,11 @@ static int snps_eusb2_hsphy_probe(struct platform_device *pdev) if (!phy) return -ENOMEM; + drv_data = of_device_get_match_data(dev); + if (!drv_data) + return -EINVAL; + phy->data = drv_data; + phy->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(phy->base)) return PTR_ERR(phy->base); @@ -424,8 +452,10 @@ static int snps_eusb2_hsphy_probe(struct platform_device *pdev) } static const struct of_device_id snps_eusb2_hsphy_of_match_table[] = { - { .compatible = "qcom,sm8550-snps-eusb2-phy", }, - { }, + { + .compatible = "qcom,sm8550-snps-eusb2-phy", + .data = &sm8550_snps_eusb2_phy, + }, { }, }; MODULE_DEVICE_TABLE(of, snps_eusb2_hsphy_of_match_table); From patchwork Fri Mar 21 13:58:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 14025514 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 E23D4C36000 for ; Fri, 21 Mar 2025 14:09:18 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Jw7CFF0SGgyk9wkysFdJwBGftq+5eSjOhdlNLb0GVBY=; b=Poo8eeKMISXkQT haEZLUIiXZHAI1L2BUQeo04PD9E1M7LQs6eAT42tQXjVF2643suW7zyRRutw66ycgGoCXhKhu16Ic UGiuyAbYALWpnmitiHtUUv/cKmTC7pSTh9mVZsG1RjjmR32hMtlkZfO9Dhos1a3xI1B3T0jIBcsSJ tid9UfxqJNCjPWl55WQemD5O0yczhChFK/pOtx0LrBsDJACw8qkODi3RTMIUXSqcKeH9XeRGELooL bMK4Y40Bdn23kZ76kU3sqlnfmNgHF86TWozgnAanUxy90PWJx1VoBRxYd6JxYunay9i0D8SaYsFE1 vLe5OuiKT6MeXfJ0oxWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvd3m-0000000F2mX-28Fw; Fri, 21 Mar 2025 14:09:18 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvctw-0000000F0X6-0NV9; Fri, 21 Mar 2025 13:59:09 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43948f77f1aso12700645e9.0; Fri, 21 Mar 2025 06:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742565546; x=1743170346; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yKyiSlNdwX7DjF+cflTvTcf4eOt0dAS41mN07rs6ryI=; b=iIiVyVbRLzOM+L8N8KQMJWZ3ROpkunBVl48BKHE6KFF4Q3i/kCpZd8L5Jr3BsqdJGk yzKn6LEWP+sPSFqrCuSoEgSAJmKJa+DlZpkhSJq24S6k2CvNXklJLgzKWMVDr9eQEV7Q G105YYgW5Xww7yxhF1FRzXANnj09Ttu/ONY4amGmzNlh6hpB1liOHffA8QAqTNUKIrG4 wgkd3OG7R6AWMf7hKmwRRuCaRhYmw/n/Z1/R9ddOSOQ+JLvx5x+Y+8HGzLbR2heVwS5z i/1lu2KJ+3aqEpdlJ+pvnTOlKr1iy3z8cKMSk1dKTWjgn2kcGu2vWZEzWhkeLplfF6W6 NVtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742565546; x=1743170346; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yKyiSlNdwX7DjF+cflTvTcf4eOt0dAS41mN07rs6ryI=; b=QO8bdsDK0GBYHWoefVojXvE3lo2xSsEFfdINlo/0ePKrJvQhyLnt1LcW6opbY40yJ7 NJm+9A5tSwEe7tnyRKxcVdc+Mio9xLffPTYkORL1O/tNxGp9boJ5IgSzY5NESm+pWrX3 lO3+Qo9yqDjxFnvw3GzuF0NLvpIs/Leu46WcumLEdjbc+cEef/EwE/Ik8cdiM8sUcM2T vvybFcQEtJqGSDNHJO8U5EE8MTGdtA0rhIgNGpOu1eKxzlNh0FGSCJbaTBoQyqZWfxdP FSrWxFFKqQaJizRil90q5XDvoyzJrqD8TgYjdb58p1ybT0/DSl7tM1tSWO3DX5c89JJU Bf5w== X-Forwarded-Encrypted: i=1; AJvYcCV6XpCJctS6QxBcVYaTOgU9D7SeNX8752vNKDXB7EzSfVHTlVIzJorwUO4s0mf7zTMJ/febJNRj5VjW@lists.infradead.org, AJvYcCX9YbCyYwR6hbQyf1VxMV5oaTIwkXA4iFMK1VwnGX6w54EAT9bMRw5/7a578oA3Clk6kjiAgPMw25/chBJMtnIK@lists.infradead.org X-Gm-Message-State: AOJu0YwR5cmj95DnV9BAH/R4lbbsRVBDNfYkUPXxU+zVle3oXu30PmeH QPlonD9zoQsxMuD7EVYAcn5mZNYWllg4jgFLvfJLhNqEXOb/CxXz X-Gm-Gg: ASbGncvdz3f+MAbbUI6tkNxvdTkH0wc0tUTHCJC82kzMmrGaTeUSLHlwHbIVqP8/WYV vo9N3U8mGB0Ah5Mw2IuYqylgvmyBW0myCtdm+98/afHihJWHQCg0Y6dOGJRaCS9luyGSB/Y25r7 8xccPn5VxxBqfAIX2Dqq8Y0LNHIw1/fNvvXT29Pi7IHv20V8xe1Wr6SBdRbTuxrXedxrGivjuEl 4l7wLpOPILQQb14am+PsB+mtfPCp2o79Ewyzo1SqDu7/cO/kSyosesVetz/F/vNSevm6qNlA7fL 4ow8B/RJAEx0NcCB785V2SgH1IlxrUnh5JuhzJ4iAtBAcUCmWY21K+LDauDglow0qPNTilE+/2m 6EYeZlQwV9q8Iit/rW/oc X-Google-Smtp-Source: AGHT+IHKCNFnqK6pDIgCowKP73ucm3N0R/ZSYYNAOEojeB9gyAuveeAPgC5emyHRkRJvTkfkUr+V4w== X-Received: by 2002:a05:6000:1ac8:b0:390:e853:85bd with SMTP id ffacd0b85a97d-3997f9371f1mr4236408f8f.48.1742565546499; Fri, 21 Mar 2025 06:59:06 -0700 (PDT) Received: from ivaylo-T580.. (91-139-201-119.stz.ddns.bulsat.com. [91.139.201.119]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9e6651sm2437162f8f.75.2025.03.21.06.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 06:59:06 -0700 (PDT) From: Ivaylo Ivanov To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Philipp Zabel , Marek Szyprowski , Sylwester Nawrocki , Abel Vesa Cc: linux-arm-msm@vger.kernel.org, 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 Subject: [PATCH v3 06/10] phy: phy-snps-eusb2: make repeater optional Date: Fri, 21 Mar 2025 15:58:50 +0200 Message-ID: <20250321135854.1431375-7-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> References: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_065908_126579_E5EF58FA X-CRM114-Status: GOOD ( 15.18 ) 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 As described in the device tree bindings, it's not necessary for the SNPS eUSB2 phy to be connected to a repeater. In configurations where there are such instances, the driver probing fails and the usb controller does not work. Make the repeater optional to avoid that, which also lets us use the eUSB2 phy when it's connected to a repeater that is not configurable by the kernel (for example it's missing a driver), as long as it has been configured beforehand (usually by the bootloader). Signed-off-by: Ivaylo Ivanov Acked-by: Neil Armstrong Reviewed-by: Dmitry Baryshkov --- drivers/phy/phy-snps-eusb2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c index fa878389f..8ccd432a0 100644 --- a/drivers/phy/phy-snps-eusb2.c +++ b/drivers/phy/phy-snps-eusb2.c @@ -428,7 +428,7 @@ static int snps_eusb2_hsphy_probe(struct platform_device *pdev) return dev_err_probe(dev, ret, "failed to get regulator supplies\n"); - phy->repeater = devm_of_phy_get_by_index(dev, np, 0); + phy->repeater = devm_of_phy_optional_get(dev, np, 0); if (IS_ERR(phy->repeater)) return dev_err_probe(dev, PTR_ERR(phy->repeater), "failed to get repeater\n"); From patchwork Fri Mar 21 13:58:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 14025515 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 A3A88C36000 for ; Fri, 21 Mar 2025 14:11:00 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J34+ml2yAjC5FTpCbdp8QW6cM/kXYZPbay0GvxlMvTk=; b=k54p8Sn/kTmX49 jFWvHFVeT56pTDXQ4Ls95UuDJf30BECuvclqeUBK7hFagXkTNynjZEJ0tsC82/LyIQI35NYAClnU0 ppz7Bt1cQ81CTA8/sbaZmZ83uKjiswEI+Isl+cchQ6KkbdkJpl/89muuT7chM6vj6iAGiK2IGFVeg gFykDaPEmp5CWvYRIs9ROwx3cnUc1S6F/izl1uxoHpl+vS1842C36Z76ExEjdPcSIyiIIdce0zfmE 4y50vVnV44KY1kDg/089CacYZ+7jPU8rSKQk4xsAWO2m9CD4j2tLl+8L5YPA6QTandd0O3wVz4hpZ KjrDx/ajHkdP/6C3+ACg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvd5Q-0000000F363-1pUx; Fri, 21 Mar 2025 14:11:00 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvctx-0000000F0Xu-2S05; Fri, 21 Mar 2025 13:59:10 +0000 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3912d2c89ecso1831849f8f.2; Fri, 21 Mar 2025 06:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742565548; x=1743170348; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uD97zpV+wlCAc5Dqa3CJHXuYAasrjMGVcgw8nIaOK+Y=; b=bnnTj29NSjNuvbqBGdf2KAsIrAhRw3GmeocbR8RsldzDsrUpA5i3Rh8luK2D4MxU/c wE4T5H1FSllUwaO/AirAouuzDnU0B95DGLx39g+1REh5UfON2hdLRtXj2vTxg/wREQ7L LE/Vop3BKmI7xVfH61Wc/2pGndJ7agEwAYOPkrgbskMO3Rp6l6fzVkUCPdkb09F9ql4I vcrHftfWPbaztI5oVob12oOFsLizlkWZ1kginggW4iUSDrvHp55Lu6YXe/W9OjIbziz4 BKj1UohSJWphEW8/n8wAb3Om4ZfaCeTEosV/rQFMvE2GHXSHsdWoQNTQHGkENjXSUb4F kOrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742565548; x=1743170348; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uD97zpV+wlCAc5Dqa3CJHXuYAasrjMGVcgw8nIaOK+Y=; b=hU5JxF5vg05zx5Jq01Cl+klZas12t+yddfzNH0vS0+rRsyXaPEqBHG5nFyMoNTjTtZ vHe9IO/lHhRa23Xj2F63rj804juNZyx/8E14ZXFc8YXBVSTE83nPWLAZ1qYMV67Axqv+ 4gwboqhi3xHH5GtvdrQwOnEdZ/Pey0V2tnOGJK2KvRmWtEErs8Xy3n9nlNsgLrEpmdYv CBvYI9kxaKTObDzn1UeGiCK1c7FaZgvnskTvrvsSnmtNTneisi9/KUPSV688RZaflxit TmBnmYQ6kLW66oAGUjzWEOsMHwkSGjvqtWPZZFyu8ghFC4Djtq0xG5HqMmEXPmGM1Dqc cXVg== X-Forwarded-Encrypted: i=1; AJvYcCUiPMImquwaxCdsNe3dE55UmnmXuHjXamY6ccIF04EaNyy819SMsaY6o92DuoT1erpLbRJ4Ggth97CU@lists.infradead.org, AJvYcCV7HjsnkCn5tDMvUHVE4ZsuI1sjttTW1ZikTS2wNtNTA3VoZyuJFtAVm/4FWFwWYcwE0hcZmqMqULVeUwRgJtxq@lists.infradead.org X-Gm-Message-State: AOJu0YydEHLlF2ekb4O92ed9gZLptfuQT6/qAdD13aRIe8ur3lyQkDOC Hhj0LPPfZC0lhMIyYT0uFEHbUDET+Vl/pCZPV01GvWZhF9i2OHU4 X-Gm-Gg: ASbGnctSmKbZLPxHWlh0sa/h3Y2HH+SknlX794aP0MDhdGmGuvj75mp09oyf426uRo5 vEtFYdAyM/hwBxVEc/j/5KpiR7HY94bAH15Ww4g3jcDpGgDGZRQ3M9AKFRbPenuroC8ewRvxvCP hX1rccmZdCCfSEmHxQ+qa6qCA+6IYnjiUVooeZQUtHW8t6WUPVw8AIb6/Hsoj4hz1EeJYvive/H rXYpWC+nRYVEevJsYxNgIpYRO9TLR00P0iQ1HSQ7jDkX58fb3gyD2XqvZntAssiGE5gDU+ajir2 Ie66q3Ik9GN2HRsa+xl2gtS9lYZINSZ3AggDgXxs1dNIy94zU7KeBeJsQr9piOACYq5IDpQ5xS6 hsiK8NBBlurQYjyX2Otln X-Google-Smtp-Source: AGHT+IHNglCQ4pfTDqUg0F9f2emm3ZLLUSteSk2Ug+yZnhnzh83HDlmHCb8q2+bgezMSK3osOJoQPw== X-Received: by 2002:a5d:6d88:0:b0:391:1473:336a with SMTP id ffacd0b85a97d-3997f937d76mr3249245f8f.36.1742565547842; Fri, 21 Mar 2025 06:59:07 -0700 (PDT) Received: from ivaylo-T580.. (91-139-201-119.stz.ddns.bulsat.com. [91.139.201.119]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9e6651sm2437162f8f.75.2025.03.21.06.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 06:59:07 -0700 (PDT) From: Ivaylo Ivanov To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Philipp Zabel , Marek Szyprowski , Sylwester Nawrocki , Abel Vesa Cc: linux-arm-msm@vger.kernel.org, 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 Subject: [PATCH v3 07/10] phy: phy-snps-eusb2: make reset control optional Date: Fri, 21 Mar 2025 15:58:51 +0200 Message-ID: <20250321135854.1431375-8-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> References: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_065909_622410_23426000 X-CRM114-Status: GOOD ( 11.39 ) 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 Not all SoCs expose the reset line controls to the kernel, so make them optional. Signed-off-by: Ivaylo Ivanov Reviewed-by: Dmitry Baryshkov --- drivers/phy/phy-snps-eusb2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c index 8ccd432a0..1e7e75bbc 100644 --- a/drivers/phy/phy-snps-eusb2.c +++ b/drivers/phy/phy-snps-eusb2.c @@ -410,7 +410,7 @@ static int snps_eusb2_hsphy_probe(struct platform_device *pdev) if (IS_ERR(phy->base)) return PTR_ERR(phy->base); - phy->phy_reset = devm_reset_control_get_exclusive(dev, NULL); + phy->phy_reset = devm_reset_control_get_optional_exclusive(dev, NULL); if (IS_ERR(phy->phy_reset)) return PTR_ERR(phy->phy_reset); From patchwork Fri Mar 21 13:58:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 14025520 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 97918C36000 for ; Fri, 21 Mar 2025 14:12:43 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HyoGgVyDr7m6l+2kqGhHAc7NiJ6tHD7Ce0ohLrp3Src=; b=GSwOBHplvnEnMk cuW3n/UZ7tM6OXito/O/ozKiOV+aqJ5h2Py7F9tQlTlkIyGRI//8BrlMPw0Q+UsCGOTJVpfoIa/qh rNGWdO0LsoSvIzLDd34Pd5RLGGFYObBkSGhr0C5KO7kIFrJn5V0sqclWiGt/Orw8/A7PJEyU4MxFg mNyXsJYXlFutI7G3ByqWT9mfGv/Ll6idyNuz+E1XN3oTNOOBWlqVwFIQDn7Pe8m6/yGI8Kgjg04Kv z3UlVfmYX2SsquSZ0PRv+On7eqqWTqHZaxcE8jUR4m8Ph0+fFEHlS29sMEAhCvcyibtY28jhLD+RY BxrXxcPBz+iR9uuC0+4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvd75-0000000F3Rb-1b8N; Fri, 21 Mar 2025 14:12:43 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvcty-0000000F0YH-2n2p; Fri, 21 Mar 2025 13:59:11 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3912e96c8e8so1236168f8f.2; Fri, 21 Mar 2025 06:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742565549; x=1743170349; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sbyZcoaajFlmts2XUhsZjMQOjAP2jAbADTedozzwVLU=; b=UgFpvNyzKBlBAV2Hp9LRWI/lbGlYdd8vam7/MD8kgB0hZIORO4ziDormdH2KzuVLFB Hgdbcv5tbOo3rajp4sVIdKOQMXtFbylJ9+j6yOYtlretFq+E1pV+odA9hFc8kOlAOAAc 58pNFi0yQIuUWyz03ZMIVx9sAEeMixl9tk2dYURG4FbbpG78QLx4d5HT8ig0q68nongo gLvTIOSz+O2fv1gaD3XEX4/MgRWX0UG9tGXQ302IbUbiGjW8tDus30GpAxTsNxIFfpzi lI0WDSv3TVQexDe1q4iXGOPU5GRI/wuANpzPO1QiOTnM7SunIf1ervhHbmGMwXUOIf44 olLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742565549; x=1743170349; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sbyZcoaajFlmts2XUhsZjMQOjAP2jAbADTedozzwVLU=; b=KjvPFcBmZyrLzPdT91Y/ELcQWuTwGMQQXHPb6d2BZQ9m+B2g/5lfBE3S640mnsM0CT 6LRDAJoALz1gE+E/ec9B7iFNL2XiMw0fx18Y1OC3YjhOF2QMZGwpop34UCMhl/6fScvH h1BYi+Kqqe5kEnKhCyyz/lh7H4brXy8Lthp8sQBGckErS4kOq/GoGi+5LEeOANlsbF93 WXibITayRgIvqhoLbuXZ6GPgVXX6S6gQmMuiamsZlelQC1iOzgVFTLLTFAxxLQ2gNtT5 faIb8qxOraqgc/oB3yMEebFTk+JgiWiUk9zyd0nAjZaDY2RpvUmtMc4akL+9f8czb4xR 8ghQ== X-Forwarded-Encrypted: i=1; AJvYcCWqM1/zO5fEjdbNe68bQR0UZRAHDatoKsLnSjXoMn+4uYZJl6Ew4DS4JJkmwkvOQQ3UPVgyJx5fCk2b@lists.infradead.org, AJvYcCXECu9NQP6NwyWU5m84ECYnCz13zDlVbJGHC+rZ2CGV/gwlvU/vjH6M7Fg4RP4jZlC5z6xhZBXsJtVPo3AkixZu@lists.infradead.org X-Gm-Message-State: AOJu0Yyh7oqWkMLUTLeVGMH1ew60wlJXI3A9a6wgvo5xDuCKZDmXEpXL nFh6DkwxFlH0wPlrS6cPQhBtSmNDn2S9baiujBi91NouovOOwreH X-Gm-Gg: ASbGncvMzq5/lFL8Lyx9cohPV1xWdG4U9d4PMU2a1Cw4jYB0P6AQw7niaRnnJkbGtOG SswR1Ja8EMg5MaorKUOZAs6wtfWqPJgTPs6+XIlXbNqgYalOTun/c1w74jZtd6rbf276x+xb4zg 2clOi2TReZ/0QhGInfSAWqJp2xO8GNNYa/7u3kyFRfSjkVwYZMnISPUnnlxbbFgqxJk6xpxMEHW OptcW0jOaxqcDi8MRMn9Tpdv8tvW3D1/0hRWz+c6TjZAqKNrWXYbjzNCeJYS9NrL1X6BENU20TY iu2KBBbiqjt6T6bAfDhUqwlBTULiiYMevaQIPMNV0cJ2Pv1FhWtJeP2A5EWBzagt/3PGxUBqTC+ 57/ji9sjROufi6EytxTON X-Google-Smtp-Source: AGHT+IH5K8T4c9k4ekIQnpelX9sEZXchTsHL4Ta9XthUbbS4ibsFVFojmfNk/OO/KF7tgKLwgcCcCA== X-Received: by 2002:a05:6000:1a8e:b0:391:4559:8773 with SMTP id ffacd0b85a97d-3997f938993mr3360194f8f.51.1742565549242; Fri, 21 Mar 2025 06:59:09 -0700 (PDT) Received: from ivaylo-T580.. (91-139-201-119.stz.ddns.bulsat.com. [91.139.201.119]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9e6651sm2437162f8f.75.2025.03.21.06.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 06:59:08 -0700 (PDT) From: Ivaylo Ivanov To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Philipp Zabel , Marek Szyprowski , Sylwester Nawrocki , Abel Vesa Cc: linux-arm-msm@vger.kernel.org, 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 Subject: [PATCH v3 08/10] phy: phy-snps-eusb2: refactor reference clock init Date: Fri, 21 Mar 2025 15:58:52 +0200 Message-ID: <20250321135854.1431375-9-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> References: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_065910_708486_5D77C647 X-CRM114-Status: GOOD ( 12.18 ) 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 Instead of matching frequencies with a switch and case, introduce a table-based lookup. This improves readability, reduces redundancy, and makes it easier to extend support for additional frequencies in the future. Signed-off-by: Ivaylo Ivanov Reviewed-by: Dmitry Baryshkov --- drivers/phy/phy-snps-eusb2.c | 61 +++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c index 1e7e75bbc..4ca11860a 100644 --- a/drivers/phy/phy-snps-eusb2.c +++ b/drivers/phy/phy-snps-eusb2.c @@ -192,44 +192,47 @@ static void qcom_eusb2_default_parameters(struct snps_eusb2_hsphy *phy) FIELD_PREP(PHY_CFG_TX_HS_XV_TUNE_MASK, 0x0)); } +struct snps_eusb2_ref_clk { + unsigned long freq; + u32 fsel_val; + u32 div_7_0_val; + u32 div_11_8_val; +}; + +static const struct snps_eusb2_ref_clk qcom_eusb2_ref_clk[] = { + { 19200000, FSEL_19_2_MHZ_VAL, DIV_7_0_19_2_MHZ_VAL, DIV_11_8_19_2_MHZ_VAL }, + { 38400000, FSEL_38_4_MHZ_VAL, DIV_7_0_38_4_MHZ_VAL, DIV_11_8_38_4_MHZ_VAL }, +}; + static int qcom_eusb2_ref_clk_init(struct snps_eusb2_hsphy *phy) { + const struct snps_eusb2_ref_clk *config = NULL; unsigned long ref_clk_freq = clk_get_rate(phy->ref_clk); - switch (ref_clk_freq) { - case 19200000: - snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL_COMMON0, - FSEL_MASK, - FIELD_PREP(FSEL_MASK, FSEL_19_2_MHZ_VAL)); - - snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_2, - PHY_CFG_PLL_FB_DIV_7_0_MASK, - DIV_7_0_19_2_MHZ_VAL); - - snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_3, - PHY_CFG_PLL_FB_DIV_11_8_MASK, - DIV_11_8_19_2_MHZ_VAL); - break; - - case 38400000: - snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL_COMMON0, - FSEL_MASK, - FIELD_PREP(FSEL_MASK, FSEL_38_4_MHZ_VAL)); - - snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_2, - PHY_CFG_PLL_FB_DIV_7_0_MASK, - DIV_7_0_38_4_MHZ_VAL); - - snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_3, - PHY_CFG_PLL_FB_DIV_11_8_MASK, - DIV_11_8_38_4_MHZ_VAL); - break; + for (int i = 0; i < ARRAY_SIZE(qcom_eusb2_ref_clk); i++) { + if (qcom_eusb2_ref_clk[i].freq == ref_clk_freq) { + config = &qcom_eusb2_ref_clk[i]; + break; + } + } - default: + if (!config) { dev_err(&phy->phy->dev, "unsupported ref_clk_freq:%lu\n", ref_clk_freq); return -EINVAL; } + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_HS_PHY_CTRL_COMMON0, + FSEL_MASK, + FIELD_PREP(FSEL_MASK, config->fsel_val)); + + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_2, + PHY_CFG_PLL_FB_DIV_7_0_MASK, + config->div_7_0_val); + + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_3, + PHY_CFG_PLL_FB_DIV_11_8_MASK, + config->div_11_8_val); + snps_eusb2_hsphy_write_mask(phy->base, QCOM_USB_PHY_CFG_CTRL_3, PHY_CFG_PLL_REF_DIV, PLL_REF_DIV_VAL); From patchwork Fri Mar 21 13:58:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 14025521 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 D6B33C36000 for ; Fri, 21 Mar 2025 14:14:25 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vJOHLcmNOKjRX+TK+5boHKB7U7wgTo4GRRDrWD8aQcg=; b=uJQpx0wXaef2Fe AshA4ai5Y1LQcAaLumFRlOuL+Hg/JR8Kcr9DLd5SHe4l6hdXBN5vYVdrYLsojzvbdE4E+R1OGkqAW 0Q+om60E/6GGrfaCJahqpB0eapP/I0ofpAckEoh4zs6qj5Jql7rcsrKdVPZ4d1Q2dKWqGDhOaCGVI NGBXI+RC8I4Jrca7cJ+xWdy6z0eDhZRDuYtQpwjSNtucd1UPaw4BGzR5u2NM2T9BYE1Yjit3Zw9rK mFvw7ER8zUirO2bqgLUFVPyCfc2EBDMh8/6CGfX0e0lH/DpwoUIEqbYBc0HRch0C6BXhvFMNCYaNt fE7xAhqQos/EpHc29S6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvd8j-0000000F3mm-2fKt; Fri, 21 Mar 2025 14:14:25 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvcu0-0000000F0Yx-2hYR; Fri, 21 Mar 2025 13:59:13 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43d0618746bso14030155e9.2; Fri, 21 Mar 2025 06:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742565551; x=1743170351; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CgZMHv0Maj+ykqpVS5qC2n9kdvYUkd9lbOYXYbxjsJY=; b=GiGmLxB3QqVI1ws9iKfTAGTD4WNEownPGK45zQx42EkSgpl3QhU66hOcFJ3WYrIEst 4Ok8VyeP6/VVScSv28UW2d0E0g13I4uNhZX3elHUrjBvCmEKAgToY4EMn0a5R6q8eDFP A4ZCE5HsAnAGB6RmV9CsIAl3tiIHUH2Critc0+nUDQ5IBGddXvAMrOdnAAqcztj8t4De hdxOL3TR1GUu8kjt61Q0XwkMc/BMblNg5zTRQvMsckN9+dGv7tri5qnxsQdPfmjP6//u 0DZuMHpWQoxTEfjmkDiY53GhorC6PQY7Nk1kreVSsKRUS3ay7orXosaXzi+9OkEsAVUe o3sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742565551; x=1743170351; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CgZMHv0Maj+ykqpVS5qC2n9kdvYUkd9lbOYXYbxjsJY=; b=Z7gCPh7ZHJyURsObgvY3r680+NArOPlp7gBof1A1LrRcyGDdvAvuv/cAXuILhNekX0 ad0qS8T+dtjpgtl+xyg+Y89ETFO22wIQjIJCLJKW1p7bUhoe4LZKTuzpJinoRF/KNF74 J36x5JXMn8kYcPWsWjwQLm/YMMFv+NGOLJMYnWUMGKeTAGIbZ7bW1qKBJj6nvDGda1LE 0lFsm7uydiD9HmT0nPX+cAlZ0kDlfYS9h48t6yLbztr8hF6V4XpEHXT+9pmAh0sunZC1 lh1iYDgJkQOvnoCmnfTS6RN0OThKNfnEq2z4Dvj8djh/Kz7hTY1NTMON6ZZtCIu8o0ap aakA== X-Forwarded-Encrypted: i=1; AJvYcCX2kbLhsEnCkhVKiEQgX/629COL2StNOOh0I2G/7OvH9QnJeFtDYx7qVnXN6yZTZAI7c4jqPASAnQPd@lists.infradead.org, AJvYcCXuk7AYBghY6xRxaXlFBE6I1RFdKVn0wjkKtPKPYV8NsRzMuGWFzTk6cWdlruAniM4mIEthxoWLOtDs9fjOPec9@lists.infradead.org X-Gm-Message-State: AOJu0YzLW8eEQ8APar5zDax0Ctm+/gQ7/Ppxnp5sPcKoW2Hmj9nQLTyn dggeqV+wZ0jTaYpoiExZGjo1EH9VlrH6wYzzyTFj/4lLOalqaydn X-Gm-Gg: ASbGncuqDOlVTTGsX63zZqMx3y3hrOCf/04LTpLESFlfSCmWvVfuj8QFs3sEWiunftS gQtmJpuzmAKNzbVNPFAaznNRl3WgwnE71FD3QPlVuA3lkeo7/vGp70XGao2cTtn87G/LRfP3U9N 3+imFI7bRcRQ/ud4Xb1kjjzP62B6qgh8U6aqMRSxCLoLUL/18g5pDVw9jowXiO33bfVxWoCxKEz Hrf6OSYWtl5KDCyovfO2sgXaLk7WMP8B3Gy0wppULJQHBZ8Vm4cVGEMX8V+46c3K8IbKSI5KMDi iPD5BUHGKYgh7Tc8vT6dh261MBTBGRnHzzHCqC8c9irN0e5gpizpfZmQeCbDRyh+MA4bcD7A/yr djzpJtJRHq9YBLFwaV9+A X-Google-Smtp-Source: AGHT+IG483kXiPjaAemdueHV42vkF2NnkMPu50jCxoNzdFurIxOd7T8xvIFGk0X9jQOIsr28IXGPnw== X-Received: by 2002:a05:600c:1f92:b0:43d:45a:8fca with SMTP id 5b1f17b1804b1-43d50a3c79fmr27723135e9.30.1742565550669; Fri, 21 Mar 2025 06:59:10 -0700 (PDT) Received: from ivaylo-T580.. (91-139-201-119.stz.ddns.bulsat.com. [91.139.201.119]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9e6651sm2437162f8f.75.2025.03.21.06.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 06:59:10 -0700 (PDT) From: Ivaylo Ivanov To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Philipp Zabel , Marek Szyprowski , Sylwester Nawrocki , Abel Vesa Cc: linux-arm-msm@vger.kernel.org, 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 Subject: [PATCH v3 09/10] phy: phy-snps-eusb2: add support for exynos2200 Date: Fri, 21 Mar 2025 15:58:53 +0200 Message-ID: <20250321135854.1431375-10-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> References: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_065912_694211_0970B074 X-CRM114-Status: GOOD ( 21.65 ) 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 Exynos2200 SoC reuses the Synopsis eUSB2 PHY IP, alongside an external repeater, for USB 2.0. Add support for it to the existing driver, while keeping in mind that it requires enabled more than the reference clock. Signed-off-by: Ivaylo Ivanov Acked-by: Dmitry Baryshkov --- drivers/phy/Kconfig | 2 +- drivers/phy/phy-snps-eusb2.c | 162 ++++++++++++++++++++++++++++++++++- 2 files changed, 159 insertions(+), 5 deletions(-) diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 11c166204..58c911e1b 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -45,7 +45,7 @@ config PHY_PISTACHIO_USB config PHY_SNPS_EUSB2 tristate "SNPS eUSB2 PHY Driver" - depends on OF && (ARCH_QCOM || COMPILE_TEST) + depends on OF && (ARCH_EXYNOS || ARCH_QCOM || COMPILE_TEST) select GENERIC_PHY help Enable support for the USB high-speed SNPS eUSB2 phy on select diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c index 4ca11860a..951f58119 100644 --- a/drivers/phy/phy-snps-eusb2.c +++ b/drivers/phy/phy-snps-eusb2.c @@ -13,6 +13,39 @@ #include #include +#define EXYNOS_USB_PHY_HS_PHY_CTRL_RST (0x0) +#define USB_PHY_RST_MASK GENMASK(1, 0) +#define UTMI_PORT_RST_MASK GENMASK(5, 4) + +#define EXYNOS_USB_PHY_HS_PHY_CTRL_COMMON (0x4) +#define RPTR_MODE BIT(10) +#define FSEL_20_MHZ_VAL (0x1) +#define FSEL_24_MHZ_VAL (0x2) +#define FSEL_26_MHZ_VAL (0x3) +#define FSEL_48_MHZ_VAL (0x2) + +#define EXYNOS_USB_PHY_CFG_PLLCFG0 (0x8) +#define PHY_CFG_PLL_FB_DIV_19_8_MASK GENMASK(19, 8) +#define DIV_19_8_19_2_MHZ_VAL (0x170) +#define DIV_19_8_20_MHZ_VAL (0x160) +#define DIV_19_8_24_MHZ_VAL (0x120) +#define DIV_19_8_26_MHZ_VAL (0x107) +#define DIV_19_8_48_MHZ_VAL (0x120) + +#define EXYNOS_USB_PHY_CFG_PLLCFG1 (0xc) +#define EXYNOS_PHY_CFG_PLL_FB_DIV_11_8_MASK GENMASK(11, 8) +#define EXYNOS_DIV_11_8_19_2_MHZ_VAL (0x0) +#define EXYNOS_DIV_11_8_20_MHZ_VAL (0x0) +#define EXYNOS_DIV_11_8_24_MHZ_VAL (0x0) +#define EXYNOS_DIV_11_8_26_MHZ_VAL (0x0) +#define EXYNOS_DIV_11_8_48_MHZ_VAL (0x1) + +#define EXYNOS_PHY_CFG_TX (0x14) +#define EXYNOS_PHY_CFG_TX_FSLS_VREF_TUNE_MASK GENMASK(2, 1) + +#define EXYNOS_USB_PHY_UTMI_TESTSE (0x20) +#define TEST_IDDQ BIT(6) + #define QCOM_USB_PHY_UTMI_CTRL0 (0x3c) #define SLEEPM BIT(0) #define OPMODE_MASK GENMASK(4, 3) @@ -123,6 +156,8 @@ static const char * const eusb2_hsphy_vreg_names[] = { struct snps_eusb2_phy_drvdata { int (*phy_init)(struct phy *p); + const char * const *clk_names; + int num_clks; }; struct snps_eusb2_hsphy { @@ -130,6 +165,7 @@ struct snps_eusb2_hsphy { void __iomem *base; struct clk *ref_clk; + struct clk_bulk_data *clks; struct reset_control *phy_reset; struct regulator_bulk_data vregs[EUSB2_NUM_VREGS]; @@ -199,6 +235,46 @@ struct snps_eusb2_ref_clk { u32 div_11_8_val; }; +static const struct snps_eusb2_ref_clk exynos_eusb2_ref_clk[] = { + { 19200000, FSEL_19_2_MHZ_VAL, DIV_19_8_19_2_MHZ_VAL, EXYNOS_DIV_11_8_19_2_MHZ_VAL }, + { 20000000, FSEL_20_MHZ_VAL, DIV_19_8_20_MHZ_VAL, EXYNOS_DIV_11_8_20_MHZ_VAL }, + { 24000000, FSEL_24_MHZ_VAL, DIV_19_8_24_MHZ_VAL, EXYNOS_DIV_11_8_24_MHZ_VAL }, + { 26000000, FSEL_26_MHZ_VAL, DIV_19_8_26_MHZ_VAL, EXYNOS_DIV_11_8_26_MHZ_VAL }, + { 48000000, FSEL_48_MHZ_VAL, DIV_19_8_48_MHZ_VAL, EXYNOS_DIV_11_8_48_MHZ_VAL }, +}; + +static int exynos_eusb2_ref_clk_init(struct snps_eusb2_hsphy *phy) +{ + const struct snps_eusb2_ref_clk *config = NULL; + unsigned long ref_clk_freq = clk_get_rate(phy->ref_clk); + + for (int i = 0; i < ARRAY_SIZE(exynos_eusb2_ref_clk); i++) { + if (exynos_eusb2_ref_clk[i].freq == ref_clk_freq) { + config = &exynos_eusb2_ref_clk[i]; + break; + } + } + + if (!config) { + dev_err(&phy->phy->dev, "unsupported ref_clk_freq:%lu\n", ref_clk_freq); + return -EINVAL; + } + + snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_HS_PHY_CTRL_COMMON, + FSEL_MASK, + FIELD_PREP(FSEL_MASK, config->fsel_val)); + + snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_CFG_PLLCFG0, + PHY_CFG_PLL_FB_DIV_19_8_MASK, + FIELD_PREP(PHY_CFG_PLL_FB_DIV_19_8_MASK, + config->div_7_0_val)); + + snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_CFG_PLLCFG1, + EXYNOS_PHY_CFG_PLL_FB_DIV_11_8_MASK, + config->div_11_8_val); + return 0; +} + static const struct snps_eusb2_ref_clk qcom_eusb2_ref_clk[] = { { 19200000, FSEL_19_2_MHZ_VAL, DIV_7_0_19_2_MHZ_VAL, DIV_11_8_19_2_MHZ_VAL }, { 38400000, FSEL_38_4_MHZ_VAL, DIV_7_0_38_4_MHZ_VAL, DIV_11_8_38_4_MHZ_VAL }, @@ -239,6 +315,55 @@ static int qcom_eusb2_ref_clk_init(struct snps_eusb2_hsphy *phy) return 0; } +static int exynos_snps_eusb2_hsphy_init(struct phy *p) +{ + struct snps_eusb2_hsphy *phy = phy_get_drvdata(p); + int ret; + + snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_HS_PHY_CTRL_RST, + USB_PHY_RST_MASK | UTMI_PORT_RST_MASK, + USB_PHY_RST_MASK | UTMI_PORT_RST_MASK); + fsleep(50); /* required after holding phy in reset */ + + snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_HS_PHY_CTRL_COMMON, + RPTR_MODE, RPTR_MODE); + + /* update ref_clk related registers */ + ret = exynos_eusb2_ref_clk_init(phy); + if (ret) + return ret; + + /* default parameter: tx fsls-vref */ + snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_PHY_CFG_TX, + EXYNOS_PHY_CFG_TX_FSLS_VREF_TUNE_MASK, + FIELD_PREP(EXYNOS_PHY_CFG_TX_FSLS_VREF_TUNE_MASK, 0x0)); + + snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_UTMI_TESTSE, + TEST_IDDQ, 0); + fsleep(10); /* required after releasing test_iddq */ + + snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_HS_PHY_CTRL_RST, + USB_PHY_RST_MASK, 0); + + snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_HS_PHY_CTRL_COMMON, + PHY_ENABLE, PHY_ENABLE); + + snps_eusb2_hsphy_write_mask(phy->base, EXYNOS_USB_PHY_HS_PHY_CTRL_RST, + UTMI_PORT_RST_MASK, 0); + + return 0; +} + +static const char * const exynos_eusb2_hsphy_clock_names[] = { + "ref", "bus", "ctrl", +}; + +static const struct snps_eusb2_phy_drvdata exynos2200_snps_eusb2_phy = { + .phy_init = exynos_snps_eusb2_hsphy_init, + .clk_names = exynos_eusb2_hsphy_clock_names, + .num_clks = ARRAY_SIZE(exynos_eusb2_hsphy_clock_names), +}; + static int qcom_snps_eusb2_hsphy_init(struct phy *p) { struct snps_eusb2_hsphy *phy = phy_get_drvdata(p); @@ -315,8 +440,14 @@ static int qcom_snps_eusb2_hsphy_init(struct phy *p) return 0; } +static const char * const qcom_eusb2_hsphy_clock_names[] = { + "ref", +}; + static const struct snps_eusb2_phy_drvdata sm8550_snps_eusb2_phy = { .phy_init = qcom_snps_eusb2_hsphy_init, + .clk_names = qcom_eusb2_hsphy_clock_names, + .num_clks = ARRAY_SIZE(qcom_eusb2_hsphy_clock_names), }; static int snps_eusb2_hsphy_init(struct phy *p) @@ -334,7 +465,7 @@ static int snps_eusb2_hsphy_init(struct phy *p) goto disable_vreg; } - ret = clk_prepare_enable(phy->ref_clk); + ret = clk_bulk_prepare_enable(phy->data->num_clks, phy->clks); if (ret) { dev_err(&p->dev, "failed to enable ref clock, %d\n", ret); goto disable_vreg; @@ -361,7 +492,7 @@ static int snps_eusb2_hsphy_init(struct phy *p) return 0; disable_ref_clk: - clk_disable_unprepare(phy->ref_clk); + clk_bulk_disable_unprepare(phy->data->num_clks, phy->clks); disable_vreg: regulator_bulk_disable(ARRAY_SIZE(phy->vregs), phy->vregs); @@ -417,8 +548,28 @@ static int snps_eusb2_hsphy_probe(struct platform_device *pdev) if (IS_ERR(phy->phy_reset)) return PTR_ERR(phy->phy_reset); - phy->ref_clk = devm_clk_get(dev, "ref"); - if (IS_ERR(phy->ref_clk)) + phy->clks = devm_kcalloc(dev, phy->data->num_clks, sizeof(*phy->clks), + GFP_KERNEL); + if (!phy->clks) + return -ENOMEM; + + for (int i = 0; i < phy->data->num_clks; ++i) + phy->clks[i].id = phy->data->clk_names[i]; + + ret = devm_clk_bulk_get(dev, phy->data->num_clks, phy->clks); + if (ret) + return dev_err_probe(dev, ret, + "failed to get phy clock(s)\n"); + + phy->ref_clk = NULL; + for (int i = 0; i < phy->data->num_clks; ++i) { + if (!strcmp(phy->clks[i].id, "ref")) { + phy->ref_clk = phy->clks[i].clk; + break; + } + } + + if (IS_ERR_OR_NULL(phy->ref_clk)) return dev_err_probe(dev, PTR_ERR(phy->ref_clk), "failed to get ref clk\n"); @@ -458,6 +609,9 @@ static const struct of_device_id snps_eusb2_hsphy_of_match_table[] = { { .compatible = "qcom,sm8550-snps-eusb2-phy", .data = &sm8550_snps_eusb2_phy, + }, { + .compatible = "samsung,exynos2200-snps-eusb2-phy", + .data = &exynos2200_snps_eusb2_phy, }, { }, }; MODULE_DEVICE_TABLE(of, snps_eusb2_hsphy_of_match_table); From patchwork Fri Mar 21 13:58:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivaylo Ivanov X-Patchwork-Id: 14025522 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 CEBB4C36000 for ; Fri, 21 Mar 2025 14:16:08 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=V3NPOSHvHNdQU8ztogcBTtrP5FgYmhk0mGJQE6nk2O4=; b=SHTnRmoYSAhFiU eKrpBsS7qwADwwLqaGw/Ylzg46YHdy3K0FIsqHxV6aAUKezsDBwWbKLuvbNDR0FOkOxPf4MVizkQc J4RvTKXfpLaTta7ysNcW2YonaLxsj6Zx+YDq2peeCGoRv6bTtpH7+tEI+thNk9vw9lQsqpTY4rqG8 9pyaLxRH4qTxN7P0ke1fslas73WNHm2laJqJz6lRUqVPW036NrD1UBNY6ZynFj9zwGq/BvOCOqC/q oT+v3bUA9Ua79DQCP9RVCfqu9e0tA5vkE2c0Illk16tNIGsWHY3ggWOVIMaMBTxUYJQeSSTc5w+Rv XZcoshqBh3kiwCLR77DA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvdAO-0000000F475-2Vzz; Fri, 21 Mar 2025 14:16:08 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvcu1-0000000F0Zh-3JLb; Fri, 21 Mar 2025 13:59:15 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3913d129c1aso1468240f8f.0; Fri, 21 Mar 2025 06:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742565552; x=1743170352; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EoHg50laesVH6CBpuSOJvrId0cJWf2bjffYDRvhMe1w=; b=Ly+CXGF/cKeaVIIOcYOYjsNVLT+ktby9RShmSpSo9NkyQUKQBezko3UW0E3dbjN83z Ni5QJQAqjpG+8y5psMr0J/0FMyiR9q1y8KOVJVcDZSgH2PXVmDwX+KzpXY9hP3d2ljUB 5XbvjcbZTQTubAwVpKLS8brDE7NH8dADJhX4oLc0J/uBvb2hR4FGRcBx1SAvBtxD4/qr e6gVPlUH6gf/q2h3BLy1XN9APqdOoeNDBx2qbugh9K5h56o4AdTg5oCx6eb6LQwVTTsS AlNWkSyl79AMP39WE2TO0VBzJoPIS42dwAhd0ChHdPvX1u/8EBaWLxFDsvZGvg/1RQlf HZiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742565552; x=1743170352; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EoHg50laesVH6CBpuSOJvrId0cJWf2bjffYDRvhMe1w=; b=RVNmZxdXkJx7PmfNJwFTC7ANzDTBjkgh0Qrd22hjxRVz23dDkdeq2x2hbbhOvEU9/1 fNXfMcZRu8TyqkPm4/OJH3Dr6r7ISFVITyAIhHfjNB3uBN9LFCiHw0C1ZA4koV50mHWB zNU07dw+QA7UVWk0kAdEOIoRyjE84uEBLO9jEqsBnRCZrGi2ANjjp2O1K1/BFPmHgNFe hqV+ehh5Y/XTrqsqVat4f/ogGjqKy5CP9FRULzOyQ4UzwIeaWs0MEepjd/6NxsXmRufJ O9yKPzqjxUByRH14qRIqNIzCx8rfDH7Bx1RfbnQHP3o0js4mUzuOrHjhrkyWbXMVUD6D FyXQ== X-Forwarded-Encrypted: i=1; AJvYcCVMweMpuhUWZR/s9H/aJNyHW0KWbHPoEYpc5LiF8B7pk77nFDvWoSyMwz94YbpoRkg4PtvQSNQIiX0t@lists.infradead.org, AJvYcCWfHkoxf6YUwrizHyWGtMG5yU2YkOZRwuGdBIDdANv+29uB08k5GVRTxVYIfzxoll4y3KjMW5L6Sn55efIvg+zH@lists.infradead.org X-Gm-Message-State: AOJu0YwNIq3FWNiEqg29RrteZEeMFgR2hy6bWZIHizVEZxWZ3BtPc+WV U/CDkUtwhRa+qpUW2wd1Mjv7wB+7ZMGHUQBNu0FSNVKkaEAzU5a5Jy03jw== X-Gm-Gg: ASbGncsxl4Z32D8zTDvTn05Ghdld//goq86mATu/qZQEbJUDweyLYBva6NGAcD9fJ/f NErdHJ68S/vIBpjc2EWmCMP8zPxU07IV6N/2oSWNeI5eyCVvMcef5vos2/4gFExY0vtRnskVFJh sBZRBknWJG3Tfe542JO9wAxcT2ZcwDoNkg2lBMBuAnylJQLKQxIy8BacsouLZwiLjX2oPRq+rSN iR9V6v2H+zF7+tiVOzSL27w0YJi9/TmTFRaZSOL4ZEJI/+nfanJENOgCVlpwiTYdPqTc9v2Stbh dDTC4oiQ1mqYXqo1OF5CTNNLTMdafiJ8mLuZubnylaTAowNmD3c1vS54P+fZ8HrMjRvTvuDvcM5 gBk30yfeCW3F1V39G9ik3meMiDlmPJFk= X-Google-Smtp-Source: AGHT+IH8AxzOKAAv4IyhNwmi4+8+DTPXWnwEhFBpJxheVkEB9WaJ5eFWW7j3piT/WonO+0Ku4TvAWw== X-Received: by 2002:a5d:5989:0:b0:38a:4184:14ec with SMTP id ffacd0b85a97d-3997f8f7526mr3595461f8f.1.1742565552184; Fri, 21 Mar 2025 06:59:12 -0700 (PDT) Received: from ivaylo-T580.. (91-139-201-119.stz.ddns.bulsat.com. [91.139.201.119]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3997f9e6651sm2437162f8f.75.2025.03.21.06.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Mar 2025 06:59:11 -0700 (PDT) From: Ivaylo Ivanov To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , Philipp Zabel , Marek Szyprowski , Sylwester Nawrocki , Abel Vesa Cc: linux-arm-msm@vger.kernel.org, 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 Subject: [PATCH v3 10/10] phy: exynos5-usbdrd: support Exynos USBDRD 3.2 4nm controller Date: Fri, 21 Mar 2025 15:58:54 +0200 Message-ID: <20250321135854.1431375-11-ivo.ivanov.ivanov1@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> References: <20250321135854.1431375-1-ivo.ivanov.ivanov1@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_065913_849951_0AB32E6C X-CRM114-Status: GOOD ( 24.37 ) 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 Add support for the Exynos USB 3.2 DRD 4nm controller. It's used in recent 4nm SoCs like Exynos2200 and Exynos2400. This device consists of 3 underlying and independent phys: SEC link control phy, Synopsys eUSB 2.0 and Synopsys USBDP/SS combophy. Unlike older device designs, where the internal phy blocks were all IP of Samsung, Synopsys phys are present. This means that the link controller is now mapped differently to account for missing bits and registers. The Synopsys phys also have separate register bases. As there are non-SEC PHYs present now, it doesn't make much sense to implement them in this driver. They are expected to be configured by external drivers, so pass phandles to them. USBDRD3.2 link controller set up is still required beforehand. This commit adds the necessary changes for USB HS to work. USB SS and DisplayPort are out of scope in this commit and will be introduced in the future. Signed-off-by: Ivaylo Ivanov --- drivers/phy/samsung/phy-exynos5-usbdrd.c | 227 ++++++++++++++++++-- include/linux/soc/samsung/exynos-regs-pmu.h | 3 + 2 files changed, 215 insertions(+), 15 deletions(-) diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c index c421b495e..f85b22a7a 100644 --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c @@ -34,6 +34,21 @@ #define EXYNOS5_FSEL_26MHZ 0x6 #define EXYNOS5_FSEL_50MHZ 0x7 +/* USB 3.2 DRD 4nm PHY link controller registers */ +#define EXYNOS2200_DRD_CLKRST 0x0c +#define EXYNOS2200_CLKRST_LINK_PCLK_SEL BIT(1) + +#define EXYNOS2200_DRD_UTMI 0x10 +#define EXYNOS2200_UTMI_FORCE_VBUSVALID BIT(1) +#define EXYNOS2200_UTMI_FORCE_BVALID BIT(0) + +#define EXYNOS2200_DRD_HSP_MISC 0x114 +#define HSP_MISC_SET_REQ_IN2 BIT(4) +#define HSP_MISC_RES_TUNE GENMASK(1, 0) +#define RES_TUNE_PHY1_PHY2 0x1 +#define RES_TUNE_PHY1 0x2 +#define RES_TUNE_PHY2 0x3 + /* Exynos5: USB 3.0 DRD PHY registers */ #define EXYNOS5_DRD_LINKSYSTEM 0x04 #define LINKSYSTEM_XHCI_VERSION_CONTROL BIT(27) @@ -383,6 +398,7 @@ 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 + * @hs_phy: pointer to non-Samsung IP high-speed phy controller * @phys: array for 'EXYNOS5_DRDPHYS_NUM' number of PHY * instances each with its 'phy' and 'phy_cfg'. * @extrefclk: frequency select settings when using 'separate @@ -397,6 +413,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 phy *hs_phy; struct phy_usb_instance { struct phy *phy; u32 index; @@ -1049,6 +1066,149 @@ static const struct phy_ops exynos5_usbdrd_phy_ops = { .owner = THIS_MODULE, }; +static void exynos2200_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd) +{ + /* Configure non-Samsung IP PHY, responsible for UTMI */ + phy_init(phy_drd->hs_phy); +} + +static void exynos2200_usbdrd_link_init(struct exynos5_usbdrd_phy *phy_drd) +{ + void __iomem *regs_base = phy_drd->reg_phy; + u32 reg; + + /* + * Disable HWACG (hardware auto clock gating control). This will force + * QACTIVE signal in Q-Channel interface to HIGH level, to make sure + * the PHY clock is not gated by the hardware. + */ + reg = readl(regs_base + EXYNOS850_DRD_LINKCTRL); + reg |= LINKCTRL_FORCE_QACT; + writel(reg, regs_base + EXYNOS850_DRD_LINKCTRL); + + /* De-assert link reset */ + reg = readl(regs_base + EXYNOS2200_DRD_CLKRST); + reg &= ~CLKRST_LINK_SW_RST; + writel(reg, regs_base + EXYNOS2200_DRD_CLKRST); + + /* Set link VBUS Valid */ + reg = readl(regs_base + EXYNOS2200_DRD_UTMI); + reg |= EXYNOS2200_UTMI_FORCE_BVALID | EXYNOS2200_UTMI_FORCE_VBUSVALID; + writel(reg, regs_base + EXYNOS2200_DRD_UTMI); +} + +static void +exynos2200_usbdrd_link_attach_detach_pipe3_phy(struct phy_usb_instance *inst) +{ + struct exynos5_usbdrd_phy *phy_drd = to_usbdrd_phy(inst); + void __iomem *regs_base = phy_drd->reg_phy; + u32 reg; + + reg = readl(regs_base + EXYNOS850_DRD_LINKCTRL); + if (inst->phy_cfg->id == EXYNOS5_DRDPHY_UTMI) { + /* force pipe3 signal for link */ + reg &= ~LINKCTRL_FORCE_PHYSTATUS; + reg |= LINKCTRL_FORCE_PIPE_EN | LINKCTRL_FORCE_RXELECIDLE; + } else { + /* disable forcing pipe interface */ + reg &= ~LINKCTRL_FORCE_PIPE_EN; + } + writel(reg, regs_base + EXYNOS850_DRD_LINKCTRL); + + reg = readl(regs_base + EXYNOS2200_DRD_HSP_MISC); + if (inst->phy_cfg->id == EXYNOS5_DRDPHY_UTMI) { + /* calibrate only eUSB phy */ + reg |= FIELD_PREP(HSP_MISC_RES_TUNE, RES_TUNE_PHY1); + reg |= HSP_MISC_SET_REQ_IN2; + } else { + /* calibrate for dual phy */ + reg |= FIELD_PREP(HSP_MISC_RES_TUNE, RES_TUNE_PHY1_PHY2); + reg &= ~HSP_MISC_SET_REQ_IN2; + } + writel(reg, regs_base + EXYNOS2200_DRD_HSP_MISC); + + reg = readl(regs_base + EXYNOS2200_DRD_CLKRST); + if (inst->phy_cfg->id == EXYNOS5_DRDPHY_UTMI) + reg &= ~EXYNOS2200_CLKRST_LINK_PCLK_SEL; + else + reg |= EXYNOS2200_CLKRST_LINK_PCLK_SEL; + + writel(reg, regs_base + EXYNOS2200_DRD_CLKRST); +} + +static int exynos2200_usbdrd_phy_init(struct phy *phy) +{ + struct phy_usb_instance *inst = phy_get_drvdata(phy); + struct exynos5_usbdrd_phy *phy_drd = to_usbdrd_phy(inst); + int ret; + + if (inst->phy_cfg->id == EXYNOS5_DRDPHY_UTMI) { + /* Power-on PHY ... */ + ret = regulator_bulk_enable(phy_drd->drv_data->n_regulators, + phy_drd->regulators); + if (ret) { + dev_err(phy_drd->dev, + "Failed to enable PHY regulator(s)\n"); + return ret; + } + } + /* + * ... and ungate power via PMU. Without this here, we get an SError + * trying to access PMA registers + */ + exynos5_usbdrd_phy_isol(inst, false); + + ret = clk_bulk_prepare_enable(phy_drd->drv_data->n_clks, phy_drd->clks); + if (ret) + return ret; + + /* Set up the link controller */ + exynos2200_usbdrd_link_init(phy_drd); + + /* UTMI or PIPE3 link preparation */ + exynos2200_usbdrd_link_attach_detach_pipe3_phy(inst); + + /* UTMI or PIPE3 specific init */ + inst->phy_cfg->phy_init(phy_drd); + + clk_bulk_disable_unprepare(phy_drd->drv_data->n_clks, phy_drd->clks); + + return 0; +} + +static int exynos2200_usbdrd_phy_exit(struct phy *phy) +{ + struct phy_usb_instance *inst = phy_get_drvdata(phy); + struct exynos5_usbdrd_phy *phy_drd = to_usbdrd_phy(inst); + void __iomem *regs_base = phy_drd->reg_phy; + u32 reg; + int ret; + + ret = clk_bulk_prepare_enable(phy_drd->drv_data->n_clks, phy_drd->clks); + if (ret) + return ret; + + reg = readl(regs_base + EXYNOS2200_DRD_UTMI); + reg &= ~(EXYNOS2200_UTMI_FORCE_BVALID | EXYNOS2200_UTMI_FORCE_VBUSVALID); + writel(reg, regs_base + EXYNOS2200_DRD_UTMI); + + reg = readl(regs_base + EXYNOS2200_DRD_CLKRST); + reg |= CLKRST_LINK_SW_RST; + writel(reg, regs_base + EXYNOS2200_DRD_CLKRST); + + clk_bulk_disable_unprepare(phy_drd->drv_data->n_clks, phy_drd->clks); + + exynos5_usbdrd_phy_isol(inst, true); + return regulator_bulk_disable(phy_drd->drv_data->n_regulators, + phy_drd->regulators); +} + +static const struct phy_ops exynos2200_usbdrd_phy_ops = { + .init = exynos2200_usbdrd_phy_init, + .exit = exynos2200_usbdrd_phy_exit, + .owner = THIS_MODULE, +}; + static void exynos5_usbdrd_usb_v3p1_pipe_override(struct exynos5_usbdrd_phy *phy_drd) { @@ -1350,27 +1510,37 @@ static int exynos5_usbdrd_phy_clk_handle(struct exynos5_usbdrd_phy *phy_drd) return dev_err_probe(phy_drd->dev, ret, "failed to get phy core clock(s)\n"); - ref_clk = NULL; - for (int i = 0; i < phy_drd->drv_data->n_core_clks; ++i) { - if (!strcmp(phy_drd->core_clks[i].id, "ref")) { - ref_clk = phy_drd->core_clks[i].clk; - break; + if (phy_drd->drv_data->n_core_clks) { + ref_clk = NULL; + for (int i = 0; i < phy_drd->drv_data->n_core_clks; ++i) { + if (!strcmp(phy_drd->core_clks[i].id, "ref")) { + ref_clk = phy_drd->core_clks[i].clk; + break; + } } + if (!ref_clk) + return dev_err_probe(phy_drd->dev, -ENODEV, + "failed to find phy reference clock\n"); + + ref_rate = clk_get_rate(ref_clk); + ret = exynos5_rate_to_clk(ref_rate, &phy_drd->extrefclk); + if (ret) + return dev_err_probe(phy_drd->dev, ret, + "clock rate (%ld) not supported\n", + ref_rate); } - if (!ref_clk) - return dev_err_probe(phy_drd->dev, -ENODEV, - "failed to find phy reference clock\n"); - - ref_rate = clk_get_rate(ref_clk); - ret = exynos5_rate_to_clk(ref_rate, &phy_drd->extrefclk); - if (ret) - return dev_err_probe(phy_drd->dev, ret, - "clock rate (%ld) not supported\n", - ref_rate); return 0; } +static const struct exynos5_usbdrd_phy_config phy_cfg_exynos2200[] = { + { + .id = EXYNOS5_DRDPHY_UTMI, + .phy_isol = exynos5_usbdrd_phy_isol, + .phy_init = exynos2200_usbdrd_utmi_init, + }, +}; + static const struct exynos5_usbdrd_phy_config phy_cfg_exynos5[] = { { .id = EXYNOS5_DRDPHY_UTMI, @@ -1410,6 +1580,19 @@ static const char * const exynos5_regulator_names[] = { "vbus", "vbus-boost", }; +static const struct exynos5_usbdrd_phy_drvdata exynos2200_usb32drd_phy = { + .phy_cfg = phy_cfg_exynos2200, + .phy_ops = &exynos2200_usbdrd_phy_ops, + .pmu_offset_usbdrd0_phy = EXYNOS2200_PHY_CTRL_USB20, + .clk_names = exynos5_clk_names, + .n_clks = ARRAY_SIZE(exynos5_clk_names), + /* clocks and regulators are specific to the underlying PHY blocks */ + .core_clk_names = NULL, + .n_core_clks = 0, + .regulator_names = NULL, + .n_regulators = 0, +}; + static const struct exynos5_usbdrd_phy_drvdata exynos5420_usbdrd_phy = { .phy_cfg = phy_cfg_exynos5, .phy_ops = &exynos5_usbdrd_phy_ops, @@ -1651,6 +1834,9 @@ static const struct of_device_id exynos5_usbdrd_phy_of_match[] = { { .compatible = "google,gs101-usb31drd-phy", .data = &gs101_usbd31rd_phy + }, { + .compatible = "samsung,exynos2200-usb32drd-phy", + .data = &exynos2200_usb32drd_phy, }, { .compatible = "samsung,exynos5250-usbdrd-phy", .data = &exynos5250_usbdrd_phy @@ -1719,6 +1905,17 @@ static int exynos5_usbdrd_phy_probe(struct platform_device *pdev) return PTR_ERR(phy_drd->reg_phy); } + /* + * USB32DRD 4nm controller implements Synopsys eUSB2.0 PHY + * and Synopsys SS/USBDP COMBOPHY, managed by external code. + */ + if (of_property_present(dev->of_node, "phy-names")) { + phy_drd->hs_phy = devm_of_phy_get(dev, dev->of_node, "hs"); + if (IS_ERR(phy_drd->hs_phy)) + return dev_err_probe(dev, PTR_ERR(phy_drd->hs_phy), + "failed to get hs_phy\n"); + } + ret = exynos5_usbdrd_phy_clk_handle(phy_drd); if (ret) return ret; diff --git a/include/linux/soc/samsung/exynos-regs-pmu.h b/include/linux/soc/samsung/exynos-regs-pmu.h index ce1a3790d..b77187ba5 100644 --- a/include/linux/soc/samsung/exynos-regs-pmu.h +++ b/include/linux/soc/samsung/exynos-regs-pmu.h @@ -185,6 +185,9 @@ /* Only for S5Pv210 */ #define S5PV210_EINT_WAKEUP_MASK 0xC004 +/* Only for Exynos2200 */ +#define EXYNOS2200_PHY_CTRL_USB20 0x72C + /* Only for Exynos4210 */ #define S5P_CMU_CLKSTOP_LCD1_LOWPWR 0x1154 #define S5P_CMU_RESET_LCD1_LOWPWR 0x1174