Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1131375rdb; Sat, 18 Nov 2023 04:34:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWtBP2MRcn580abgQ058s8wvDnv84aCcSveP4ra4qYoAUrc3JzVc5x8qzfTiApNIV/Hcqb X-Received: by 2002:a05:6a20:a129:b0:187:c7d1:c471 with SMTP id q41-20020a056a20a12900b00187c7d1c471mr1716389pzk.34.1700310846789; Sat, 18 Nov 2023 04:34:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700310846; cv=none; d=google.com; s=arc-20160816; b=X0O6HTiMNVp+VMmrHxVtcy3FueEfIg0OqMZPKPLV0+DEVdKxUS1lWV99lHMXSnVgRI PrXkNJM1Tn3DdzLFMGaBnbtfmUz912g3NHndGHiZCOtZgxP5rNHYSXeEplIXaVZM+liI vd9Aqord1Cj+Lw0WdOnZh1101xSViTHnGKd5E/oltAlPC2n/hosF3SrJnU1Fi5sZtgGk C/43oY7RlJ+Po8bNNrtCoPJhbWbYBE0uEaiNETz+6DDD0OR+ckBE4WBCGlAXfgd13gov /lNj0kxZUw8i2iRCsf2rSQqiWcGyXJ5ucK6d86P6kdOE6Wbrlx0Y5b06iJOYMmlBV9ip GiFA== 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=ZtdlEhKOyuiPVha2wgsgCEA05URREqqP5nWTX+JvIXk=; fh=pxvM+Wf6tCsucgcJlpaT+KtPH3mT2/1sv0nByOcyBzY=; b=j+G6hNVL7FCg+Qtmwwb4PXnQHeX4MgMYb9DU/n9FJZgDe3n63Hz5H7fmZeiKHF146L L+Qos93gFgZJ0wOyzhP+RIHWUwRZCzTXqLE4ezERoo81DcqSZmSNrVBGOPU1af0/WMra RDG8SQCXqs/HcRRkrmlaJmUbVXNvyEooZwq/gFvsnWjYg59ZiEDeJmlEq5Tx8cQ3UTXr dQl1k3KgUViB+LCqZ3zJBIqQsmDafQSfQm24rIyLAQzAV1HXB+NiTsly7fyCoGs4UY0n 3jJs6pZyso7D6vWlbHiky7GB6H5Dwv69t6nm50Qrv1Rdxzy4ILotOju3m1tahgf19Y5S 34WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=DsEAibtI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m11-20020a170902768b00b001c9af07788csi3979340pll.76.2023.11.18.04.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 04:34:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=DsEAibtI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 950E180408D2; Sat, 18 Nov 2023 04:34:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233098AbjKRMeC (ORCPT + 99 others); Sat, 18 Nov 2023 07:34:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232958AbjKRMdv (ORCPT ); Sat, 18 Nov 2023 07:33:51 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE1EC198D; Sat, 18 Nov 2023 04:33:37 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 09654E0005; Sat, 18 Nov 2023 12:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1700310816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZtdlEhKOyuiPVha2wgsgCEA05URREqqP5nWTX+JvIXk=; b=DsEAibtIejtYsVZTcsXoDs07bY1ctbzGpz5auFD6Q8PRck/RL/Aq2CmgXV8hEeGqByEFO2 Dn3PdQw5ClDM8Ta7em7npYm4kLD4uIunqphB/kznadzOVISczYiv438CozSh8b+hRcrPFO beAXs+9rThPsVCR7U06ySwFNA0ywYUhG1TLyjSIqfWSwGH5xi7zu1J3VukOIK5j4cjBO8n knfNWYRG1TiRuL7Gpgrq21br4W47dlgwAS6o52CKiHlzftQtgSAwxBDE4TTiJYbWuwMPw+ sDv99xDJYH9ZGVfOzwXuJiD1OsG8ZZ1FmC4t+48K+zzuhc9ywSCwhItMnaTnLA== From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= To: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Daniel Golle , Landen Chao , 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: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Frank Wunderlich , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com Subject: [PATCH net-next 09/15] net: dsa: mt7530: call port 6 setup from mt7530_mac_config() Date: Sat, 18 Nov 2023 15:31:59 +0300 Message-Id: <20231118123205.266819-10-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231118123205.266819-1-arinc.unal@arinc9.com> References: <20231118123205.266819-1-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 18 Nov 2023 04:34:05 -0800 (PST) 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 7de55cbf19a4..ae037ff7d4c5 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) { @@ -2608,12 +2614,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