Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1676543rwl; Sun, 26 Mar 2023 07:12:02 -0700 (PDT) X-Google-Smtp-Source: AKy350booQP+Hdddw71TkxOrh+GvmG8gjSRdUONDS/bcha61roWtlxzLcEgP5IOWl6kiyTJlsGxv X-Received: by 2002:a17:907:a0d3:b0:944:308f:b977 with SMTP id hw19-20020a170907a0d300b00944308fb977mr1568114ejc.16.1679839921959; Sun, 26 Mar 2023 07:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679839921; cv=none; d=google.com; s=arc-20160816; b=IDD5X237RrtTQhRQHaBea6a5go94sXky759lrcZNpjZJjlRpRKF1dWkiaPhWN467ph 1i4V30NxW+aU1h9xsZFWJwqIpf0F+peCnKsPCkHRKDXhLEfT5KEeMowGxjsRWK+XgWNX NcEIBv08xbUds0U/x2EHmYJZXD+gGDeDvLXX2q/aHzY2ZCsYUziFHxyh+IUriqd8F1yQ fspZyzy4DKJR40urDn/BU99u9heUT6xgM+l/xAbXr4baNL4cn9MABcteVGJw2c763ejU dJri3SliZLjj2dKaJErY18I6EzYnOtV+5ZdvZ7IQ93v84ukKtyGG7fkVKpYpaE7IYmVp y7Sw== 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=l2Yyxz9FOXIN+XxKXysP1ZnBuTmwMg6crObSsecZNr8=; b=hvjIoZiPU31dm+gn3mSSTOSQAZE8nTkImdnqD6T7P7d95wGSbMfMP5Ox0g7roTCSNd f5KLRxAYD7sa5BnzV2iTtOjMOEq+MuDC2o/I+Um2wqqndyA68c++VW3hywv0guYNEvE5 7+cC4VUST60RNMGQtePITHdTw0QuS3BimWAUoD0l1jod2froh9x/b1h7y5uEUiu4mLgQ 4RdSU/tTvhIghgUhSdxLq11trP6KfAgOWHD/YI3+V+i7TZAcOjquHmLqzNa7oPh8k1Aq t/nrZl2+HSmX/wRcXVZc3iwPcUdJm2FO6o1ilLbU6NavSOGQoaCYNZiyTN2WUHNx1IiQ vUGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NI8IIylX; 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 sg9-20020a170907a40900b0093e3a33d7easi7387621ejc.451.2023.03.26.07.11.37; Sun, 26 Mar 2023 07:12:01 -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=20210112 header.b=NI8IIylX; 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 S232341AbjCZOJm (ORCPT + 99 others); Sun, 26 Mar 2023 10:09:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232233AbjCZOJT (ORCPT ); Sun, 26 Mar 2023 10:09:19 -0400 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A16FE5FC2; Sun, 26 Mar 2023 07:08:56 -0700 (PDT) Received: by mail-qv1-xf29.google.com with SMTP id oe8so5102312qvb.6; Sun, 26 Mar 2023 07:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679839735; 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=l2Yyxz9FOXIN+XxKXysP1ZnBuTmwMg6crObSsecZNr8=; b=NI8IIylXLN/RgzXXWYF7gu7Y136mGEoIWcy2BmwQXde1fXTgnW85aakyi2zYxJvTyb Vba+bXe6E09H/83NDOXX2JN/fSi0a2BP1xX5+FkEygF3z4Fmn891UFnE98kezsNnENwt KcNY+pC2skaiTOzjjzBbKhwTUao1aGM5MCC9DhfdCfMRSFfFmKE3/gRFnBAQy6V6Epuf /oRDgs9UNYCJVwcMWBpwlwCL1PJt0T15cgWtkN1eYaRXiIjIxrSeowGNfQzedRtMQHYQ OqS3fhzbhKPaUtQg6NtU19Sl77qMGDA3K+4bdcITqZ2IFMXEkgbQKXL68JeBCWtYKf81 oZUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679839735; 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=l2Yyxz9FOXIN+XxKXysP1ZnBuTmwMg6crObSsecZNr8=; b=ad5jFGxEfkkSeij2GPc25wBOgpQwKngYRMQigIHrHWuR/vt6Z4D90+qCkml5t8FH7m Av47e9TGOdzshS/VxYR8nBFHEViqmFpOxK8v3aohxvprKH1TgIvZpGzQZ6b4Cpe4qs1P aVc/uz4R8mNLPQQvEC+bb9C+SsJF/F0FE62Wpb4NLu+eSQpJqQnNfCukiAex3BqO8ndw lvf0/Hfk6lPGD+oBTIQemgakE1xGjDNQ0pA11EIGNp+mIMN7Hqyx0it5irK72ipl3UK1 Uj9w00YBKiBBeUjFILeoiQGfwywaj9+bmTQTTqN8hicRarWCPl1yNIUSdGtKTJzCx105 2jRA== X-Gm-Message-State: AAQBX9eT3b17HnlcJAA7V8LG+mujHd6EJ6IQeGvCHH9qkihQBR79qwCG 4jBcT0KOD+05cI+2r5GNn3c= X-Received: by 2002:a05:6214:48e:b0:5c2:7d8d:ed0f with SMTP id pt14-20020a056214048e00b005c27d8ded0fmr16735897qvb.12.1679839735529; Sun, 26 Mar 2023 07:08:55 -0700 (PDT) Received: from arinc9-PC.lan ([149.91.1.15]) by smtp.gmail.com with ESMTPSA id j5-20020a0ce6a5000000b005dd8b93458esm2212220qvn.38.2023.03.26.07.08.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Mar 2023 07:08:55 -0700 (PDT) From: arinc9.unal@gmail.com X-Google-Original-From: arinc.unal@arinc9.com To: Sean Wang , Landen Chao , DENG Qingfang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , =?UTF-8?q?Ren=C3=A9=20van=20Dorst?= Cc: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Russell King , Landen Chao , Ilya Lipnitskiy , Richard van Schagen , Richard van Schagen , Frank Wunderlich , 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 6/7] net: dsa: mt7530: call port 6 setup from mt7530_mac_config() Date: Sun, 26 Mar 2023 17:08:17 +0300 Message-Id: <20230326140818.246575-7-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230326140818.246575-1-arinc.unal@arinc9.com> References: <20230326140818.246575-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=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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() Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch") 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 2397d63cec29..8d49803f7522 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -421,7 +421,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; @@ -493,6 +493,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 bool mt7531_dual_sgmii_supported(struct mt7530_priv *priv) { u32 val; @@ -2523,12 +2529,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