Re: [PATCH] net: phy: at803x: Add support to control PHY LEDs
flat view
From: Vishal Thanki <hidden>
Date: 2016-03-17 17:33:16
On Thu, Mar 17, 2016 at 5:59 PM, Florian Fainelli [off-list ref] wrote:
On 17/03/16 07:50, Andrew Lunn wrote:quoted
On Thu, Mar 17, 2016 at 02:59:07PM +0100, Vishal Thanki wrote:quoted
The LEDs can be turned on and off by a sysfs interface now. Write 0 to "led_enable" file to turn off the LEDs and write 1 to turn on. The support is experimental and can be enabled by kernel configuration option. Signed-off-by: Vishal Thanki <redacted> --- drivers/net/phy/Kconfig | 7 +++++ drivers/net/phy/at803x.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++Hi Vishal This solution seems specific to the at803. You should be thinking of a generic solution that all PHYs can use. eg add a new callback function to phy_driver, and put the sysfs handling code in phylib.Indeed, maybe we should be considering using the existing LEDS subsystem (drivers/leds/*) to expose the PHY LEDs to user-space in a standard way? --
I agree with the idea of making a generic callback in phy_driver so that other PHYs can use it. However I think these LEDs are tightly coupled with PHYs and it would not make much sense to expose them via LED subsystem as they cannot be controlled individually IMHO.
Florian