OSDN Git Service

net: phy: Add a binding for PHY LEDs
authorAndrew Lunn <andrew@lunn.ch>
Mon, 17 Apr 2023 15:17:27 +0000 (17:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Apr 2023 11:59:16 +0000 (12:59 +0100)
commit01e5b728e9e43ae444e0369695a5f72209906464
treecd0f31d6864b912b9c17c76a5bfa6e52cfabb4be
parente5029edd53937a29801ef507cee12e657ff31ea9
net: phy: Add a binding for PHY LEDs

Define common binding parsing for all PHY drivers with LEDs using
phylib. Parse the DT as part of the phy_probe and add LEDs to the
linux LED class infrastructure. For the moment, provide a dummy
brightness function, which will later be replaced with a call into the
PHY driver. This allows testing since the LED core might otherwise
reject an LED whose brightness cannot be set.

Add a dependency on LED_CLASS. It either needs to be built in, or not
enabled, since a modular build can result in linker errors.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/Kconfig
drivers/net/phy/phy_device.c
include/linux/phy.h