Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp712632rdb; Fri, 2 Feb 2024 01:21:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHy1aN/HzZG0dJAd9xRWFpcY41jRAaCHW4S6lEk8gDH9VOCfeVjBV+QKTgT8pQhvbdbQOkY X-Received: by 2002:a05:6808:120e:b0:3bd:f198:d113 with SMTP id a14-20020a056808120e00b003bdf198d113mr7105181oil.23.1706865661749; Fri, 02 Feb 2024 01:21:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706865661; cv=pass; d=google.com; s=arc-20160816; b=m6dxTIXIPBArP29ua2ybwJ4Js9aQ+BWZtgieZ/lVCO/sWsUZfqAi2wK8LU7e2P67vh Msu77RhK27SEloGfEtmvHV5+nYQTaOCduD/1u0hIqVUlpCZE00kkGVEvLBlB6qWTg0N0 Aza8xMn0V7scgAUFjYsADBmCmjy2kz8jGxq0l/ZtpAQyWRrHkLt9cuLwEdIBBUU947ig 9OSdR4F6WZfqTxTbZvyIUrrPRV8HLHqu1SkRwU3K1Xx+BRE+uxzJAjPf5fEVBW5pmUPr B62u+LnW2BEqglfLe3IfEbgsgmSfqL/EqWydqkKKlDhEjBat61CReVPjIqFV728nb+qx YD2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=N9wyiNwWfFjOffwnEaBPMBQdrIFm56ebopuAE0kIvag=; fh=BYWm2E+/fRS3CU0G26KlrRD05/7USpCyD/hdtsPK5LA=; b=f3W27cUoMpkdWpJ54HXqtypz4LslnSXWD/MMKxKRAO7P6Eq+q/mwbmzwGbABeNt6Qa 7urL7dFwAThJohDK70cbSW6TyGa/JMvrYFZEwyjzpfZy98IUr5Ems8vch0AtGRVcxsv0 XONLgxkmYsGGLFVX39CXBHcG8rVtTVfYWNBdBTZ5pJMLkYu7f6vU7e9F2QpO+MMT690y hIGN40o92Ez8ugvVwqp51DUBx0x1yIxaKGUxhFvOzUUInH59UKnOX4o+Bfbwb7/xTuk2 5KK+q0MCImTWs4gLOyYXwBE++yowkZFbqt/JhrU9PjyPgAWeMl6dVK7aeBOS9H4RQRPY mqEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PujNNZov; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49545-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCU6LWaoyQ4QZCthGFVGbNw7URygDWlKXopoaxeRVrw2//PuNRrVBuURMHz9Y6S9BNKNML5+X+VIKNL69RnBBhLLlbtd2ivY1XvZF3PKxQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v8-20020a05620a440800b007855b129202si417189qkp.164.2024.02.02.01.21.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 01:21:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PujNNZov; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49545-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 665E21C2413E for ; Fri, 2 Feb 2024 09:20:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2836377F37; Fri, 2 Feb 2024 09:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PujNNZov" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22AF562816; Fri, 2 Feb 2024 09:19:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706865573; cv=none; b=BzQWgkvNSCFG2VaV5/5Ue1UY3Ymtei0KFXP9rv6ReqcfLfxS2JUDRMCSq40ar2M4PHrSoMNIf4DRbnI8JYX1JTJ3PoSY2zbFWk1BkQIbhxaQS301K2HCdpDH7R2mFkxRkAp2EZyS1l2cqvlVPyufkTavtbS0r3k4O5BO/ZzVWTI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706865573; c=relaxed/simple; bh=urKbjaUWgGpmRsfGLlhmq0QU5w9x/bMdWCZ0Tma4ii8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QEDFB7MLv/vBuCFu2llONfVglpNFo6KEg6K0cOfjAC3apmc11P04v5R0+gRRkJUlBn67L0Np7D1c7s1HlwpojQN6XchcfhpknAF8G2hH2xyseKEBH75+HLz8i58tAcRI2dJNo4uGUQq5jY+AXscbTJJ44bRBfP1/G9/kHHSiSKw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PujNNZov; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id BC4B3C43394; Fri, 2 Feb 2024 09:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706865572; bh=urKbjaUWgGpmRsfGLlhmq0QU5w9x/bMdWCZ0Tma4ii8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=PujNNZovB8TFADhjdZ+fXuswL1UiwaS355iNsNditbq32kP6JJH8HG/CV4GN/7OM2 uj51ZtoB/w5NKhHdPrIh8/4G6/Nizara0C998nxHW65ZrzSjKHjMMX7Vdzg3rFXRbR /PMBU7sIZl+Uh5BrUHTquDkrt8qhI4HJ6ssn7+5Pl0A7XPldlxMy8C6pDQ8EVgOCnn qiillI+YseDzOHmYWL48wktvtAQjPxsbteZfKfhQAt94NcLmWFqvUVePtHFXVhUDtU cKHf7RV7gDWlSvEb114+p2vzuC8vB2nHttckNrC+dgXIY7JgPNCy4KMHsx0eaYV3zF CtFOfl+gQlMHw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A14DFC4828E; Fri, 2 Feb 2024 09:19:32 +0000 (UTC) From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= via B4 Relay Date: Fri, 02 Feb 2024 12:19:08 +0300 Subject: [PATCH net-next v3 2/7] net: dsa: mt7530: call port 6 setup from mt7530_mac_config() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240202-for-netnext-mt7530-improvements-2-v3-2-63d5adae99ca@arinc9.com> References: <20240202-for-netnext-mt7530-improvements-2-v3-0-63d5adae99ca@arinc9.com> In-Reply-To: <20240202-for-netnext-mt7530-improvements-2-v3-0-63d5adae99ca@arinc9.com> To: Daniel Golle , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King Cc: mithat.guner@xeront.com, erkin.bozoglu@xeront.com, Bartel Eerdekens , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, =?utf-8?q?Ar=C4=B1n=C3=A7_=C3=9CNAL?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706865569; l=2415; i=arinc.unal@arinc9.com; s=arinc9-patatt; h=from:subject:message-id; bh=B4ubcnj0kkoG/x10O/6vsrHgrghUPFvE8EQyfqv241o=; b=3S1dUOXUt3XkWFYjkGi5E5aLXTgWmOauxCmS+JNwup4u8gHV95Ic0EIcSiuILU+dmpv06jo/I E6WP/g3PbsZAlC92rWs/2qG4cixotc26yIkGHOOyDwrKwkNIE/P//P2 X-Developer-Key: i=arinc.unal@arinc9.com; a=ed25519; pk=VmvgMWwm73yVIrlyJYvGtnXkQJy9CvbaeEqPQO9Z4kA= X-Endpoint-Received: by B4 Relay for arinc.unal@arinc9.com/arinc9-patatt with auth_id=115 X-Original-From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= Reply-To: 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 code 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() Signed-off-by: Arınç ÜNAL Reviewed-by: Vladimir Oltean --- 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 330e22abc076..2d468a5f2e70 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -415,7 +415,7 @@ mt753x_preferred_default_local_cpu_port(struct dsa_switch *ds) /* 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; @@ -487,6 +487,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) { @@ -2624,12 +2630,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.40.1