From nobody Thu Sep 18 05:25:07 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2A6EC4332F for ; Fri, 9 Dec 2022 22:47:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229982AbiLIWrg (ORCPT ); Fri, 9 Dec 2022 17:47:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbiLIWrU (ORCPT ); Fri, 9 Dec 2022 17:47:20 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC50121830; Fri, 9 Dec 2022 14:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1670626038; x=1702162038; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=NxICK9YEAX5kiUZz9Kaz68Sx6I6kNikV7yxiKfqD0gQ=; b=HurkNQeA64dxssepArH1PUj4sRDrclHXbCxB0zWxyv4mZxIzDwwRDw9H 0h8rqMFLm0oDH3A69YRoRLAwVSi7eQ9u6P2ziT+e1x/a+bSAsun959PCw hgj+0cRtEfAzdAX8d56tXHqxt6NFwD5ya/SEM+NCVE5gyqVPbsYznkTbq LM+tl8jTUJhjpk3SevNVVvRw22r873CjxuLVy7aLkjsAY/i2ZBVjAzQSe VqrutDNVP8Fq1vMGgn0TwWdUGZNw3XJBhco0tmrry41wsUEKP9wlb2xSa UCAaV4zg0FgMavbk7aQ92FW1VqHtpB7DrZJGYGasPVgxxo0/Gk6nKf1yt A==; X-IronPort-AV: E=Sophos;i="5.96,232,1665471600"; d="scan'208";a="203381000" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Dec 2022 15:47:18 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 9 Dec 2022 15:47:17 -0700 Received: from AUS-LT-C33025.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 9 Dec 2022 15:47:16 -0700 From: Jerry Ray To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , , , , , Jerry Ray Subject: [PATCH net-next v5 2/6] dsa: lan9303: move Turbo Mode bit initialization Date: Fri, 9 Dec 2022 16:47:09 -0600 Message-ID: <20221209224713.19980-3-jerry.ray@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221209224713.19980-1-jerry.ray@microchip.com> References: <20221209224713.19980-1-jerry.ray@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In preparing to remove the .adjust_link api, I am moving the one-time initialization of the device's Turbo Mode bit into a different execution path. This code clears (disables) the Turbo Mode bit which is never used by this driver. Turbo Mode is a non-standard mode that would allow the 100Mbps RMII interface to run at 200Mbps. Signed-off-by: Jerry Ray --- drivers/net/dsa/lan9303-core.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index 5a21fc96d479..20fc2af62531 100644 --- a/drivers/net/dsa/lan9303-core.c +++ b/drivers/net/dsa/lan9303-core.c @@ -886,6 +886,12 @@ static int lan9303_check_device(struct lan9303 *chip) return ret; } =20 + /* Virtual Phy: Remove Turbo 200Mbit mode */ + lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, ®); + + reg &=3D ~LAN9303_VIRT_SPECIAL_TURBO; + regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, reg); + return 0; } =20 @@ -1073,14 +1079,6 @@ static void lan9303_adjust_link(struct dsa_switch *d= s, int port, ctl &=3D ~BMCR_FULLDPLX; =20 lan9303_phy_write(ds, port, MII_BMCR, ctl); - - if (port =3D=3D chip->phy_addr_base) { - /* Virtual Phy: Remove Turbo 200Mbit mode */ - lan9303_read(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, &ctl); - - ctl &=3D ~LAN9303_VIRT_SPECIAL_TURBO; - regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, ctl); - } } =20 static int lan9303_port_enable(struct dsa_switch *ds, int port, --=20 2.17.1