Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp372607lqp; Wed, 22 May 2024 07:10:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVo7QceiXYy3fiPn+J3mb6ZTSsdfY4Kk4CS47jPSqFYXlb50PgqV0s8u45aO6sbhJd0d7Q8BUazXKyETrULKuHBiQdPwFBh4rM5Hj6Sjw== X-Google-Smtp-Source: AGHT+IG2lY7xxfsUZ9wnx03oZGyWOFh6e9KI1RZXzsv1XbonkM1VeRXAPxLU7H31u0pRYCMF9deA X-Received: by 2002:a05:6359:4ca1:b0:193:f899:f9b9 with SMTP id e5c5f4694b2df-19791e09733mr230718155d.9.1716387005459; Wed, 22 May 2024 07:10:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716387005; cv=pass; d=google.com; s=arc-20160816; b=O8ssiB7VPub6hSEoo/cAivkI652EVU9elvGiB4I2lx5pBC+Np4uUhSfdkYSg372f2l wOe97767MGxoXS5UZVF0NkaprPLUyi1cd9bAhJQ+jBVDSQkMiQa0FdfNw/L0BC259dbG AtGdvAIqsMI2LvVmyGh3Ns5EcDCdr+Jdwkyfgo0l3NepI0HQt0eTEC6eKwZMhNqDS20Z SBu72Y8ZGg/4JnyX38Tim67suZl2TY3XkxuBFrJmwm6iT6ETJT50Vqf+KAEm+xjarKmx pguHmJ5bQKVK4s7+VvCS84CtJMLwKtTOAmC19kEu6QTVdXlebCARBmNjJShYViLWyKxJ W0Qw== 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=Cdik8R2O8VnxU4VKIuk6ZNcIVunlLXq9wwWIpwkiT3A=; fh=3aRCl0JeL+ySCvZgQIIG1MUIlOvDIoA6z9jQ997irJk=; b=hiGhYXv0J/zAy4CS0/xgnPAx0DEIlL4kP1gm+BXhHdEaYas2pvPW8gbBjp0eH5/t1I jig9MH95peO7ElkgZ2D/xsFQpm/CpOssr0U7WFhQDP0P8CTucpJomZ6cRoe4dqIu9XEk Kd1lyfw3BZ70rFBIp5IgBSZwVs0eaeeUGSvushzAlSj9CmvFT8eOEyzwLFUvzGD97Hs/ pcK2UBHTpPuiac578h0kTmt0TQ/pyllmNu4w2QZktv8XuxgHndky3ecNM0/hJMtwuqdN pH09jMhTP2KV+7o+Ag+gD9PbtDfPDjT7pzFTsTeI7rNpVakedafRV7+ZcAxipajfRd6b Yatg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=MaazTArG; 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-186330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186330-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ada2fe7eead31-481eda9ca7esi3919764137.197.2024.05.22.07.10.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 07:10:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=MaazTArG; 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-186330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186330-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0C91E1C22226 for ; Wed, 22 May 2024 14:10:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 958651411F2; Wed, 22 May 2024 14:09:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="MaazTArG" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 3E96F43AAB; Wed, 22 May 2024 14:09:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716386991; cv=none; b=B8XfHu4K/Zhjx/Mwqhe3QjnP/j3GHLIfv4xqGjB0YgCh9VM0ToWY+7cgT9LI13Xi69BeDNry90XY4qbwk/aSv0EX8nx2VRJx7o96wJFrAuEJDm6VkLhfwEhgyegzCeu/WD6d6adqZ3iw2hOrJU9Nlzy+8ew8716hpc51fczYV3o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716386991; c=relaxed/simple; bh=mDWoM0y/9NZiwZeSsw6wupj4kpFKNhJbzUYHPgjsHrc=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=sWYv2LHrgnOYdhdxBglOjhFQmzbzJZ7nA3N/pCmXWvw4Hxasbu24LdaZWyLj8hb/vX7qKBkB8OuvDHZop7yKI9Sm0WyjaMoVuGHXNiqVsxfF6JC/b4T6hD/NUrYihPkCPzsE4pnuCLsyago65p5jJLZAyeHCd+RzyTdOBVLrakQ= 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=MaazTArG; arc=none smtp.client-ip=68.232.154.123 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=1716386989; x=1747922989; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=mDWoM0y/9NZiwZeSsw6wupj4kpFKNhJbzUYHPgjsHrc=; b=MaazTArGUOYa1Euz8VBENkEZXIdY5Vyd51ridQcYBT+4dBe4iypfW/yy HlwfZRO5wwc7/r+giHglMb+HRJsuwvkJLuUJX0rx6s7KypAvp2LWwLRSo IfpqDQ1nRV475I8y0P8UHbjXzvgj9k/8A38wgBI0JaTYYxKSh7layKFuV bariD9bnduHq/DwGmLBpIFi41QXzOqu2DZwxX+DRcBQyIRBJibSRUHdya kN6+BsCsX61aqPUe4T+Bhny9kPk6VOxLQ2UOYfCKWQ8bL9No+RlFL2b7d YfW3dM3g05bBIJ0NR0X68zUkEECZMg28uxoLUyHwnzr71R+GwmcVLq73W g==; X-CSE-ConnectionGUID: YDHWVVWpTDmNhpERICjMxw== X-CSE-MsgGUID: TeHhQJ9vQwif+nar/DGvUg== X-IronPort-AV: E=Sophos;i="6.08,179,1712646000"; d="scan'208";a="25744430" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 22 May 2024 07:08:40 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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; Wed, 22 May 2024 07:08:26 -0700 Received: from che-ll-i17164.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Wed, 22 May 2024 07:08:22 -0700 From: Parthiban Veerasooran To: , , , , , CC: , , , Parthiban Veerasooran Subject: [PATCH] net: usb: smsc95xx: configure external LEDs function for EVB-LAN8670-USB Date: Wed, 22 May 2024 19:38:17 +0530 Message-ID: <20240522140817.409936-1-Parthiban.Veerasooran@microchip.com> X-Mailer: git-send-email 2.34.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 By default, LAN9500A configures the external LEDs to the below function. nSPD_LED -> Speed Indicator nLNKA_LED -> Link and Activity Indicator nFDX_LED -> Full Duplex Link Indicator But, EVB-LAN8670-USB uses the below external LEDs function which can be enabled by writing 1 to the LED Select (LED_SEL) bit in the LAN9500A. nSPD_LED -> Speed Indicator nLNKA_LED -> Link Indicator nFDX_LED -> Activity Indicator Signed-off-by: Parthiban Veerasooran --- drivers/net/usb/smsc95xx.c | 12 ++++++++++++ drivers/net/usb/smsc95xx.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index cbea24666479..05975461bf10 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -1006,6 +1006,18 @@ static int smsc95xx_reset(struct usbnet *dev) /* Configure GPIO pins as LED outputs */ write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED | LED_GPIO_CFG_FDX_LED; + + /* Set LED Select (LED_SEL) bit for the external LED pins functionality + * in the Microchip's EVB-LAN8670-USB 10BASE-T1S Ethernet device which + * uses the below LED function. + * nSPD_LED -> Speed Indicator + * nLNKA_LED -> Link Indicator + * nFDX_LED -> Activity Indicator + */ + if (dev->udev->descriptor.idVendor == 0x184F && + dev->udev->descriptor.idProduct == 0x0051) + write_buf |= LED_GPIO_CFG_LED_SEL; + ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf); if (ret < 0) return ret; diff --git a/drivers/net/usb/smsc95xx.h b/drivers/net/usb/smsc95xx.h index 013bf42e27f2..134f3c2fddd9 100644 --- a/drivers/net/usb/smsc95xx.h +++ b/drivers/net/usb/smsc95xx.h @@ -114,6 +114,7 @@ /* LED General Purpose IO Configuration Register */ #define LED_GPIO_CFG (0x24) +#define LED_GPIO_CFG_LED_SEL BIT(31) /* Separate Link/Act LEDs */ #define LED_GPIO_CFG_SPD_LED (0x01000000) /* GPIOz as Speed LED */ #define LED_GPIO_CFG_LNK_LED (0x00100000) /* GPIOy as Link LED */ #define LED_GPIO_CFG_FDX_LED (0x00010000) /* GPIOx as Full Duplex LED */ base-commit: 4b377b4868ef17b040065bd468668c707d2477a5 -- 2.34.1