Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2852894rwd; Mon, 22 May 2023 05:27:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5nAOH69BCo84Up6JRDhf19UQDy5sHiB78UV8vCUOZztMjb9yc1Zm+1s2DeImzVXNmGxT/Z X-Received: by 2002:a05:6a21:789a:b0:105:8e4d:d726 with SMTP id bf26-20020a056a21789a00b001058e4dd726mr12426373pzc.27.1684758422102; Mon, 22 May 2023 05:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684758422; cv=none; d=google.com; s=arc-20160816; b=M7aqpK9KEvYYbSMvTX3fA3U5AmbH/rBlxtooZhcsrv9OVYZrf78/e3t8Vy6EwODd2S xp+lTIp14FVaOWbXsLD29oQCwdPgU6At8qcsnlMoS++82SUfbIz2Whz84Se+5VG7Eo0D FhPI8P2RfWiKEnJfqWzqIODtQBjP/yJSVdlOifEpA/rr9sou7R/QGcyVJgmR4BEeZ7ep RWpWENj2idmWXy5XSiK1OtH5Ul3xljb5kWFb2LSQPUiHtXiYQFFQ3t9B2bE6fc/q/jlD 78P5zuLtJrTyMVAKgytpqznhqwxL+7S4Imk2LzUgf1LtPn6iO0qOW3f+tcvEcIC5txU0 8A5g== 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=W9sUzeE3WCfQ+rJ/EsdfBikYVvHj1ppa8r6Hpeq3Xns=; b=Zr1zO9FHQ0+ToipslVT+awxtbgCxMjmasNWll7gxR2W30fchwUhcHht0nBRwPv9GsR 8qq119rU1gsn6QOqjN8bRq6/58j3rsOeAubYnKjPb4ZpfJ1lE073ZSYIqGssfQmkQqYA Oa6Fy7TcNRbZKqIguTCUlbFCK2OR2n3k7pDC6lheCmUU0Ric4Hnu9x2Frz54OSiN5ixa Ixt/oIirCgIbcxYmDMBolfl/BjWaIMI2ABSZYKlgAT+D2rWGHIyEbfUxhFtM6dB5FrSA 7QDWHzwgRh64E6lyR3XFCivxomXUjzNqMxvR6KvFrmBtK5UArqR/WrKVtitEPATI0ead 5S8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Lru3OuyM; 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 b5-20020aa78ec5000000b0064d6ca382a1si1827306pfr.342.2023.05.22.05.26.48; Mon, 22 May 2023 05:27:02 -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=20221208 header.b=Lru3OuyM; 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 S233910AbjEVMSe (ORCPT + 99 others); Mon, 22 May 2023 08:18:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231358AbjEVMRn (ORCPT ); Mon, 22 May 2023 08:17:43 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9B121BCC; Mon, 22 May 2023 05:16:34 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-96ff9c0a103so103011466b.0; Mon, 22 May 2023 05:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684757776; x=1687349776; 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=W9sUzeE3WCfQ+rJ/EsdfBikYVvHj1ppa8r6Hpeq3Xns=; b=Lru3OuyMurIkYbxbLVEVMZ/Jo0Q1/ypDQXQjCZNIgIj7jLHaw7aIU41akE0EsFPrQX hHiBxYJUpAOmZIhjHqyOrm53kaBoH3P1/jqSqtR3Qi5aSc3BoE07iNMeBCx/E+2vd+3X akaBXJlboxM574/wtu7wBakkO/e8vpCpgcqXpQ71RQwCCrvrjXcN/TAobYVRUn6Qr7P/ Y1c2EZNM+SVM2PPv03/+iiS8byBqa89rvt1nOpKrSUWT44Haf2eldP+S5hXB0y5DD9wL YcKVr0JMeVaJuQT0Ih1IHjlEDV4yhOxPyO1NR0PAOsAW2v/BsE4sp1oaoYqPo8Eu5OLT Ox9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684757776; x=1687349776; 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=W9sUzeE3WCfQ+rJ/EsdfBikYVvHj1ppa8r6Hpeq3Xns=; b=HLor66t5vYpuDdCGyiBH9O60fYHudoDIZ0VX0vFMtIHiAZG638EcftUXuHxkhEv4lM UibJSFsd9V3+n6bTTSQddklfAToTF5D9TyWn8FhfbvbFnyHW1WTBCn15hvyOoT5Gwphb 7gxERD69XeFEnPh6q9dFdzBrwaJ4hb7G8+TbxldjP6xTLFhuvG5V+LbMnnJ59YPBR1Ri VqC9UMSdg3Kss5ZQb8iNToiiXzOhm018+PcSEQYm33wglj6v7TvQz2PWLV5OcpjNUSQr jD1zUnysRmIIOBfS0b8WLab1scpy/tTL/v8JXDogyaTbXhGsyL5+spYn1Qp7qNXYs5e4 aYNQ== X-Gm-Message-State: AC+VfDwh7VYgZAWU50DB9Oz4mHiJZwJ8IBq+WBejpkkx00bgzx7Ltq8I nsV8ou1BJk9bgF92VsvSxHU= X-Received: by 2002:a17:907:162a:b0:96f:dd14:f749 with SMTP id hb42-20020a170907162a00b0096fdd14f749mr2811980ejc.23.1684757776077; Mon, 22 May 2023 05:16:16 -0700 (PDT) Received: from arinc9-PC.. ([149.91.1.15]) by smtp.gmail.com with ESMTPSA id y26-20020a17090614da00b009659fed3612sm2999950ejc.24.2023.05.22.05.16.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 05:16:15 -0700 (PDT) From: arinc9.unal@gmail.com X-Google-Original-From: arinc.unal@arinc9.com To: 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?= , Richard van Schagen , Richard van Schagen , Frank Wunderlich , Bartel Eerdekens , erkin.bozoglu@xeront.com, mithat.guner@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-next 10/30] net: dsa: mt7530: call port 6 setup from mt7530_mac_config() Date: Mon, 22 May 2023 15:15:12 +0300 Message-Id: <20230522121532.86610-11-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522121532.86610-1-arinc.unal@arinc9.com> References: <20230522121532.86610-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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 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() 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 50f150ff481a..0b0ed1bd2afa 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 int mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface) { @@ -2571,12 +2577,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.39.2