Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp244531lqp; Tue, 11 Jun 2024 03:17:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtqlPsRvcmRXLqukeTSxjTxbeT+AZgF1x++/A61oP1D7HjJZ9YPlX1Og+0ROKh92BLiSSPjOXtjvO5O8bjUSkoDEO/MhFpqA6jDKLwZg== X-Google-Smtp-Source: AGHT+IEJlPnVvM/16k/YEhwWd53AKprVKHWdciDmK09F1SwZBIfhePTJTkL+c8vjikibRw/3h+li X-Received: by 2002:a17:90a:9c4:b0:2ab:8324:1b47 with SMTP id 98e67ed59e1d1-2c32b4ba857mr3250265a91.15.1718101049712; Tue, 11 Jun 2024 03:17:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718101049; cv=pass; d=google.com; s=arc-20160816; b=b01EElMdDLj+CMRQcHEGTczJUHxznDVj1A7h6+EK+unLMjJagP8KBzwuOS3Kz1gQf1 o9OW1ojTQLLVFfwuwXiFmKEWS2AqNjvK1HwsUS4klXJ6IA+woKTD/Rc7vPg7Wxnne/31 NxMj2720blOKueNVAl/xrY1e7fzc1mLY4v2MT4dguKMcrkPEUWgq5TB57JfqQ28G05Ch tgo4WKg2lE0l0PFBj6v1TGLH+BqjqOZWpeoDlv7zQq3iyofxl3iOEDXDYOfYExJhS465 zvstWv7dA/dxLzKaDiHA1Gl3pYZqUhjzeYcncxq+mzoL9lC6U6gtFbNB6jkAHco39OxH x/4A== ARC-Message-Signature: i=2; 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:message-id:date:subject:cc:to :from:dkim-signature; bh=eRetQuFIAKp0sroa8QmztSLTfvC7A1XlkXiVDnFh6fA=; fh=cQhHd9jKPGej8nHySYScthOig5c4GhS9xAkIqXbKkTQ=; b=EWbgnJ01uIKCZUgeO+/xH2l61Ak40KVYGKXBhVQAeFNLPJCQs+Sj8oX4UfkLHIdyF/ 1cAsCs2ACM0rRGU6/vyb/4j8iON3qdE4PJoTmOYyQ17hbArYWDRVGAOweg2lnrgIJ0+O 6WaWmjYyQ/PchfDsq7kRx1FWJJOSMUfESh+670uy9a10iLxiZymrBrGbTy6E+z+mRios +zJlZh1GI26p9wIVVQpfGJkpBhWEXbT3gbZgnyW032MhwxMD8RK6UC0RTjNWjRqCMLXy OjObIh++Vf8nRc46I+6ai8AoTY4MEQp34EefpWtvL/Gk7hsRvnbrKD1bwSqC/JL+mu94 lf5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=K9ThOjT6; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-209591-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c32fb53593si970512a91.0.2024.06.11.03.17.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 03:17:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209591-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=K9ThOjT6; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-209591-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E707BB21DF5 for ; Tue, 11 Jun 2024 09:45:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 283C9178360; Tue, 11 Jun 2024 09:45:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="K9ThOjT6" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 AF378176FB3; Tue, 11 Jun 2024 09:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718099107; cv=none; b=HBGYnu7i3AqmO7aJclivTLVNtojLydSVRN8vIro1bfIO7lIfehBfymkYMZ9ICcMAKTFsVqelDS/QeVNbWjhTgsTR4dDbtLIVUIU0n34haGvsXJw2zCkabouA80XjcNZ7UZK+js4czFo9wOwC76vLCspejHMQfHy91j4jNC19duk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718099107; c=relaxed/simple; bh=N2AFykO7g5lcDZvqLYnlKBNb5KH5FUFag2Cy+VHydbM=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=KVSW6MjZYuZ7b9WqRkij/Ll/LY/qILpPIfXQwFUDd0avOX1YN91j4R18T5GyYZfA9WWSmRiABmn7FZyUvkLmVeBfLnbJ8bdE3bwxyPv2cEAK3IFloporK/qPegkzNwQE23BZk6a1TbkH4+3vJ3WDuQ90Txm8Rpoi9ZgAWA3i1N4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=K9ThOjT6; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1718099104; x=1749635104; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=N2AFykO7g5lcDZvqLYnlKBNb5KH5FUFag2Cy+VHydbM=; b=K9ThOjT6eRMXsPMk/KE8gY8zmwZlP1De9T65zFXvzNeoXkUkLm6PoLDg SvRv5rrap+8apnN0Jbo3238jOFMBiZbNRUsRDDBjlDK3tJnz3UJHKhI69 HF+Gjo8Yu2X+wL/P7GWPrSdjudsUB1Jgn7CfdGKM7yBPRhJiwuOUPjD13 fscRCtGqjZxQajUgiCES0oH4t8qVITNer6IZscnFqCxHGgLIScCTheV2W C6yDN5cHPP4ynuX4fAflLvd1/5FL6RZK8WhSq6eLd+w5k5IYJPJb9xD1O 4PhGxkGudR2acNNZjoGfpADHAq8qtNkjsHWv7pN0kg5ixiuDDDUCqK02X A==; X-CSE-ConnectionGUID: 0cBbznKCTOiQxMmBD6ZkJQ== X-CSE-MsgGUID: s44okEMyQhCNKnXzE0tYLw== X-IronPort-AV: E=Sophos;i="6.08,229,1712646000"; d="scan'208";a="258114337" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Jun 2024 02:44:58 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 11 Jun 2024 02:44:17 -0700 Received: from che-ld-unglab06.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 11 Jun 2024 02:44:14 -0700 From: Rengarajan S To: , , , , , , , , CC: Subject: [PATCH net-next v1] lan78xx: lan7801 MAC support with lan8841 Date: Tue, 11 Jun 2024 15:12:33 +0530 Message-ID: <20240611094233.865234-1-rengarajan.s@microchip.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Add lan7801 MAC only support with lan8841. The PHY fixup is registered for lan8841 and the initializations are done using lan8835_fixup since the register configs are similar for both lann8841 and lan8835. The PHY is unregistered at two instances, one during init and other during disconnect. Signed-off-by: Rengarajan S --- drivers/net/usb/lan78xx.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 5add4145d9fc..ab6f0c42b4d9 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -479,6 +479,7 @@ struct lan78xx_net { /* define external phy id */ #define PHY_LAN8835 (0x0007C130) +#define PHY_LAN8841 (0x00221650) #define PHY_KSZ9031RNX (0x00221620) /* use ethtool to change the level for any given device */ @@ -2327,6 +2328,13 @@ static struct phy_device *lan7801_phy_init(struct lan78xx_net *dev) netdev_err(dev->net, "Failed to register fixup for PHY_LAN8835\n"); return NULL; } + /* external PHY fixup for LAN8841 */ + ret = phy_register_fixup_for_uid(PHY_LAN8841, 0xfffffff0, + lan8835_fixup); + if (ret < 0) { + netdev_err(dev->net, "Failed to register fixup for PHY_LAN8841\n"); + return NULL; + } /* add more external PHY fixup here if needed */ phydev->is_internal = false; @@ -2390,6 +2398,8 @@ static int lan78xx_phy_init(struct lan78xx_net *dev) 0xfffffff0); phy_unregister_fixup_for_uid(PHY_LAN8835, 0xfffffff0); + phy_unregister_fixup_for_uid(PHY_LAN8841, + 0xfffffff0); } } return -EIO; @@ -4239,6 +4249,7 @@ static void lan78xx_disconnect(struct usb_interface *intf) phy_unregister_fixup_for_uid(PHY_KSZ9031RNX, 0xfffffff0); phy_unregister_fixup_for_uid(PHY_LAN8835, 0xfffffff0); + phy_unregister_fixup_for_uid(PHY_LAN8841, 0xfffffff0); phy_disconnect(net->phydev); -- 2.25.1