From patchwork Sat May 8 06:52:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12245855 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 010D4C433B4 for ; Sat, 8 May 2021 06:52:46 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5104061458 for ; Sat, 8 May 2021 06:52:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5104061458 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=BoikiJmDbqwxumW4F6e6mcJL6UIgJLCPHN7HKL2D/T0=; b=Wedmm7KzjWtx6z9R9h+WA4XUJ vF/JPWxizAb1cd8VL0pOr5m7zd+3tldu3S4lHBvrTE7mTJhXZtMe0TTrA4DlmviRHrFYlOKb+XNvS MqzvgByMqg/IUiBnDkRagaKZTXRXjAvbfLN+QoQlO6PdUaBONmuYW89DA1QEWwUWaLnZ96c69KVG4 D+eY9Rnu2I0tK76uMFJCVI9VNOU1bd77TQf4xQGI4LRYoFdev4WVgT7Uicjdh+/iRulCrzemS4Ji9 9CWrNECf0BlN/IUe7nFWS3f1lU3ijGKoGhsKO4h9RQxQj9xJbQbVCIuNyHlYjE47XV0NwsanDZqSm nTT+c1vcg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpP-0090HM-Fz; Sat, 08 May 2021 06:52:43 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpM-0090FZ-B1 for linux-phy@desiato.infradead.org; Sat, 08 May 2021 06:52:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=FOVnFr/nj3QWdNJlIgekW/kswIF2a4pE9kCJghjF1wk=; b=K5k17X/XXqnjckL4Dy43l28TEf 3I9+SJLpRdNmkehn8u5RCmAOA2qt83fwcRpMOaIkr7+087ALosfCOMBDpCOgZEQXdSyZgww8CrI+W dMNoHqmf68YqdVzcWQwELakbOTg4vC29f8jkVofbnWtvi6damMN6aikTYmexD7DmQcyRN08jZfDWk B9XgJTmnrDM4WeC2nvCBpPhLqlLZvLh0TK3tp7opyIDcZU4ttOW96PgYIdLWi5WVE/yBenp2DntNQ N2tOH0ChAP52libAbf/yFBspvW+pFEm+Gz21wEJbvnkaT0TYuERZGk5bppzuRM1tSQiHKQUKlH6Mt af0JdUaA==; Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpJ-007PLW-SI for linux-phy@lists.infradead.org; Sat, 08 May 2021 06:52:39 +0000 Received: by mail-wm1-x32a.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso8280897wmh.4 for ; Fri, 07 May 2021 23:52:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FOVnFr/nj3QWdNJlIgekW/kswIF2a4pE9kCJghjF1wk=; b=RNrV+8KPF4RQbDUoE/C4kEXsBDvsBWPCBgUUGzbcOX4dgaJyyZM4Tyjz46xR6nZtr+ 1a0PXZLVhyQMbknf9ZzOEl8lnfxEkHfcfLYuYIIi16sSpyzQo5BBtICKtRSvnRvc02i1 qqoDw5ETGX9Tqk4x6zBiogfNgjMmD5ngR0k8NdKDIW9VcCpijqksEGgZGhAtyJtO7z05 AAe1goG3fXoeyly02qNdOvnw5VKOwcLy9Js0mTPBqlYx/1jepwFqjPo6zB4QMA352L0R ApjLreWZEev034EQ/D1GMSHqngbhZ5a5xInKU6DKmdiDzv1mFgc7XVPC9fp0R3b758Ck L1cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FOVnFr/nj3QWdNJlIgekW/kswIF2a4pE9kCJghjF1wk=; b=tG7BSeOr775rGclmX1xHj8A7PY3JTm8VPDfCtWRxwRpj7mk+dBxjNWZ4R6SptM+VvL QqA/04/QiezRPy/PYDNxnisllCOHmmWdAxwy+KJMzftItrGWhzUOdDIJ2Wn7QX9QFbIq N1kex1w5LiyTu2qR9HsNvit9a3mr0uvpQ2BLO3Oi5q6eIqWpglrqpqnkEbWHqk0Sls0j gQZiepeZkncPH/PRTY48WvneiP8G97jHCDzVfNtMP9viZSI551oZ1L4UttBMSHHmaA2+ GIjWnb2PgP549Fd8c4tIGxtom8v1W0RPjZnRCrz9r75A7D459zCWX2L22hBck9caBgKh nV/Q== X-Gm-Message-State: AOAM531BgZzn9UL8aMA2u6ZBOtqOpuAeyGwA/+X7ICI/HPvX+FOQdagZ BLBtBR7FBnk35XTKC/IYHbI= X-Google-Smtp-Source: ABdhPJxBzYTMkYXsqVIu+tuk1PbOpRnhrqpL/d3bwBEyvWL/IwJSj8T10XNSxMuaGH39Xj/339rgzA== X-Received: by 2002:a05:600c:350a:: with SMTP id h10mr1867908wmq.154.1620456756289; Fri, 07 May 2021 23:52:36 -0700 (PDT) Received: from localhost.localdomain (231.red-83-51-243.dynamicip.rima-tde.net. [83.51.243.231]) by smtp.gmail.com with ESMTPSA id b12sm11638010wro.28.2021.05.07.23.52.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 May 2021 23:52:35 -0700 (PDT) From: Sergio Paracuellos To: vkoul@kernel.org Cc: linux-phy@lists.infradead.org, kishon@ti.com, linux-staging@lists.linux.dev, gregkh@linuxfoundation.org, neil@brown.name, ilya.lipnitskiy@gmail.com Subject: [PATCH v2 1/6] staging: mt7621-dts: use clock in pci phy nodes Date: Sat, 8 May 2021 08:52:27 +0200 Message-Id: <20210508065232.4882-2-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210508065232.4882-1-sergio.paracuellos@gmail.com> References: <20210508065232.4882-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_235237_932603_3ECF9AF8 X-CRM114-Status: GOOD ( 10.49 ) 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 MT7621 SoC clock driver has already mainlined in 'commit 48df7a26f470 ("clk: ralink: add clock driver for mt7621 SoC")' Hence we can use the clock in pcie phy nodes to be able to get it from there in driver code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts/mt7621.dtsi index 9ee11adefa79..840ba0c3ffed 100644 --- a/drivers/staging/mt7621-dts/mt7621.dtsi +++ b/drivers/staging/mt7621-dts/mt7621.dtsi @@ -548,12 +548,14 @@ pcie@2,0 { pcie0_phy: pcie-phy@1e149000 { compatible = "mediatek,mt7621-pci-phy"; reg = <0x1e149000 0x0700>; + clocks = <&sysc MT7621_CLK_XTAL>; #phy-cells = <1>; }; pcie2_phy: pcie-phy@1e14a000 { compatible = "mediatek,mt7621-pci-phy"; reg = <0x1e14a000 0x0700>; + clocks = <&sysc MT7621_CLK_XTAL>; #phy-cells = <1>; }; }; From patchwork Sat May 8 06:52:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12245857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE883C433B4 for ; Sat, 8 May 2021 06:52:52 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 28D4661288 for ; Sat, 8 May 2021 06:52:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28D4661288 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=l+oq/dMerGhKJVzegz7pnqCaWStWPsKccwgoPaSDpZA=; b=JUaOhd9ojUJ4Hp01AJRBVUkRb iXIUueqyIpDSIqw4a4l46UggTDs/AcLKqNzB+TW1Vjeil1L9KbykW0A69URiRnbj4/VMHYddzGyUs jF8mvWZqjgqK+RoqWSclnY/jPUTskuuXlIDdt+GAshWtTrCf0euH18QcaIp82vvDHH8xPSnBqdykO XZtB7P6R0rXOnuN3AUvSDwhusQP2L/mkAKI3bdZoWXBQPOsHOHREL9y4q4v0OC+bhg3m1USh087+9 VMX67ED/lvDduWg2lCRTcdnnCJ//tVSa1QQzgAQXGtsT4r2aa5cUo9k05+zzjiSx4AgIC9zvvQyS8 dowHlJo+w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpV-0090Hn-OO; Sat, 08 May 2021 06:52:49 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpN-0090Ff-5m for linux-phy@desiato.infradead.org; Sat, 08 May 2021 06:52:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=HcVgM2vyvgzDYevyg/QfJoz8h0kWR0tPVu2/nxnMK08=; b=YohRDKnvAon05SZnVhcvU2fu6H WHiaca6Xw3DGxvzeuSYoIThzRcl1ZtlAB48E2K3vfW+G+EY+Ae6FbiV2EqKzCwsYvNh9eqFNfCuf9 eD7HLhN0gghbc1e8ULrSotDSMpshD4mK5F++zPuz0s0A1e+lfMh8wveFuI/4NzNynlxOkIEetzQ8j af54a+RGanyUTaufqKnKD0NuN1Uq/LJtYgBIipikyM86mrFX7+AKq1Y0PCsE1DKgDbINbfjkiMMD1 EBQaAQ17+Abk7arXnvv1YydBTSn3vEkmMaoaWDGKbl2NEEjN/7le0k//2Xi4j6MoTNdwSD9RI9wIl rtsX7QdA==; Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpK-007PLi-Lo for linux-phy@lists.infradead.org; Sat, 08 May 2021 06:52:39 +0000 Received: by mail-wm1-x329.google.com with SMTP id g65so6360980wmg.2 for ; Fri, 07 May 2021 23:52:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HcVgM2vyvgzDYevyg/QfJoz8h0kWR0tPVu2/nxnMK08=; b=fHmva84B+WM6w350eDqTkOl8FhXPDtg3gQ5ij5heAEjBqaqYLXNqQN5dO1WgFamQbs +k00beVVVRps76Mbh2kjyu65rGMjX10gdZVeRe0KOPBSA9EdOmMB5F5tEQoUv8jtPa9C 4k5qWvlFDFMuw/Nz9BVvidJhnBG8KoDv+1DiWlrXTktjkbWm/2enCyy8+Xto3h2/Y921 /aebEBFYS1YSCUMqMR2qr3Cg2SyyDNUwWdcVQYKlWl93rs59LtfJjLOXb8gxYHn92toB 7dTs9hW2KMddOLDUscODrpvQYCwWgwF475QzX1h9+/M9g9TsuD3QQTdYYlbFCASuFqVl qWcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HcVgM2vyvgzDYevyg/QfJoz8h0kWR0tPVu2/nxnMK08=; b=feHo75JLC9KN/wEIQwKoCBgmOdb1tLbCbXzWusM3NlJGD8R/YUuM6KvFU+kXdD4ODl 9Vnp2+yLZ5nS3QeidbZxJa+hyz23jL3NnUCHTG62ZN9PIt6lCR5N/11V61BfLSH2Ajnw 40DDcMtEGZkDfGHnglpFyfoHON7cvdJOaYAFtAO48zBsVJk2bSyOmR0EPa84j1KxIaGZ tj6l1jWcpns3Z/KItTsne/EBjFvOSdX5+9Hgeys8UgceYGCZ+uhAiW8X9/hIORyOwrtm hzi/DmD7aN/8N4fX+UPmP0eS5fjCkD2hFsHcidVA7e7SlAWV3lD6x8djJ4PGYfMuM7PX +xQQ== X-Gm-Message-State: AOAM533eOZzVnYzIbQw0ImvopUR7ZDKYiL5K4TNSnQPP/YN5FguUP7UU gj8fJ07+1DgOz1mbm2hxZfU= X-Google-Smtp-Source: ABdhPJzTLLM5AeDPLomNArvDRyEqjwe2fWIWNeSysSiv1Jwx4GEpVY2WfenAYWcZ9D0dRaEgoGiecA== X-Received: by 2002:a1c:e387:: with SMTP id a129mr14667277wmh.61.1620456757203; Fri, 07 May 2021 23:52:37 -0700 (PDT) Received: from localhost.localdomain (231.red-83-51-243.dynamicip.rima-tde.net. [83.51.243.231]) by smtp.gmail.com with ESMTPSA id b12sm11638010wro.28.2021.05.07.23.52.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 May 2021 23:52:36 -0700 (PDT) From: Sergio Paracuellos To: vkoul@kernel.org Cc: linux-phy@lists.infradead.org, kishon@ti.com, linux-staging@lists.linux.dev, gregkh@linuxfoundation.org, neil@brown.name, ilya.lipnitskiy@gmail.com Subject: [PATCH v2 2/6] dt-bindings: phy: mediatek, mt7621-pci-phy: add clock entries Date: Sat, 8 May 2021 08:52:28 +0200 Message-Id: <20210508065232.4882-3-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210508065232.4882-1-sergio.paracuellos@gmail.com> References: <20210508065232.4882-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_235238_731289_562D2DC8 X-CRM114-Status: GOOD ( 10.61 ) 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 MT7621 SoC clock driver has already mainlined in 'commit 48df7a26f470 ("clk: ralink: add clock driver for mt7621 SoC")' Hence update schema with the add of the entries related to clock. Since until now things were not properly being done we mark also 'clock' as required in the binding since this will be now the only way to properly retrieve frequency to be able to make a correct configuration of the PCIe phy registers. Signed-off-by: Sergio Paracuellos --- .../devicetree/bindings/phy/mediatek,mt7621-pci-phy.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/mediatek,mt7621-pci-phy.yaml b/Documentation/devicetree/bindings/phy/mediatek,mt7621-pci-phy.yaml index 0ccaded3f245..29d4123323c2 100644 --- a/Documentation/devicetree/bindings/phy/mediatek,mt7621-pci-phy.yaml +++ b/Documentation/devicetree/bindings/phy/mediatek,mt7621-pci-phy.yaml @@ -16,6 +16,9 @@ properties: reg: maxItems: 1 + clocks: + maxItems: 1 + "#phy-cells": const: 1 description: selects if the phy is dual-ported @@ -23,6 +26,7 @@ properties: required: - compatible - reg + - clocks - "#phy-cells" additionalProperties: false @@ -32,5 +36,6 @@ examples: pcie0_phy: pcie-phy@1e149000 { compatible = "mediatek,mt7621-pci-phy"; reg = <0x1e149000 0x0700>; + clocks = <&sysc 0>; #phy-cells = <1>; }; From patchwork Sat May 8 06:52:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12245863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD850C43460 for ; Sat, 8 May 2021 06:52:53 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2357E61458 for ; Sat, 8 May 2021 06:52:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2357E61458 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=YplTVDb1ZeFkoeq2f9u2Mn9A2RISwyGb//QJWhSTueM=; b=THoJaWael3aEyDQaUb2zLzFgC 73a5VJ+uRs8tZb9+p/YDjFF8rkWLwVs73ix9aZ0cjjD6PP4r6mlx1mqjgviymAEQFKy82wYykXgAs iJKZM8bYxcFrXaOxYrFdw94c69/yE5KcQ++X6Rt9T7Pm0429USPB0+aP3Xp/bkjDhg+wUXutbJDgM Gtl7Z+Ak1yRKs1OIu+tpRuat/UPvZgWZFaSagaNHRQk/KDQr83no0iknGvBE98Qn2MRCOCQBfj4Ym 60RyD2k2H5S1zMbkZJqssxskHYgNCqU4tPCY6yf9RX1fiybzl3N+XMxIKr4ftq2biOqjfCQtbwdWV pWkZwQN/Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpW-0090I0-RP; Sat, 08 May 2021 06:52:50 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpO-0090Fk-El for linux-phy@desiato.infradead.org; Sat, 08 May 2021 06:52:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=cbFyM8/48A5QwY5f+jcAHfVdDdKUhqPQqn/9aWFc+bo=; b=ZX8S+/dV3DSrboAelBhV9kvCs9 IRcRxH5c+e3k6IGaZlxvZtPrHP7mIua9S+W9e3t6ugReWAfnIbOpvx8Lauk8Orsdv2RcpHzuIO5Hc ET0OwiNGXtgpQ8Mzla7TTXpTeUa5afS08BLZmZ7/YEvXNg3Z0ddjxKGrylfzl1RlS427JXEpQArrS loWY1ROtXtf3CzlpzWjK/K458FxOJUQUrT9dYL3rJfk2SUNZqtjpMPmOa2QPPaa0Q0RbYOc41Ak1W 9+beLVWYDWjnwzjoQqPxCOuC+u7tx51d90bGENgPRFSFOoOZfTE0pkd6Ablv3x4Vb4fCOEVzxzVT3 Sf8wh4cQ==; Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpL-007PLy-Nv for linux-phy@lists.infradead.org; Sat, 08 May 2021 06:52:41 +0000 Received: by mail-wm1-x32c.google.com with SMTP id y124-20020a1c32820000b029010c93864955so8289505wmy.5 for ; Fri, 07 May 2021 23:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cbFyM8/48A5QwY5f+jcAHfVdDdKUhqPQqn/9aWFc+bo=; b=ZFRTF9cJRvrPzrKb7blUFVU3v9BY65e7DprhIVLvgMVjXP0ndV1841gpqXpWavPeBt bfFtSVWYpnw1+JZX5oRDgFJdMQLyl0RYs61te9gLPTP5xvrDNBC/NLYo44PFTz2XvSax tcYjXSM0NW7D9c3iTRYO/yBPjhK0ysLvfWBjfcrEnQ+IzmgpW5z3CjbGQiznQPbVLKmc MHL0xx+02QFkseOEvYthGha4OniAzYgWKXXW30XduNpJZ65n/8VxznPtPmDw6hh8N7Zq S0A5CoMa1Icb+kmE3PHLg7UfyBbnti8LYbyhvOyplS0E4+JTn19UFq7MqkbOAYm1h6db czoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cbFyM8/48A5QwY5f+jcAHfVdDdKUhqPQqn/9aWFc+bo=; b=fcxWoRZJRPnRbh1R0zYIBU/wV01cs+X4WpbnZBZWh/4HJZwKdWNkpZ4yD2hEp0adCg qhAJxIXntDsGAMIfR3Gi+sBmwkrsZSxHp3aFsLoGV45vA6T/QfA8o2aEfjUHLdYEx630 TG+CGe947Rvdjz3QWcLh5AJcr4MGWaShOXQMr7v6zWWX/Fh0BwR/WQLNCsWhCmq/Shvs 2XjTLsZ8j6bv5vof27ZQCMPkRa3nRPGusQbhDg6EY1JB3JHFCCucBkMeZwJaY9/3eg0E 3yN/yCRyZYMylAGR7cAt2Bl/a881Fgu7R2i9SNvxRgyVVCGV3TMPpaaghl6I9MY/ezyr B7OA== X-Gm-Message-State: AOAM531hodWrFFAMctk/wOxwUAEfj1eiIwfyJ9wa8B4uv6F/GfEvwWgt mw3TmlQqecmpru/Hr1OpFvQ= X-Google-Smtp-Source: ABdhPJzR/6SkDB7jYl+jO3UVdl29gKC7cPrXHKMB8YfRM+FB3mVH7Um52u3E3FpZosKFPe6v0qr6Kw== X-Received: by 2002:a7b:c34a:: with SMTP id l10mr14494612wmj.46.1620456758282; Fri, 07 May 2021 23:52:38 -0700 (PDT) Received: from localhost.localdomain (231.red-83-51-243.dynamicip.rima-tde.net. [83.51.243.231]) by smtp.gmail.com with ESMTPSA id b12sm11638010wro.28.2021.05.07.23.52.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 May 2021 23:52:37 -0700 (PDT) From: Sergio Paracuellos To: vkoul@kernel.org Cc: linux-phy@lists.infradead.org, kishon@ti.com, linux-staging@lists.linux.dev, gregkh@linuxfoundation.org, neil@brown.name, ilya.lipnitskiy@gmail.com Subject: [PATCH v2 3/6] phy: ralink: phy-mt7621-pci: use kernel clock APIS Date: Sat, 8 May 2021 08:52:29 +0200 Message-Id: <20210508065232.4882-4-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210508065232.4882-1-sergio.paracuellos@gmail.com> References: <20210508065232.4882-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_235239_798534_4ABB8F59 X-CRM114-Status: GOOD ( 21.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 MT7621 SoC clock driver has already mainlined in 'commit 48df7a26f470 ("clk: ralink: add clock driver for mt7621 SoC")' This allow us to properly use kernel clock apis to get the clock frequency needed for the phy configuration instead of use custom architecture code to do the same. Signed-off-by: Sergio Paracuellos --- drivers/phy/ralink/phy-mt7621-pci.c | 33 +++++++++++++++++------------ 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/drivers/phy/ralink/phy-mt7621-pci.c b/drivers/phy/ralink/phy-mt7621-pci.c index 753cb5bab930..f56ff10b0885 100644 --- a/drivers/phy/ralink/phy-mt7621-pci.c +++ b/drivers/phy/ralink/phy-mt7621-pci.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -14,8 +15,6 @@ #include #include #include -#include -#include #define RG_PE1_PIPE_REG 0x02c #define RG_PE1_PIPE_RST BIT(12) @@ -62,8 +61,6 @@ #define RG_PE1_FRC_MSTCKDIV BIT(5) -#define XTAL_MASK GENMASK(8, 6) - #define MAX_PHYS 2 /** @@ -71,6 +68,7 @@ * @dev: pointer to device * @regmap: kernel regmap pointer * @phy: pointer to the kernel PHY device + * @sys_clk: pointer to the system XTAL clock * @port_base: base register * @has_dual_port: if the phy has dual ports. * @bypass_pipe_rst: mark if 'mt7621_bypass_pipe_rst' @@ -80,6 +78,7 @@ struct mt7621_pci_phy { struct device *dev; struct regmap *regmap; struct phy *phy; + struct clk *sys_clk; void __iomem *port_base; bool has_dual_port; bool bypass_pipe_rst; @@ -116,12 +115,14 @@ static void mt7621_bypass_pipe_rst(struct mt7621_pci_phy *phy) } } -static void mt7621_set_phy_for_ssc(struct mt7621_pci_phy *phy) +static int mt7621_set_phy_for_ssc(struct mt7621_pci_phy *phy) { struct device *dev = phy->dev; - u32 xtal_mode; + unsigned long clk_rate; - xtal_mode = FIELD_GET(XTAL_MASK, rt_sysc_r32(SYSC_REG_SYSTEM_CONFIG0)); + clk_rate = clk_get_rate(phy->sys_clk); + if (!clk_rate) + return -EINVAL; /* Set PCIe Port PHY to disable SSC */ /* Debug Xtal Type */ @@ -139,13 +140,13 @@ static void mt7621_set_phy_for_ssc(struct mt7621_pci_phy *phy) RG_PE1_PHY_EN, RG_PE1_FRC_PHY_EN); } - if (xtal_mode <= 5 && xtal_mode >= 3) { /* 40MHz Xtal */ + if (clk_rate == 40000000) { /* 40MHz Xtal */ /* Set Pre-divider ratio (for host mode) */ mt7621_phy_rmw(phy, RG_PE1_H_PLL_REG, RG_PE1_H_PLL_PREDIV, FIELD_PREP(RG_PE1_H_PLL_PREDIV, 0x01)); dev_dbg(dev, "Xtal is 40MHz\n"); - } else if (xtal_mode >= 6) { /* 25MHz Xal */ + } else if (clk_rate == 25000000) { /* 25MHz Xal */ mt7621_phy_rmw(phy, RG_PE1_H_PLL_REG, RG_PE1_H_PLL_PREDIV, FIELD_PREP(RG_PE1_H_PLL_PREDIV, 0x00)); @@ -196,13 +197,15 @@ static void mt7621_set_phy_for_ssc(struct mt7621_pci_phy *phy) mt7621_phy_rmw(phy, RG_PE1_H_PLL_BR_REG, RG_PE1_H_PLL_BR, FIELD_PREP(RG_PE1_H_PLL_BR, 0x00)); - if (xtal_mode <= 5 && xtal_mode >= 3) { /* 40MHz Xtal */ + if (clk_rate == 40000000) { /* 40MHz Xtal */ /* set force mode enable of da_pe1_mstckdiv */ mt7621_phy_rmw(phy, RG_PE1_MSTCKDIV_REG, RG_PE1_MSTCKDIV | RG_PE1_FRC_MSTCKDIV, FIELD_PREP(RG_PE1_MSTCKDIV, 0x01) | RG_PE1_FRC_MSTCKDIV); } + + return 0; } static int mt7621_pci_phy_init(struct phy *phy) @@ -212,9 +215,7 @@ static int mt7621_pci_phy_init(struct phy *phy) if (mphy->bypass_pipe_rst) mt7621_bypass_pipe_rst(mphy); - mt7621_set_phy_for_ssc(mphy); - - return 0; + return mt7621_set_phy_for_ssc(mphy); } static int mt7621_pci_phy_power_on(struct phy *phy) @@ -324,6 +325,12 @@ static int mt7621_pci_phy_probe(struct platform_device *pdev) return PTR_ERR(phy->phy); } + phy->sys_clk = devm_clk_get(dev, NULL); + if (IS_ERR(phy->sys_clk)) { + dev_err(dev, "failed to get phy clock\n"); + return PTR_ERR(phy->sys_clk); + } + phy_set_drvdata(phy->phy, phy); provider = devm_of_phy_provider_register(dev, mt7621_pcie_phy_of_xlate); From patchwork Sat May 8 06:52:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12245861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 729D1C433ED for ; Sat, 8 May 2021 06:52:53 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 26B2C61464 for ; Sat, 8 May 2021 06:52:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26B2C61464 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=PdpuTlviHGssm9LdQnnkO1fTgrIHmbExW/8CnnFUd80=; b=Ehxwsf+bH8LqlkrxQ6oYL2wm/ SUg/c/aKMY3OF6Y99nb9elfJ2seKLOzoBHKSCr1cxU9eCMjIL8tmb4UhxESaF1t6G554ofGhiZFEZ NeqPYNWsTOFb/qr0LLX7V7C4tJS+nj7xEVQKqx+CscqliUvp0Rn457442HHz/KK2Cz5OwTulT8IOX VvamwF+EtcaNeVPw42/ycLQAmrZVH59fUld0zk0ZH2Y07Qi5sv/NzsO7VIJj5M5l0exghUOI/TcFA TK3FcifJnK2zA7FCLpOHUgnD6cd5c5gDboJdkGdyLLrAs8ON8GTXUx2y678K+u3imqLw2GGtP6Tz0 tJqd/oRSQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpX-0090I7-DV; Sat, 08 May 2021 06:52:51 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpP-0090Fq-2x for linux-phy@desiato.infradead.org; Sat, 08 May 2021 06:52:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=rnhsZglV9Tim8CW0KmXYUH85PSzSV/y0PNcnH/Ygu/E=; b=tUvZ50tLrPy/wiFlVdC+Tf6keM btkbKDQEIiG50Fs4oJZfSHXSLWmVh3fIWHUJX12BtbaFlG9zHqUQdbba7MlBwrqSAFmyOjohB11fP HZcT6X9lrR4P98L82Wno+S9QIpk7PfsEWEQt9UX32VREM6fpfl6zvEkppjxMmF6tbSqWdWT+usFB0 bMs9ofaDYXSRPayAIss3YyJW2O7uFmrOWRdqIQpQ4HPkDerx6Hy9M7O4AsDNIUE3ry/Fe0SrIf3oM 5dlrZyw7dkMW06s4ybNf1jxG5QcnWdIhRQOBf0Pm13nJsDS98gcvf9700u+hClBlYwwKsEB1Un1Uy 4lnZHl2Q==; Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpM-007PME-KH for linux-phy@lists.infradead.org; Sat, 08 May 2021 06:52:41 +0000 Received: by mail-wm1-x32f.google.com with SMTP id s5-20020a7bc0c50000b0290147d0c21c51so6005148wmh.4 for ; Fri, 07 May 2021 23:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rnhsZglV9Tim8CW0KmXYUH85PSzSV/y0PNcnH/Ygu/E=; b=LQcyHlKI3cmGbxplDQAJgFpcZ2vWNGbNxmmwsnLjSwGKYDbEK896BewQFECt6Tu7d8 S7kau4cHh3oqU2TMv6GgeZE/A7mO+Kaux1/fnFpzeNw72D+/pfY/ZBC3iHOmndxctgrn XTA643lzwlo1D7JXYKYEZNYfs1f9TGMPOxhqwfaOBfP2MOfxSyYRLx8oSjaV+uIX0Yct t2/ZXVGzj2j9kIgFjNDpcVuVtZmN5HP940DXu+HxfH/8T3PCqwJDTttrQCDMNUcJa2Ky IJxHQM0w00U84RP/N2+m0Cspx1eXMy5w2nkWjpmnn8h4YnbzVNm0HCVPbk7gjad32acW LGrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rnhsZglV9Tim8CW0KmXYUH85PSzSV/y0PNcnH/Ygu/E=; b=fNWMmBDpkT4WR1soO5WMafObMDChUtcqyudXfs1j4qXXAKPPuVDEznFvY1R27HGQR+ pKU6v4SsbcUUrGL90Nb43usH4KWea0gKhcBMogZ8JhaY3dUHVToC0gl8SqjW9ITNkg6g xBnuWp2Q7/y52GuMNpVI0vCfV6Y3UdZ85k+RPNxlUWcQVkHRzs2WguKfCsxx6mmC4j1k 0AgD6/5xB2I4OxmeBGgr0ZbD3dy7WG4reKe8z+NK+ei1fGvatii748RKyUywL17iFd6P z0VptVgGjvbvgVPCuHFXBXG335cGnH5RpIqfeR2En0ms6fJgxgvsIE7BWWx1vPIdsYM9 u4gg== X-Gm-Message-State: AOAM531Nf1X4pklU+D3jkTnjpcUQqJJ0W6HHeXL28V7Cnda9AlHBtsNq k9MbXmW4ucu0uy5+Je7o4EM= X-Google-Smtp-Source: ABdhPJxfPpdspV0gYutpfTe5YchDZnQYJXqPP4rbHosmjZFV1JVsgOuTaJWVJflzXrejLiFn33yHtg== X-Received: by 2002:a1c:c28a:: with SMTP id s132mr25250444wmf.145.1620456759167; Fri, 07 May 2021 23:52:39 -0700 (PDT) Received: from localhost.localdomain (231.red-83-51-243.dynamicip.rima-tde.net. [83.51.243.231]) by smtp.gmail.com with ESMTPSA id b12sm11638010wro.28.2021.05.07.23.52.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 May 2021 23:52:38 -0700 (PDT) From: Sergio Paracuellos To: vkoul@kernel.org Cc: linux-phy@lists.infradead.org, kishon@ti.com, linux-staging@lists.linux.dev, gregkh@linuxfoundation.org, neil@brown.name, ilya.lipnitskiy@gmail.com Subject: [PATCH v2 4/6] phy: ralink: Kconfig: enable COMPILE_TEST on mt7621-pci-phy driver Date: Sat, 8 May 2021 08:52:30 +0200 Message-Id: <20210508065232.4882-5-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210508065232.4882-1-sergio.paracuellos@gmail.com> References: <20210508065232.4882-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_235240_681406_E33D7CAF X-CRM114-Status: GOOD ( 12.16 ) 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 After use the clock apis and avoid custom architecture code this driver can properly be enabled for COMPILE_TEST. Signed-off-by: Sergio Paracuellos --- drivers/phy/ralink/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/ralink/Kconfig b/drivers/phy/ralink/Kconfig index ecc309ba9fee..c2373b30b8a6 100644 --- a/drivers/phy/ralink/Kconfig +++ b/drivers/phy/ralink/Kconfig @@ -4,7 +4,7 @@ # config PHY_MT7621_PCI tristate "MediaTek MT7621 PCI PHY Driver" - depends on RALINK && OF + depends on (RALINK && OF) || COMPILE_TEST select GENERIC_PHY select REGMAP_MMIO help From patchwork Sat May 8 06:52:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12245865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97661C433ED for ; Sat, 8 May 2021 06:52:56 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 003206145E for ; Sat, 8 May 2021 06:52:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 003206145E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=W3UcudMV/wJjNF1OCs0PyGhxJ6IvNMVxovTXBH9bl3Y=; b=f8dewC/c37hdF3p4lEwI6kujO nPdeWHM5z5J3eWnaWMc8ri/Zfz3KsUpMh5xVB+hqz3o5vqUPJRCWHrr9eJJlLeQebfkGxcuLngIHd XcXObQnDL/UZqDziASOmVRHd8FvWkjmXkjy7qjwpSn4r8XoS6Vcyy2z5b3VK0D2OdZmK58fTeqf2n UYdIw/PDa36wccPyuxlmtdOMmpgNIT4bduOtue/7kR22Bh+1W416PMvdqWLloWMPJdlGC+oui698f K6zibiJFoZJqM36nui0sbUwjL5mU3jLLn+mrUkoappoiayRtlc3IEzhGb55fMIoBfdmHkS+dsqbsC OEYciQaZg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpa-0090Im-6K; Sat, 08 May 2021 06:52:54 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpQ-0090HK-34 for linux-phy@desiato.infradead.org; Sat, 08 May 2021 06:52:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=b+GCOf42Gs4UdMdK0477XZHtOpuU44Ecgu3QGsmZOXI=; b=pXPWIky9lk6Yft9njWJezGTaxN JWxlpnPWTlC3zSAb1tAlJGezJbqJjeglgk3a218r60DUTK/kAJX7m9tFJNuYqM5J5bn31RuQzPAbP HIC/NW1DAOGczeMbEb/fRdLCP4mwLa4UIJ8K+eZsrRmjkKryRnXj2VYGiGPY95jvLBIzX8Gh4u9HJ BPA7TTP7wLsWrYXgcea1XHQEYj8di5p/jtaNAgwig7WrFq+O83HNjgqbWwnv24+lHSB0SMINOFv5X mgWwP/oooMewp1ROqcIeyviEyTtMY1Z4hWGa+bApjvQHSgmtgMB1KQrPIe2VNobr/diM7SnhjO2ED Des9KmWw==; Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpN-007PMW-Fm for linux-phy@lists.infradead.org; Sat, 08 May 2021 06:52:42 +0000 Received: by mail-wr1-x42f.google.com with SMTP id m9so11361485wrx.3 for ; Fri, 07 May 2021 23:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b+GCOf42Gs4UdMdK0477XZHtOpuU44Ecgu3QGsmZOXI=; b=D7YXSUvFJ1UwGS+L85/ddn9o7Vw4zuD6OMLrBiYsz5zuj3d44dVU9fOL5dEsSZggE1 HESWScDH+/OMGjnTOi+Gg9msmbatZU98GC70wqhS5l71pT0Zge9OzSVCIg7X2DlbMcp9 c1hdumLmmRg90tivSQMzAtHoUnxtXvoqm+nZ/EmlqFQ5xNRuvh/7dBEoaC48WqOR7Cbw E6QlYKZSIo0VB7RPw2c5F7SdURRi+GPP/h4laftc2bLQExdy6pJL99bgaA2raUhbL4pd 6jZWeBiefAw3O6Nu9MWKX7DIyHp6ikkHJRcGx+F4ycwk6z6k67slL3bErsjEaraEdODc dF4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b+GCOf42Gs4UdMdK0477XZHtOpuU44Ecgu3QGsmZOXI=; b=JH8qKlYZBapQhNOjTXqH3+eq29xsteayj/ZFGbiW4BjreRGj0BVaTEi9lWgH/9FduG 6Ocwtd0011QcnzLOliComJ0U3IRQk6CB8NBnlE90MZEuAINTKP9Dcgcxv0blZpclP8qP PDSI+izvCi64rulFaAci3Zd+aGYkIUFcoRtbFpiV+vUhULGuQkIrzwvIkOMF1qhnggSb qlcb/8H9FDleLiLn8W9JN+SwgyvpmLSZ+Kf2NPyOuT60y0u832WNCOFZiehgBB/Ce4Jq qhdJNzqKO27RfZLb0klJwxlcf4ODxVPTVMlTk35frqZ6pLsfjqlpvsRhFLzz3PLOO7Jk cRag== X-Gm-Message-State: AOAM533tXVEQWQurZLwM8HrEX6qof2KuwVrBMe2OPggxcqOB0j72x5hn aXicfst1JhQNqcbBWA9r4RY= X-Google-Smtp-Source: ABdhPJzJmb7g9rySb6hDTExDxrdT2v6fxhAzYGLCgbfbAq9xJrgWHzJjWZhQvsb+hXEHxu/2QIvUow== X-Received: by 2002:a5d:4b42:: with SMTP id w2mr17885451wrs.248.1620456760085; Fri, 07 May 2021 23:52:40 -0700 (PDT) Received: from localhost.localdomain (231.red-83-51-243.dynamicip.rima-tde.net. [83.51.243.231]) by smtp.gmail.com with ESMTPSA id b12sm11638010wro.28.2021.05.07.23.52.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 May 2021 23:52:39 -0700 (PDT) From: Sergio Paracuellos To: vkoul@kernel.org Cc: linux-phy@lists.infradead.org, kishon@ti.com, linux-staging@lists.linux.dev, gregkh@linuxfoundation.org, neil@brown.name, ilya.lipnitskiy@gmail.com Subject: [PATCH v2 5/6] phy: ralink: Kconfig: convert mt7621-pci-phy into 'bool' Date: Sat, 8 May 2021 08:52:31 +0200 Message-Id: <20210508065232.4882-6-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210508065232.4882-1-sergio.paracuellos@gmail.com> References: <20210508065232.4882-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_235241_540332_5D7802AF X-CRM114-Status: GOOD ( 10.88 ) 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 Make dependent on PCI_MT7621 configuration option and mark this pci phy configuration as bool which has more sense. Signed-off-by: Sergio Paracuellos --- drivers/phy/ralink/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/ralink/Kconfig b/drivers/phy/ralink/Kconfig index c2373b30b8a6..ed0c71eff2c4 100644 --- a/drivers/phy/ralink/Kconfig +++ b/drivers/phy/ralink/Kconfig @@ -3,8 +3,8 @@ # PHY drivers for Ralink platforms. # config PHY_MT7621_PCI - tristate "MediaTek MT7621 PCI PHY Driver" - depends on (RALINK && OF) || COMPILE_TEST + bool "MediaTek MT7621 PCI PHY Driver" + depends on (RALINK && OF && PCI_MT7621) || COMPILE_TEST select GENERIC_PHY select REGMAP_MMIO help From patchwork Sat May 8 06:52:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 12245867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34DAAC433B4 for ; Sat, 8 May 2021 06:52:58 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 88F4961458 for ; Sat, 8 May 2021 06:52:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88F4961458 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=X/W7dcK/4rZtBKLCSosFJyH7Qq/qiNn0Ot+HeyFvdSo=; b=ClhGBWIvF+4A9YMW9K7ji9QTV 1DjKdudfzdRecvF1U+OzZm+7tfM9enuJbpWRj8IgbLLzj/FQwE3ZQN3sA5euHJMfd/a8u6Knc3cN6 TTHsX6E7yPpi2MWcfAtPUQe/5zDGOOKYVk6cfMgLV+SQfPTPfiuJlS9Q6UkZ1uYAyvvg199RuDfvk YoBhFc9mGhoXSctlt3lB3C6VBFB7eSYw/in/3Vd8/ZCYNvzHTcI4luup+v6RX5yGTOqrEIA46XiIA 8LSxK7du4iVagzadDUTUhjrcfFtSofM+Zl3ucCAMgIFlLeebE2t6Tp3LyONTd80LBKD7Ev/Ee9M9+ 71BoePdDA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpb-0090It-9w; Sat, 08 May 2021 06:52:55 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpR-0090HW-21 for linux-phy@desiato.infradead.org; Sat, 08 May 2021 06:52:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=5j0/SkQ5MnH/k0JVcJB2AM+3scDK+wjHcTxj/JFadC8=; b=Bn60q9ABw+WTSVAF/RxR15iLIa 2VxJ1pe1yOoilPmeDD9c2NiZn9PN3B/q8m/CobtAxYFjIsJsj5zon9umbw2LtRGhSYFqlVxk7nX5i pnEjshLgZomRsjEvPUZy8tmTQ0Ac+E9MxACwIYjVJZCKDPoZcmoXl968P7999KC8rLChkmU1Um08y Cdz15lChepDTHST+A8/MTMJgegyfVFwOv0jcojZJYXSCpr+Yvkex1oeXiOjV/rOjdy2YcRiirXf1A Vvy7AIsHxCrm+hzwJfWbWQv1hNGgoKYo9/bptz4+MOh07qZ5xRjYPfBTG1G4hrIFQcecvBHg4myu0 GCu6Oamw==; Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfGpO-007PN1-Dl for linux-phy@lists.infradead.org; Sat, 08 May 2021 06:52:43 +0000 Received: by mail-wr1-x42b.google.com with SMTP id s8so11349643wrw.10 for ; Fri, 07 May 2021 23:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5j0/SkQ5MnH/k0JVcJB2AM+3scDK+wjHcTxj/JFadC8=; b=dZLeUeGgWm6ReD3QMlIYH3+IUdA1AhWyrFvia76N5Lv/V5HNlKbGVPUwPj0qHhRDJY wqlkUBMh8/gJSwCRZd1EmkRiF1yoeVF3nrMNCLxSX4356Dj5iHtQ0zKe1nBSWrW6tYu8 3oHM3+SeH0itadhOEKhGNuk9JiLy3wufpu6bBa4p/C+/HO+m1pmqOXebdIewAAE0fysa UdJ3V5xYqQbBj0jSLGiF0ttCXQvrFKuaMaSRknf2H4ZAVJ81AOHd2W4jz++KC1eIkMvR qEICOKYGI5+7MSxrqEmDkTNqa8cQFfGCF1PsNEHx/9/DMc78KPh9wHPQ3R8B1d6Gv9vt zCXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5j0/SkQ5MnH/k0JVcJB2AM+3scDK+wjHcTxj/JFadC8=; b=NGJGKQbmkkdwS5ng2KemjCm5CuMlGCPT8FzyA1i7wfMyGyrC+prir9KC0Ws24Gk3LA 7R7ERs3P7bQE0lbnu6//xBuL9lE/6y/yAEObPhrbe0n+L1VcRkJh3JbslCrUDNXzH7lN 63khn1pVZMGsSakRD4QgVO3RbzYEHl0QzOnETz/xvSzYmc0qnH+YSvjPmirUQkMRFvRF k0yqVozDtxN4ebhtMGAnQKKaA5Kvsxqilxh8w+R7Qa2GHpCN5wSmXBOHt9HjoqBZ+xpR pGo3re66irWmkB/7aF0lmcPDQ05kATb+X3jK7WEBt2Ba4jvYIxO24+hBG80puG3MiMQc kURw== X-Gm-Message-State: AOAM532m3QNS4NhC2Arusgc86VwEwORhTA4aiHCiI++5VkutS0652zoe frzXgNrT2txf2h/PkS6IHmw= X-Google-Smtp-Source: ABdhPJynptSGPcE0oVi9YgE3/ZJrwY7orEHgL37roQv0+O0PTCkHPNJosQMbhEIGeC/BNx2uNCc0Tg== X-Received: by 2002:a05:6000:4d:: with SMTP id k13mr17715631wrx.98.1620456761033; Fri, 07 May 2021 23:52:41 -0700 (PDT) Received: from localhost.localdomain (231.red-83-51-243.dynamicip.rima-tde.net. [83.51.243.231]) by smtp.gmail.com with ESMTPSA id b12sm11638010wro.28.2021.05.07.23.52.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 May 2021 23:52:40 -0700 (PDT) From: Sergio Paracuellos To: vkoul@kernel.org Cc: linux-phy@lists.infradead.org, kishon@ti.com, linux-staging@lists.linux.dev, gregkh@linuxfoundation.org, neil@brown.name, ilya.lipnitskiy@gmail.com, kernel test robot Subject: [PATCH v2 6/6] phy: ralink: phy-mt7621-pci: properly print pointer address Date: Sat, 8 May 2021 08:52:32 +0200 Message-Id: <20210508065232.4882-7-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210508065232.4882-1-sergio.paracuellos@gmail.com> References: <20210508065232.4882-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_235242_489181_E01DDAEB X-CRM114-Status: GOOD ( 12.46 ) 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 way of printing the pointer address for the 'port_base' address got into compile warnings on some architectures [-Wpointer-to-int-cast]. Instead of use '%08x' and cast to an 'unsigned int' just make use of '%px' and avoid the cast. To avoid not really needed driver verbosity on normal behaviour change also from 'dev_info' to 'dev_dbg'. Fixes: d87da32372a0 ("phy: ralink: Add PHY driver for MT7621 PCIe PHY") Reported-by: kernel test robot Signed-off-by: Sergio Paracuellos --- drivers/phy/ralink/phy-mt7621-pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/ralink/phy-mt7621-pci.c b/drivers/phy/ralink/phy-mt7621-pci.c index f56ff10b0885..242c5d8b8635 100644 --- a/drivers/phy/ralink/phy-mt7621-pci.c +++ b/drivers/phy/ralink/phy-mt7621-pci.c @@ -273,8 +273,8 @@ static struct phy *mt7621_pcie_phy_of_xlate(struct device *dev, mt7621_phy->has_dual_port = args->args[0]; - dev_info(dev, "PHY for 0x%08x (dual port = %d)\n", - (unsigned int)mt7621_phy->port_base, mt7621_phy->has_dual_port); + dev_dbg(dev, "PHY for 0x%px (dual port = %d)\n", + mt7621_phy->port_base, mt7621_phy->has_dual_port); return mt7621_phy->phy; }