Re: [PATCH RFC leds + net-next v2 1/1] net: phy: marvell: add support for PHY LEDs via LED class

2020-07-25 Thread Pavel Machek
Hi! > > > My main issue though is whether one "hw-control" trigger should be > > > registered via LED API and the specific mode should be chosen via > > > another sysfs file as in this RFC, or whether each HW control mode > > > should have its own trigger. The second solution would either result

Re: [PATCH RFC leds + net-next v2 1/1] net: phy: marvell: add support for PHY LEDs via LED class

2020-07-24 Thread Andrew Lunn
On Fri, Jul 24, 2020 at 12:24:03PM +0200, Pavel Machek wrote: > Hi! > > > > I expect some of this should be moved into the phylib core. We don't > > > want each PHY inventing its own way to do this. The core should > > > provide a framework and the PHY driver fills in the gaps. > > > > > > Take

Re: [PATCH RFC leds + net-next v2 1/1] net: phy: marvell: add support for PHY LEDs via LED class

2020-07-24 Thread Pavel Machek
Hi! > > I expect some of this should be moved into the phylib core. We don't > > want each PHY inventing its own way to do this. The core should > > provide a framework and the PHY driver fills in the gaps. > > > > Take a look at for example mscc_main.c and its LED information. It has > > pretty

Re: [PATCH RFC leds + net-next v2 1/1] net: phy: marvell: add support for PHY LEDs via LED class

2020-07-23 Thread Marek Behun
On Thu, 23 Jul 2020 23:35:31 +0200 Andrew Lunn wrote: > Hi Marek > > I expect some of this should be moved into the phylib core. We don't > want each PHY inventing its own way to do this. The core should > provide a framework and the PHY driver fills in the gaps. > > Take a look at for example

Re: [PATCH RFC leds + net-next v2 1/1] net: phy: marvell: add support for PHY LEDs via LED class

2020-07-23 Thread Marek Behun
On Thu, 23 Jul 2020 23:35:31 +0200 Andrew Lunn wrote: > I thought the brightness file disappeared when a trigger takes > over. So is this possible? > > Andrew It does not disappear nor should it. When you have a LED with 10 levels of brightness, you want to be able to configure with

Re: [PATCH RFC leds + net-next v2 1/1] net: phy: marvell: add support for PHY LEDs via LED class

2020-07-23 Thread Pavel Machek
Hi! > > +{ > > + struct phy_device *phydev = to_phy_device(cdev->dev->parent); > > + struct marvell_phy_led *led = to_marvell_phy_led(cdev); > > + u8 val; > > + > > + /* don't do anything if HW control is enabled */ > > + if (check_trigger && cdev->trigger == _hw_led_trigger) > > +

Re: [PATCH RFC leds + net-next v2 1/1] net: phy: marvell: add support for PHY LEDs via LED class

2020-07-23 Thread Andrew Lunn
On Thu, Jul 23, 2020 at 08:13:19PM +0200, Marek BehĂșn wrote: > This patch adds support for controlling the LEDs connected to several > families of Marvell PHYs via Linux' LED API. These families are: > 88E1112, 88E1121R, 88E1240, 88E1340S, 88E1510 and 88E1545. More can be > added. > > The code

[PATCH RFC leds + net-next v2 1/1] net: phy: marvell: add support for PHY LEDs via LED class

2020-07-23 Thread Marek BehĂșn
This patch adds support for controlling the LEDs connected to several families of Marvell PHYs via Linux' LED API. These families are: 88E1112, 88E1121R, 88E1240, 88E1340S, 88E1510 and 88E1545. More can be added. The code reads LEDs definitions from the device-tree node of the PHY. Since the