🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14049

Re: [PATCH 1/2] net: phy: motorcomm: add led_brightness_set for YT8521

#14049
From: Andrew Lunn
Date: Tue, 10 Nov 2026 16:53
34 lines
9218 bytes
On Tue, Nov 10, 2026 at 06:00:00PM +0800, Chukun Pan wrote:
> Add support for manual brightness setting on YT8521/YT8531 PHY.

Has this been tested on real hardware? Have you had it blinking the
heartbeat? Shift-lock etc.

> --- a/drivers/net/phy/motorcomm.c
> +++ b/drivers/net/phy/motorcomm.c
> @@ -258,6 +258,10 @@
>  #define YTPHY_WCR_INTR_SEL			BIT(6)
>  #define YTPHY_WCR_ENABLE			BIT(3)
>  
> +#define YTPHY_LED_GENERAL_CFG_REG		0xA00B
> +#define YTPHY_LED_FORCE_MODE(x)			BIT((x) * 3)
> +#define YTPHY_LED_FORCE_EN(x)			BIT((x) * 3 + 2)
> +
>  /* 2b00 84ms
>   * 2b01 168ms  *default*
>   * 2b10 336ms

I _think_ this is the wrong place to insert these. 2b00 84ms refers to
YTPHY_WCR_PULSE_WIDTH_MASK which is used with YTPHY_WOL_CONFIG_REG? So
you insert these in the middle of WOL bits.

The sorting of registers is a bit messed up in this driver, but i
think you need to insert before:

#define YTPHY_PAD_DRIVE_STRENGTH_REG		0xA010

    Andrew

---
pw-bot: cr
Technical Details
Message-ID: <598009be-95f3-4091-b3bc-98815c65216e@lunn.ch>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360445-linux-kernel-netdev=dewy.ru
References: <20261110100001.1873309-1-amadeus@jmu.edu.cn>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360445-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH 1/2] net: phy: motorcomm: add led_brightness_set for
 YT8521
Date: Tue, 10 Nov 2026 17:53:18 +0100
Organization: Usenet Network
Message-ID: <598009be-95f3-4091-b3bc-98815c65216e@lunn.ch>
References: <20261110100001.1873309-1-amadeus@jmu.edu.cn>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="655928"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:obQAtLnpaJNX9ktxa4t3cTBhtko= sha256:btGY5xSOe8JC+181K73Nug4KuW30pJP7H9d9aDMV1hA=
	sha1:mOrLc5M9XLSuaiWNlThZWdb2Xcg= sha256:bgJP+iMuGRCk7yYtjfz29dE4RMTzYGyniEIUVTau/sw=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 8DCB0113C6B; Tue, 10 Nov 2026 20:07:19 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=lunn.ch
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id rU7t0cnwrMnf;
	Tue, 10 Nov 2026 20:07:13 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-360445-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id D4976113C4F; Tue, 10 Nov 2026 20:07:03 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id D96C4C7E50; Tue, 10 Nov 2026 16:54:33 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794329618;
	b=e6rHSWSw086UDFzLIx4JNu8HYOKl3P0f3lCYji3l/tnbY259nE5XgZJKuj/2K3nhK/+S
	 e64drYWLryqOjJmdLBXN+2FpUHNidQgcpZz5jvi6JCZkvfE/Ud7BwEyLms5UB8m7+1aC+
	 HgA9lGHyecdDvF7ARYkzZiXXyCdomb1dINn8N3CZKQKLPJx1WwvB1pvoY0fievasWN1mL
	 3bLRf+GA78P/pSH9y/4Gm45qRzWIpNAWaaXcfk2e9pE9yBTp7b7FA0NkcJuSYV0ENAEku
	 DDed4j6i6FNv/0lasospixtv4gHtaAD9cEBOAJpvzFseTcwM/Q4ixG/jJK/k8C52rvA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794329618;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
	 From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=eh4ouN2tdsA/32FCavXUDpw7u+paA+vif/rN6ioVniY=;
	b=ZYgBCrA6Sz5lqMYpAOfqLHwhjGIw+Qlq7WD4naT+BGEsbdLFlYfACBIQC+8eYUsz/fzo
	 G5h6gNj6YVOzNPMzPahe8xfCsaTLja0WV6pEi73MD8+dCHVtUk1DMkTBmEHIK0YXj9iyp
	 EqvmZo5RxnxbmteqZL/CCGbgz21UlntC6yLm91peuSTz3Hstm/0Wh4LqX284tl7kh3CNz
	 rCB4HSJouVjBNXjtptyCGohV/3cfFSXaK6D7uZ2d8nOrQt25K1ORQhWBjeTuQO9ZlOSqc
	 aHhxyQxk4igXve24uTW6ylb8hOCecqGPNudRWJsubkAZRvD/x5AM2YDoQOlaT48ATvQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=e7pdiOi4;
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 08C6C60A3824;
	Tue, 10 Nov 2026 16:53:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=e7pdiOi4
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794329617;
	b=nRUuRaHETealeoBMjUWHLt1/nzDWUqu841nDUN3XSX55Q+aChni/PFn57Pz0DSeT7m14
	 mWdLTbLrueyU44LUnp5egGmuDPkv0fRLphBhUWMQCDnjvc48JNaV5fP4HK8StP1pTrSrE
	 oEnuz5bOF8UOUJdRtzw9o86JJem8U/byrg3jeIyAcUdc8TBtF9AOib1mm8tGaPXV7FvFA
	 mgBITlypyVpx11DwRA4pJk5JBqBJUbjQPFlVz4oQ1HkYhDmt5c3YwHW1yvPGA9fCIKyXC
	 ocH6orexjiN1F7Dav1t+NG7UPBNmwYDr4hoDNDvcHn2/48kdC2eZ82BDS1HhhCgMc7Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794329617;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 In-Reply-To;
	bh=eh4ouN2tdsA/32FCavXUDpw7u+paA+vif/rN6ioVniY=;
	b=Mo5u9M+AJNBhQtdqurHV16diUtANToasedBWjthAuUdO+ICzgBoVRCv8Vq1qfAgY/EN4
	 bp88EFPsNGg7EWeurN3Anfs1K0+XC+yEfylqZcwlvrv2X3geZVzshB9Y3mf9qg8SaMtxp
	 4/fGqP+SzGxKz9sCPIJuFcEuGznPS0QPhzfm/qpahkRhu3hGKkq/yb/kqyJBC6cgZWEsp
	 hnKQ53xLbcMrcJiO/FwVLvkAwVFZjxR7Ayy0tvTdYgRtJPtF/RDfYsk4q/hqNKp0NerGJ
	 wz1NN9bYVNnvD1y3yA1vFxeg7KGlvcNHUruwf+qzxbup0g8aQwvrWvtvDn4rEKC4+tA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=e7pdiOi4;
	arc=none smtp.remote-ip=156.67.10.101
X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE26E60A5BD1;
	Tue, 10 Nov 2026 16:53:36 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CE26E60A5BD1
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch;
	s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject:
	Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:
	Content-ID:Content-Description:Content-Disposition:In-Reply-To:References;
	bh=eh4ouN2tdsA/32FCavXUDpw7u+paA+vif/rN6ioVniY=; b=e7pdiOi4wOuaYfmneIq2bC6hfM
	sWl1U5BNQUIKAOB/D0Hpkp5vufnR/aSpvy/h/9WTYLFvYXkQuyYdI9LKOPjXZDyucU5bn6Kt9khz+
	pUlvUWck/YtRCawoQoYl8vTiyNe2HFb+QquNSXtWO0tzzk3kt1eN5Y94ppPl10rJ6oAk=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xQp5y-00FXGW-2Q; Tue, 10 Nov 2026 17:53:18 +0100
X-Cc: Frank <Frank.Sae@motor-comm.com>, Paolo Abeni <pabeni@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261110100001.1873309-1-amadeus@jmu.edu.cn>