From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8AAFF14D718; Fri, 28 Jun 2024 14:27:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719584867; cv=none; b=NzPIQGBszSge7z8LsfJbdZi7R9f3IdMueeWTC2cH8DchyBNACEFQhxOpQzbVAzzGMM0hiMlTzo1mCDAifxdNdkySQU65Fm60JGFjHzGascm01UttXhBPb+YVK5kSonb+1uuS7KSvCIV2tRCvKAL4kiC8gZyFIizVIqvhh9Aq0cQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719584867; c=relaxed/simple; bh=1Ha5YqmI27/7Y8SSb4D1NvuKFKN/iE/n0d75yTTLZPs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=h6SxqoMZX/jyXe7Xw8bXv82PfEzx/apxR/ONQRhEHyCDIgmzIlq0KsCETNXTJrE4V8rw8N9juWuiTDjxUFvfInY1N05fSA3jE2AIurz9tEbA807lRTzOr31P6ypiEthj9Zfpgpb0kZ8gR+Oq/PuhtegeG0VJZ2jvlPYJPt0rWjU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Qv7msHHW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Qv7msHHW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6CE9C116B1; Fri, 28 Jun 2024 14:27:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719584867; bh=1Ha5YqmI27/7Y8SSb4D1NvuKFKN/iE/n0d75yTTLZPs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qv7msHHW6ME9IOhpV+DZTsRl/QONElsPKZtEYl+Q+RxHGVr3qEnKHBKOP2UvL0XIc MviaSg4ldwoCTg7m0WT9egeldDokDvNbxycHBntii+GDKBZbi0py6KLLOIEHOOV3qN 5HumM9OcsJQQNnl/swAE1nAX31n5xxtXnYOfvdkd80SksjXnSDJKRUYa0sFVRisWSh FtCXGCNxZ905lZsJmUCOYx9MwepedGaDusjTLyiJVksfsDK9gI7aRLfZs8fxGusgOf tjs1PzeqSUQU1PtfMHayEb2fWdmjZk+BhdPMmaR32+fbZ0tQAcHu2FHdC28OwMyJgz hsNiN+R4bROEg== Date: Fri, 28 Jun 2024 15:27:42 +0100 From: Simon Horman To: Marek Vasut Cc: netdev@vger.kernel.org, Alexandre Torgue , Andrew Lunn , Christophe Roullier , "David S . Miller" , Eric Dumazet , Heiner Kallweit , Jakub Kicinski , Paolo Abeni , Russell King , kernel@dh-electronics.com, linux-kernel@vger.kernel.org Subject: Re: [net-next,PATCH v2] net: phy: realtek: Add support for PHY LEDs on RTL8211F Message-ID: <20240628142742.GH783093@kernel.org> References: <20240625204221.265139-1-marex@denx.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240625204221.265139-1-marex@denx.de> On Tue, Jun 25, 2024 at 10:42:17PM +0200, Marek Vasut wrote: > Realtek RTL8211F Ethernet PHY supports 3 LED pins which are used to > indicate link status and activity. Add minimal LED controller driver > supporting the most common uses with the 'netdev' trigger. > > Signed-off-by: Marek Vasut > --- > Cc: Alexandre Torgue > Cc: Andrew Lunn > Cc: Christophe Roullier > Cc: David S. Miller > Cc: Eric Dumazet > Cc: Heiner Kallweit > Cc: Jakub Kicinski > Cc: Paolo Abeni > Cc: Russell King > Cc: kernel@dh-electronics.com > Cc: linux-kernel@vger.kernel.org > Cc: netdev@vger.kernel.org > --- > V2: - RX and TX are not differentiated, either both are set or not set, > filter this in rtl8211f_led_hw_is_supported() > --- > drivers/net/phy/realtek.c | 106 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 106 insertions(+) > > diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c > index 2174893c974f3..bed839237fb55 100644 > --- a/drivers/net/phy/realtek.c > +++ b/drivers/net/phy/realtek.c > @@ -32,6 +32,15 @@ > #define RTL8211F_PHYCR2 0x19 > #define RTL8211F_INSR 0x1d > > +#define RTL8211F_LEDCR 0x10 > +#define RTL8211F_LEDCR_MODE BIT(15) > +#define RTL8211F_LEDCR_ACT_TXRX BIT(4) > +#define RTL8211F_LEDCR_LINK_1000 BIT(3) > +#define RTL8211F_LEDCR_LINK_100 BIT(1) > +#define RTL8211F_LEDCR_LINK_10 BIT(0) > +#define RTL8211F_LEDCR_MASK GENMASK(4, 0) > +#define RTL8211F_LEDCR_SHIFT 5 > + Hi Marek, FWIIW, I think that if you use FIELD_PREP and FIELD_GET then RTL8211F_LEDCR_SHIFT can be removed. ...