All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Behun <marek.behun@nic.cz>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, linux-leds@vger.kernel.org,
	"Pavel Machek" <pavel@ucw.cz>,
	jacek.anaszewski@gmail.com, "Dan Murphy" <dmurphy@ti.com>,
	"Ondřej Jirman" <megous@megous.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Gregory Clement" <gregory.clement@bootlin.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs controlled by PHY HW
Date: Tue, 28 Jul 2020 19:28:38 +0200	[thread overview]
Message-ID: <20200728192838.29c798a9@nic.cz> (raw)
In-Reply-To: <20200728161800.GJ1705504@lunn.ch>

On Tue, 28 Jul 2020 18:18:00 +0200
Andrew Lunn <andrew@lunn.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", &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

  reply	other threads:[~2020-07-28 17:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 15:05 [PATCH RFC leds + net-next v4 0/2] Add support for LEDs on Marvell PHYs Marek Behún
2020-07-28 15:05 ` [PATCH RFC leds + net-next v4 1/2] net: phy: add API for LEDs controlled by PHY HW Marek Behún
2020-07-28 15:11   ` Marek Behún
2020-07-28 16:28     ` Andrew Lunn
2020-07-28 17:27       ` Marek Behun
2020-07-28 16:18   ` Andrew Lunn
2020-07-28 17:28     ` Marek Behun [this message]
2020-07-28 18:47   ` kernel test robot
2020-07-28 19:13   ` kernel test robot
2020-07-28 15:05 ` [PATCH RFC leds + net-next v4 2/2] net: phy: marvell: add support for PHY LEDs via LED class Marek Behún
2020-07-28 15:52 ` [PATCH RFC leds + net-next v4 0/2] Add support for LEDs on Marvell PHYs Jakub Kicinski
2020-08-07  9:06 ` Pavel Machek
2020-08-07 13:29   ` Andrew Lunn
2020-08-29 22:43     ` Pavel Machek
2020-08-29 23:36       ` Andrew Lunn
2020-08-30  1:50         ` Andrew Lunn
2020-08-30  9:22         ` Pavel Machek
2020-08-25  8:13 ` Matthias Schiffer
2020-08-30 22:56   ` Marek Behun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200728192838.29c798a9@nic.cz \
    --to=marek.behun@nic.cz \
    --cc=andrew@lunn.ch \
    --cc=dmurphy@ti.com \
    --cc=gregory.clement@bootlin.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=megous@megous.com \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.