Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1085304rdb; Tue, 30 Jan 2024 07:31:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IETiGwtyBBSfdmuDs6ZG7OSH/3cmURmV2jwurk6bfYWSQaXCbMX68wgVVr7Y2rXxLMVieGp X-Received: by 2002:a17:90a:4a8e:b0:295:5273:e0d7 with SMTP id f14-20020a17090a4a8e00b002955273e0d7mr3758198pjh.17.1706628683505; Tue, 30 Jan 2024 07:31:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706628683; cv=pass; d=google.com; s=arc-20160816; b=qeLGowejb8zkGk6p/BjDnDD5ZVA5r2YeOQVl6WpUGsNdV+1BFuiwbZlTl1Ej/5dcCD kVcx9NWK78uCNftWKfh4xwp6jnafV3KZxN9sxEvmdqEHyIpI/kbl8TmWRtjqXlQugfGG 521S7lTJoUNzdOSRsUVkapvItRKiodFza+07rvZbvfdMI1zLkevULgWFfiMOfONvMsQ2 rtvRVOZ3jmhhdF9rKLLHvCXA1x+6Sl8D+ASUxVE3hxnneMcGME8wQnShEN5NQu4uxaEK GkVAJvN+kYH06rKAghleoz2fLDwUWzQWC/r/2dUCsvtJHQzH/MQo2xJmIcF9Fatw2IP6 vazw== 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=xNlE86XmqkSplYYMvvd74gD/RbF2aUqtHPBgVCVc3H8=; b=bFyCPicwprp+e11RTIpLrOuUShL3sUR6Xbu4QQU94eEJRx4t4SPl/YRukw1evAWuRs srQzdCLBFLx/x1IvyIa11H6SzMuq/amyExO9r1UlYzOZMsIEml5doHqRF/m0gXpahYKc 7ikovM3h5PNBOco2MmseKK6h6UPNFWAfwVxeJmEJbAF9RxNj29DNXt80JtUnLsptgnZt Y4XWJuI/F2LXVLNm5x75gWqF3u0uLWB6OIW5kVVAslMXK7iJgyPmsV+1tCVeKodeOe4K lJzJKTJA8VG1cB6qx4AiDPchA7I6G+wFZkGDcS2MccyRlmI1tXUuEvoPJEYdy6D56TgQ k+oA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nvo9wbGt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44826-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44826-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q8-20020a17090a9f4800b002943cd1b20asi7224903pjv.93.2024.01.30.07.31.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 07:31:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44826-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nvo9wbGt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44826-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44826-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8A066B271F3 for ; Tue, 30 Jan 2024 15:21:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 097A086AEB; Tue, 30 Jan 2024 15:20:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nvo9wbGt" 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 1AD8A81AD7; Tue, 30 Jan 2024 15:20:56 +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=1706628057; cv=none; b=jYI4kA3mLV38pbLSNK4GaURM0zMp1y+S/jOaO1W9GsCEcDOgeXuUymOlU+HOIke2QQxM2OVyHDEpv/tn+XFU4dqiGW7uROBaO1AaDALHMZXH1Gdo3SHdH1zPywrQYm3KQIw+sp3fkjOpOqnaufjv9Tie/is+OSQYsjP8p7aBKe4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706628057; c=relaxed/simple; bh=urKbjaUWgGpmRsfGLlhmq0QU5w9x/bMdWCZ0Tma4ii8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GETddBcNrkwSd/fuMvudKEgc+g+NJ0sTlk6U69jQRJtKogOOnr3u2ZHyqfefJkpZb8Dpe4+HVXqc9ZCKuQhRNfaQfhni98dFgHlhV2QY553P/E2yvWwRFuPPRh//Sz19iV8e6DCUzqgh1uOk7rB7gV6FNb0DJd10nJVYFxiUzhA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nvo9wbGt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 9A2E8C4166D; Tue, 30 Jan 2024 15:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706628056; bh=urKbjaUWgGpmRsfGLlhmq0QU5w9x/bMdWCZ0Tma4ii8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=nvo9wbGtpPPiUFswiARBXPIMBmrsH4GtX+buA4eMja60CSVG0YFy7wzkyqCK+1lwE +GDmaekusoIeXUyjVTtPF8HKw5XHT5OiDz2hTOgZfPvsFMYkFdXRhO/ZXopAd5cvb6 BvEFDHZzLivMqZtv7yYaBxVPNpWWVt2sNiDBTKbCs+x9ap75hwdcUGJHdaz2yPeglL 8p1i2pmI9whdRltCi9O6RbfLV+wivSbfxBTrAxhAx0uysk0kx7g2djgr50ZFYjG/dk az/oNK2QeW8qZTctxe9bBs7ne6JwusuF8h9N1RyuOx8pj9b3GE83HmRNIsA9Nj6qDU m8qKCzHT+udEA== 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 80965C48286; Tue, 30 Jan 2024 15:20:56 +0000 (UTC) From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= via B4 Relay Date: Tue, 30 Jan 2024 18:20:48 +0300 Subject: [PATCH net-next v2 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: <20240130-for-netnext-mt7530-improvements-2-v2-2-ba06f5dd9eb0@arinc9.com> References: <20240130-for-netnext-mt7530-improvements-2-v2-0-ba06f5dd9eb0@arinc9.com> In-Reply-To: <20240130-for-netnext-mt7530-improvements-2-v2-0-ba06f5dd9eb0@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=1706628055; l=2415; i=arinc.unal@arinc9.com; s=arinc9-patatt; h=from:subject:message-id; bh=B4ubcnj0kkoG/x10O/6vsrHgrghUPFvE8EQyfqv241o=; b=wbVqdldAsfM1ptedSTSHFLY6w81KMOBuljiOmmDQyRJy/pjSzp6o5mguOME2GA37HmfLIWlAe klPsSsrP+JxAXUjsWpyjZnLc2kF0D2prDTdf1Y+kkIVCWzCLSam++eq 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