Re: [PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs controlled by PHY HW

2020-07-28 Thread Marek Behun
On Tue, 28 Jul 2020 18:18:00 +0200 Andrew Lunn wrote: > > +static int of_phy_register_led(struct phy_device *phydev, struct > > device_node *np) > > +{ > > + struct led_init_data init_data = {}; > > + struct phy_device_led *led; > > + u32 reg; > > + int ret; > > + > > + ret =

Re: [PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs controlled by PHY HW

2020-07-28 Thread Marek Behun
On Tue, 28 Jul 2020 18:28:16 +0200 Andrew Lunn wrote: > > > @@ -736,6 +777,16 @@ struct phy_driver { > > > int (*set_loopback)(struct phy_device *dev, bool enable); > > > int (*get_sqi)(struct phy_device *dev); > > > int (*get_sqi_max)(struct phy_device *dev); > > > + > > > + /* PHY LED

Re: [PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs controlled by PHY HW

2020-07-28 Thread Andrew Lunn
> > @@ -736,6 +777,16 @@ struct phy_driver { > > int (*set_loopback)(struct phy_device *dev, bool enable); > > int (*get_sqi)(struct phy_device *dev); > > int (*get_sqi_max)(struct phy_device *dev); > > + > > + /* PHY LED support */ > > + int (*led_init)(struct phy_device *dev,

Re: [PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs controlled by PHY HW

2020-07-28 Thread Andrew Lunn
> +static int of_phy_register_led(struct phy_device *phydev, struct device_node > *np) > +{ > + struct led_init_data init_data = {}; > + struct phy_device_led *led; > + u32 reg; > + int ret; > + > + ret = of_property_read_u32(np, "reg", ); > + if (ret < 0) > +

Re: [PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs controlled by PHY HW

2020-07-28 Thread Marek Behún
On Tue, 28 Jul 2020 17:05:29 +0200 Marek Behún wrote: > @@ -736,6 +777,16 @@ struct phy_driver { > int (*set_loopback)(struct phy_device *dev, bool enable); > int (*get_sqi)(struct phy_device *dev); > int (*get_sqi_max)(struct phy_device *dev); > + > + /* PHY LED support */

[PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs controlled by PHY HW

2020-07-28 Thread Marek Behún
Many PHYs support various HW control modes for LEDs connected directly to them. This adds code for registering such LEDs when described in device tree and also adds a new private LED trigger called phydev-hw-mode. When this trigger is enabled for a LED, the various HW control modes which the PHY