Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2798387rdd; Sat, 13 Jan 2024 02:26:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzVBBGRiu+H9ftc2yOoLEGMDKOsPrOAnUNWL5ROrc09KblxsRP1eKX1qUnvq5iNTPV893M X-Received: by 2002:a17:907:c31c:b0:a28:cf59:60c8 with SMTP id tl28-20020a170907c31c00b00a28cf5960c8mr1885276ejc.33.1705141584254; Sat, 13 Jan 2024 02:26:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705141584; cv=none; d=google.com; s=arc-20160816; b=qmSR8mB/hTA+utLOSG+JPnI8QUgPoBNiVDPenGOPhjKbSyLIyJKKJ4r1uQv0jZKWQr pqh8D1zSheCzfSj2Bv2V70PiD34QXR4MSxcCvfohyv8jxNa0xCzaKsp0yC4S8lZtFw0T 7aGLUJHpl3YkhNbJphfxjpL7+x0+lLgyxnbPQ0ANRKUCjrTcH+/8TxBdflmboJkTVuFl Ynyb59Fjf/H2SX48iuC4LZvENa0moon0c0D1y9nREkF/15BVVMENFgwmYW+My0Wj31MQ 4Awpg4Uh5B2xmHn2Qbp7f3UpUYCx/WhkfDXpPuBc28Q/FClojdLlO2kW1nx0aT7JVsV+ UZQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=S6PR5JGEAek5VQlFaJYWYFlss28deQgkrXKo1sEIWNc=; fh=oEE+jV5O4HAXE+nw8ulhLME5zcU0kdlsqoguEBeScfM=; b=hdOZjZpYB8EN7DKqnS9OsIwYiGNnFlNo+vB7bDoB50uzMvjIUDVQr5yApWqJO0ziCe xbLv8TGd5R5bBO6+8jzIJwT8Y6JsQ8sStX1qmGMyTSf6G+OOL2xtZSuE2KT8WZ5vwgMJ +eboh8JCWgs4uty0w68BcPCDvLT2FOSVG414XqIPhxq5Nv7SzJGotB+Pv6tYZ6B6MDtb snMb6PeNFdjWuh6v8BUTawHYctFublbrWiBBK9MMqjeBuzJaQ0rQjm4XGnnp12utKWMv NUj3qNr9pXP3YgMz57XgyAXjAtQJRLD3PV3NyTheMQ6FxtPVEl8Wl3Ju7JB1Mvi/btRo H3rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=FUMfqIEX; spf=pass (google.com: domain of linux-kernel+bounces-25252-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v24-20020a170906181800b00a28ceda55b5si2175333eje.361.2024.01.13.02.26.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 02:26:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25252-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=FUMfqIEX; spf=pass (google.com: domain of linux-kernel+bounces-25252-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 05B271F2130B for ; Sat, 13 Jan 2024 10:26:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71E0318E0F; Sat, 13 Jan 2024 10:25:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arinc9.com header.i=@arinc9.com header.b="FUMfqIEX" Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (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 680BE17BD0; Sat, 13 Jan 2024 10:25:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arinc9.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arinc9.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 7E6CC60005; Sat, 13 Jan 2024 10:25:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1705141554; 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=S6PR5JGEAek5VQlFaJYWYFlss28deQgkrXKo1sEIWNc=; b=FUMfqIEXGMy7I2/J6vIBtHuksHAUdWIrppJruEgZglmg+w9glssAfoHdQb+0Z0S7VLgFld xELOJxjegiI4gsXk/FjwPTxQgsfMxM7VBTmQMPXLlrEQDA4AGVRMan2hNbHNwjTVKT8OiG yhhELNvusdzgVd7MO7tQWSrIu9oIuXemfIKtHZD4mX57zETbVoCW6yhL/3paj54XAXC9bq S3KNtoEvf/tEUZOaxhWsOLNSonnbQ2ogn6iVqSJhBT+7JWp6yo94+Fl+/FS9bHaTEIIQwn naXjEqhQvTFQ4OrrMzIM+7YGREXW+lZZF7YAnxnlh0PvipAse9OQQ+4M5TtovQ== 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 Cc: mithat.guner@xeront.com, erkin.bozoglu@xeront.com, Luiz Angelo Daros de Luca , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [RFC PATCH net-next 2/8] net: dsa: mt7530: call port 6 setup from mt7530_mac_config() Date: Sat, 13 Jan 2024 13:25:23 +0300 Message-Id: <20240113102529.80371-3-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240113102529.80371-1-arinc.unal@arinc9.com> References: <20240113102529.80371-1-arinc.unal@arinc9.com> 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 X-GND-Sasl: arinc.unal@arinc9.com 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 88ab926ce19e..434028e9667d 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