From: Michael Klein <michael@fossekall.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] net: phy: realtek: Add support for PHY LEDs on RTL8211E
Date: Thu, 13 Mar 2025 19:54:43 +0100 [thread overview]
Message-ID: <Z9Mp86eWYw3hgt0x@a98shuttle.de> (raw)
In-Reply-To: <e62af3a7-c228-4523-a1fb-330f4f96f28c@lunn.ch>
On Thu, Mar 13, 2025 at 05:45:05PM +0100, Andrew Lunn wrote:
>On Wed, Mar 12, 2025 at 08:36:27PM +0100, Michael Klein wrote:
>> Like the RTL8211F, the RTL8211E PHY supports up to three LEDs.
>> Add netdev trigger support for them, too.
>>
>> Signed-off-by: Michael Klein <michael@fossekall.de>
>> ---
>> drivers/net/phy/realtek.c | 120 ++++++++++++++++++++++++++++++++++++--
>
>What tree is this based on?
This was based on mainline, will be addressed in the next version.
>> +static int rtl8211e_led_hw_control_get(struct phy_device *phydev, u8 index,
>> + unsigned long *rules)
>> +{
>> + int oldpage, ret;
>> + u16 cr1, cr2;
>> +
>> + if (index >= RTL8211x_LED_COUNT)
>> + return -EINVAL;
>> +
>> + oldpage = phy_select_page(phydev, 0x7);
>> + if (oldpage < 0)
>> + goto err_restore_page;
>> +
>> + ret = __phy_write(phydev, RTL821x_EXT_PAGE_SELECT, 0x2c);
>> + if (ret)
>> + goto err_restore_page;
>
>What is happening here? You select page 0x7, and then use
>RTL821x_EXT_PAGE_SELECT to select 0x2c? Does this hardware have pages
>within pages?
Kind of; this is from the datasheet:
6.9.5. Access to Extension Page (ExtPage)
Set MDIO commands as shown below to switch to the Extension Page (ExtPage) 0xXY (in Hex).
1. Set Register 31 Data=0x0007 (set to Extension Page)
2. Set Register 30 Data=0x00XY (Extension Page XY)
3. Set the target Register Data
4. Set Register 31 Data=0x0000 (switch to Page 0)
Register 30 is RTL821x_EXT_PAGE_SELECT, LED config registers are on
extension page 0x2c
--
Michael
next prev parent reply other threads:[~2025-03-13 18:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 19:36 Michael Klein
2025-03-12 19:36 ` [PATCH 2/2] ARM: dts: bananapi: add support for PHY LEDs Michael Klein
2025-03-13 6:07 ` Jernej Škrabec
2025-03-13 8:34 ` Michael Klein
2025-03-13 10:40 ` Andre Przywara
2025-03-13 13:17 ` Andrew Lunn
2025-03-13 16:20 ` Michael Klein
2025-03-13 16:45 ` [PATCH 1/2] net: phy: realtek: Add support for PHY LEDs on RTL8211E Andrew Lunn
2025-03-13 18:54 ` Michael Klein [this message]
2025-03-13 19:39 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z9Mp86eWYw3hgt0x@a98shuttle.de \
--to=michael@fossekall.de \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®