[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200728192838.29c798a9@nic.cz>
Date: Tue, 28 Jul 2020 19:28:38 +0200
From: Marek Behun <marek.behun@....cz>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev@...r.kernel.org, linux-leds@...r.kernel.org,
Pavel Machek <pavel@....cz>, jacek.anaszewski@...il.com,
Dan Murphy <dmurphy@...com>,
Ondřej Jirman <megous@...ous.com>,
Russell King <linux@...linux.org.uk>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Gregory Clement <gregory.clement@...tlin.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs
controlled by PHY HW
On Tue, 28 Jul 2020 18:18:00 +0200
Andrew Lunn <andrew@...n.ch> 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 = of_property_read_u32(np, "reg", ®);
> > + if (ret < 0)
> > + return ret;
> > +
> > + led = devm_kzalloc(&phydev->mdio.dev, sizeof(struct phy_device_led), GFP_KERNEL);
> > + if (!led)
> > + return -ENOMEM;
> > +
> > + led->cdev.brightness_set_blocking = phy_led_brightness_set;
> > + led->cdev.trigger_type = &phy_hw_led_trig_type;
> > + led->addr = reg;
> > +
> > + of_property_read_string(np, "linux,default-trigger", &led->cdev.default_trigger);
>
> Hi Marek
>
> I think we need one more optional property. If the trigger has been
> set to the PHY hardware trigger, we then should be able to set which
> of the different blink patterns we want the LED to use. I guess most
> users will never actually make use of the sys/class/led interface, if
> the default in device tree is sensible. But that requires DT can fully
> configure the LED.
>
> Andrew
Yes, I also thought about that. We have the linux,default-trigger
property, so maybe we could add linux,default-hw-control-mode property
as well.
Marek
Powered by blists - more mailing lists