Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6657693rwr; Tue, 25 Apr 2023 01:32:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5SqFRAnlPvNKWr5lZR9KgM3IlAgI/M0h1MiGqWjc/vPwf40cDGqyfs+fy98SJx9vZlrdkZ X-Received: by 2002:a17:903:120e:b0:1a9:7ad8:9765 with SMTP id l14-20020a170903120e00b001a97ad89765mr6256687plh.3.1682411566517; Tue, 25 Apr 2023 01:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682411566; cv=none; d=google.com; s=arc-20160816; b=uSqASRjVj2Jcrbx2GpuaeWRPd0GG5Ca9YkezenveZcBHIZggclq1QJ8KTGTy568nOC M5iWMifUC/irgNIQhqU6Jxtq5i9fB2XnjklIba9qc3XLQBM1cRNMwVpaF5Ne8rG/mKMF Qs3dxf+DROtqhcQaTfiHV0TbvSSEjHYwRZNzQn/fQQm8Qg/hY3nX16lGUpeUOOG66bNS xlQlrwazuTviWA1MhpFPEW5BeVHdRoUhMW4nDAfa5mDREfRj7EHnx5k9VY41FcOij86J T08SmSzglqnUmkLYs99SMQ2WULbNKwn2QtcFoIUMwnCTxZCYssF9rjJ9UMFXlhw30EsJ 60rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qYvT8p6k4QzjjyECcMuC9v3ADC+KmlXGNmZgRR/65Uw=; b=Mn0BXK0pM2rW/CxeUgCpiSTGORzf7SG605Szf62HMG5JRDKSVyCzd7oqLZyIzj0/3h DpUCSnfTDova04LvWqY0sBThBtwSwZ53oose1vpJUyomNzArahyy/jwov1+F944aKjO/ PVsMzqw5Ic7W18Nv7iP2mCt97oOZgBt51tG3qyJNxxB42Nm/676uJ/LuPbP0AJIBoFr4 2TSURj4FZ8YmoiLHefP1isrud4By1Bosr0wKCoob+FA4r+b6oCU5a7hxoLzjjAgdY4ps EX2Tr/fhTeEthcIc5u1dbMNUxjNjHORGo98uJYtSW60Z+dal5WIgNuRYVDWrdl26sQR7 p3iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=UFAWV+1n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t145-20020a635f97000000b00517ac1a9a63si12602147pgb.129.2023.04.25.01.32.35; Tue, 25 Apr 2023 01:32:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=UFAWV+1n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233749AbjDYIcE (ORCPT + 99 others); Tue, 25 Apr 2023 04:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233692AbjDYIbP (ORCPT ); Tue, 25 Apr 2023 04:31:15 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11FD612CAE; Tue, 25 Apr 2023 01:30:29 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-94f3df30043so855633666b.2; Tue, 25 Apr 2023 01:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682411418; x=1685003418; 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=qYvT8p6k4QzjjyECcMuC9v3ADC+KmlXGNmZgRR/65Uw=; b=UFAWV+1nlYwHQzmvVoN+/ZGHkk8Ew6bnLA4u2VQgfyZAcCJBju7Y+Fnro9dB2ZJtL0 C/alKxlYDz+fVsz2Ihz4l80W0RV4ghlklTO7m0U8xCQt3BL19sExvBSbXszlA0fF6KUk 1eITtM+juvDNuYId73jffkWAARmjB9pviSHpLvr0G3+bvGzduU7EIE32owSg70FaHljV wWYUuWlVANCESpYjAgJirzkcRVCU0+Wvx1QVDp7nZ1Pi0nATIdzczuM2KNxXe/rTEbfl P/9HAYz0wiH6MA/4MS7xf+biFw8kB9lzoyu7P1N1r3+3b+uBVZAXKHytk6mRS/8QVtFP xxbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682411418; x=1685003418; 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=qYvT8p6k4QzjjyECcMuC9v3ADC+KmlXGNmZgRR/65Uw=; b=Z3WzDeUKKgL64+nlEyPYWq5Pg0RTNAnerfddIvmTBTMNpwPiqZeF9GUWsXaTwe30uz kejZbT9B0gkO03e9DBRUVuJv+GF6DPrHVDVt/DFp504egCK8VYhck/F7dgnZQRJYjteM 4rlbqZIQos5ejzCyGFnWG+RGCuSI42G7x1yIVQoZnLcgzw//TEbF39wRfqhU8CbdaxNd tgOKJKV52GruMw+bxJZjnGsy/QsmwvmfGhZGqowgYQZ+HDUKtcHhodWrrD4R0SrqwYBn fw9tBHnZcWfJwWHS7IGxXoEOiLhEjQgXsfesIr6rblFEf4XaEf87U91NmNATT5lXCTah BObA== X-Gm-Message-State: AAQBX9edzSRFGNGGTRUfxycSDoLX8Q4m0I/wciifp2w2FH1ivkKDgvEX Sn9it3HmLm1go8o+M+bx2Mg= X-Received: by 2002:a17:906:d8ac:b0:94f:37af:d21b with SMTP id qc12-20020a170906d8ac00b0094f37afd21bmr12578329ejb.74.1682411418239; Tue, 25 Apr 2023 01:30:18 -0700 (PDT) Received: from arinc9-PC.lan ([149.91.1.15]) by smtp.gmail.com with ESMTPSA id mc2-20020a170906eb4200b0094ca077c985sm6439028ejb.213.2023.04.25.01.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 01:30:17 -0700 (PDT) From: arinc9.unal@gmail.com X-Google-Original-From: arinc.unal@arinc9.com To: Sean Wang , Landen Chao , DENG Qingfang , Daniel Golle , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King Cc: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Richard van Schagen , Richard van Schagen , Frank Wunderlich , Bartel Eerdekens , erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next 11/24] net: dsa: mt7530: call port 6 setup from mt7530_mac_config() Date: Tue, 25 Apr 2023 11:29:20 +0300 Message-Id: <20230425082933.84654-12-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230425082933.84654-1-arinc.unal@arinc9.com> References: <20230425082933.84654-1-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arınç ÜNAL mt7530_pad_clk_setup() is called if port 6 is enabled. It used to do more things than setting up port 6. That part was moved to more appropriate locations, mt7530_setup() and mt7530_pll_setup(). Now that all it does is set up port 6, rename it to mt7530_setup_port6(), and move it to a more appropriate location, under mt7530_mac_config(). Leave an empty mt7530_pad_clk_setup() to satisfy the pad_setup function pointer. This is the call path for setting up the ports before: mt753x_phylink_mac_config() -> mt753x_mac_config() -> mt7530_mac_config() -> mt7530_setup_port5() -> mt753x_pad_setup() -> mt7530_pad_clk_setup() This is after: mt753x_phylink_mac_config() -> mt753x_mac_config() -> mt7530_mac_config() -> mt7530_setup_port5() -> mt7530_setup_port6() Tested-by: Arınç ÜNAL Signed-off-by: Arınç ÜNAL --- drivers/net/dsa/mt7530.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index b3db68d6939a..6815d2579f37 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -401,7 +401,7 @@ static void mt7530_pll_setup(struct mt7530_priv *priv) /* Setup port 6 interface mode and TRGMII TX circuit */ static int -mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) +mt7530_setup_port6(struct dsa_switch *ds, phy_interface_t interface) { struct mt7530_priv *priv = ds->priv; u32 ncpo1, ssc_delta, trgint, xtal; @@ -473,6 +473,12 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) return 0; } +static int +mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) +{ + return 0; +} + static int mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface) { @@ -2570,12 +2576,15 @@ mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface) { struct mt7530_priv *priv = ds->priv; + int ret; - /* Only need to setup port5. */ - if (port != 5) - return 0; - - mt7530_setup_port5(priv->ds, interface); + if (port == 5) { + mt7530_setup_port5(priv->ds, interface); + } else if (port == 6) { + ret = mt7530_setup_port6(priv->ds, interface); + if (ret) + return ret; + } return 0; } -- 2.37.2