Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp526235qtg; Wed, 5 Apr 2023 13:42:28 -0700 (PDT) X-Google-Smtp-Source: AKy350ayJRu+LTR7uChpre8WszpM5XhXYy5q7ufW1H6QectkafivLArsfEBP4KMZ5B6RL+52yyGb X-Received: by 2002:a17:907:5c7:b0:928:796d:71e8 with SMTP id wg7-20020a17090705c700b00928796d71e8mr5153527ejb.3.1680727348417; Wed, 05 Apr 2023 13:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680727348; cv=none; d=google.com; s=arc-20160816; b=oJ+Ii582xV4VnIPDyGJlMYtTjJudpEEVMSu5DTaen0g0scjEV84BAH4ar8yUt6LHWF sBf2C0uE7d/KYDYsn5neSRfqxiN6Q1MJ7E9/RG6Zhuwo9Fpy05UMXWAmGhhYQJv2PZHL cuqbm/Jm80tLzXZdZHeDvfcXWsHvkBjkhJe+OGm7KJAuCJXvBJONxRjM+0Paatq+Ko8e JZcwHF5Q2VMUA2spgClhXpe2OmeqYig8ymX5lcdVpD78ZFifyjC88Ugfi8vqiG/jAl30 ZOm9755rpAmkMq4GLbs0axF+3pqu/PjZCNVx/PNL3iykmronXPf6Dvhlur6gtvIlz04q N+jQ== 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=+AqGSZF4EpWmaEiD6n9MEgNnwi2D/MewQMHt7iSnW7E=; b=0MSBHUGDoJfu/u2LYzVXZ4fJ+LDAwAAddasPVLCWShNFsK9uCUO6U6RrEZpuQ0bl/6 EhiJ1DgJweXbbYezNTFFvdmTgCoC6Ha7x8lQpdrnyjbI2Sl8mKnOm/G3poXmldZcI0bC q2cnScuFaHokIJODCj2t87k2/fExmtdQDDeka6RPcMztC5KwPVqZn4b+EOxULQZhISyk FLqxdd8l8M/NOWqIcT9siwVojAQ+CEf/gR9/dUS+NTmpIHgtrR4USDf7I5sOKmAAdUnL JPoeHDIYNTuEP77I6Zh45baDgP97ggIsFc/jATkS2yrbOjtZq9Y0dlPByZSxcvqawiCm jyGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ek4DT1TE; 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 he32-20020a1709073da000b00927012f155fsi2393489ejc.285.2023.04.05.13.42.03; Wed, 05 Apr 2023 13:42:28 -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=Ek4DT1TE; 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 S233254AbjDEUkF (ORCPT + 99 others); Wed, 5 Apr 2023 16:40:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234364AbjDEUji (ORCPT ); Wed, 5 Apr 2023 16:39:38 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 796D97EC0; Wed, 5 Apr 2023 13:39:22 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id m6-20020a05600c3b0600b003ee6e324b19so22722372wms.1; Wed, 05 Apr 2023 13:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680727161; 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=+AqGSZF4EpWmaEiD6n9MEgNnwi2D/MewQMHt7iSnW7E=; b=Ek4DT1TER+RoJE0VsfQfGUf4TZgwsHm6vZmrebh0y/37TnlO2axskmRki1iM9Rg/C6 Ncvk5XpJ9p+m5Pxi9ZZx93nP1zSEkH1wcfoRym+6Iwyhwk1L7f5tgH76DBjSQBSp8LpN qSb7m9Z8L7plkOCrc4oSNVnZ1za0ilyJaXvlf13x8rdgM7H+3hZ8eAI7aVAiCM4FbbFR 91RR+0d5z4RyHnVYjsFzRUE8fJMyJ6vg/Ky8qqckTR/g/mLtr0lyUZW9zQnfWP04eTXa ny7uvNqjYe6xNkC5ckTfcyn/URJtijj/P8smNLm3wi4zSPb2mv1gMDrUMCF70sS6cKiv JOLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680727161; 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=+AqGSZF4EpWmaEiD6n9MEgNnwi2D/MewQMHt7iSnW7E=; b=yK7HLkzhP5wNB2kyMsFLwhmQYLuuiakJ9AGNmEacWXz9rEr9qAyd8fmvSdojpK/ciK P11AbT/ZgSDddnMfiETXS9U7CkVyCyXSacDrxVqRfvp335MalONc9HxDg3FOJA+xdZcF aAS2DLIOBTSfd0J8BAyuc3cfDdGCDHpv6tmfLUNHjjywVaRa7Ggl452+yM4WrU7CRVBC 0nHfTjQxuqj5YuzQg45GGpU8Q7D8WuZdIlM6EF4Kh0h4gIQMe7KNAtqIOkjgIqinLm/9 Z7x0+VJ9lVP8QH8JtyqFOjOdV+NNwTeKhPlfmuino7hQrlNIm9bsozdt5RbGny0QaljH t7nQ== X-Gm-Message-State: AAQBX9eNsFMsLEVIEdmMv+alcFv5V8fANscO07fMlb75LTZwoeO7ydfu JEBU1aD0pRTgcqvkp4erRkY= X-Received: by 2002:a05:600c:284:b0:3f0:396b:8b9c with SMTP id 4-20020a05600c028400b003f0396b8b9cmr5639675wmk.9.1680727160653; Wed, 05 Apr 2023 13:39:20 -0700 (PDT) Received: from arinc9-PC.lan ([149.91.1.15]) by smtp.gmail.com with ESMTPSA id p19-20020a05600c469300b003eda46d6792sm3259867wmo.32.2023.04.05.13.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 13:39:20 -0700 (PDT) From: arinc9.unal@gmail.com X-Google-Original-From: arinc.unal@arinc9.com To: =?UTF-8?q?Ren=C3=A9=20van=20Dorst?= , Sean Wang , Landen Chao , DENG Qingfang , Daniel Golle , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King Cc: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , 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: [RFC PATCH net-next 07/12] net: dsa: mt7530: call port 6 setup from mt7530_mac_config() Date: Wed, 5 Apr 2023 23:38:54 +0300 Message-Id: <20230405203859.391267-8-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230405203859.391267-1-arinc.unal@arinc9.com> References: <20230405203859.391267-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() 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 fc5428baa905..c636a888d194 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -401,7 +401,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; @@ -473,6 +473,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; @@ -2583,12 +2589,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