From: Andrew Lunn <andrew@lunn.ch>
To: Vishal Thanki <vishalthanki@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Matus Ujhelyi <ujhelyi.m@gmail.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH 0/3] Control ethernet PHY LEDs via LED subsystem
Date: Thu, 24 Mar 2016 14:29:35 +0100 [thread overview]
Message-ID: <20160324132935.GA15624@lunn.ch> (raw)
In-Reply-To: <CAC3a_SBjvQFT5XP2bH3TO_4wHnjZ3a3+XvfBy8StxQieEsavQQ@mail.gmail.com>
On Wed, Mar 23, 2016 at 10:24:45PM +0100, Vishal Thanki wrote:
> On Wed, Mar 23, 2016 at 10:10 PM, Andrew Lunn <andrew@lunn.ch> wrote:
> > On Wed, Mar 23, 2016 at 09:24:00PM +0100, Vishal Thanki wrote:
> >> Hi,
> >>
> >> > My suggestion was that the hardware needs to control the LEDs. You
> >> > have software doing it. You might be able to do this with the PHY
> >> > state machine for link. But activity is never going to be accepted if
> >> > software control.
> >> >
> >> > The LED trigger attached to an LED should be used to configure the
> >> > hardware to drive the LED as wanted.
> >> >
> >>
> >> The eth-phy-activity trigger uses the blink_set which I think uses the
> >> hardware acceleration if available. I am not sure how to handles LEDs
> >> which does not have hardware acceleration for this (eth-phy-activity)
> >> trigger.
> >
> > We want the LED to blink on activity, real packets coming in and
> > out. The PHY can do this, so let the PHY control the LED. In this
> > case, the trigger is just mechanism for the user to say what the LED
> > should be used for. The trigger is not itself controlling the LED, it
> > has no idea about packets coming and going.
> >
>
> Yes, I understand that. But PHY can only control the LEDs attached to
> it directly. The at803x led driver configures the PHY to blink the
> activity LED based on traffic but I think it is not possible for PHY
> to control other LEDs in system, for example some other LEDs in system
> controlled only via GPIO. In such cases, putting PHY activity trigger
> on the GPIO LEDs would not make sense. Correct me if I am wrong.
Hi Vishal
All correct. Which is why i said in my original email, you need to
extend the LED core to associate triggers to LEDs. You can then
associate the eth-phy-activity trigger to only PHY leds which can
implement that functionality.
drivers/leds/led-triggers.c contains a global list
LIST_HEAD(trigger_list) which triggers get added to using
led_trigger_register(). You could add a second list to the
led_classdev structure, and add an led_trigger_register_to_led()
function which registers a trigger to a specific LED, on its own
trigger list. led_trigger_store() and led_trigger_show() would use
both lists.
Andrew
next prev parent reply other threads:[~2016-03-24 13:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-23 17:51 [PATCH 0/3] Control ethernet PHY LEDs via LED subsystem Vishal Thanki
2016-03-23 17:51 ` [PATCH 1/3] net: phy: Add ethernet PHY LED triggers Vishal Thanki
2016-03-23 17:51 ` [PATCH 2/3] net: phy: at8030: Expose the Link and Activity LEDs Vishal Thanki
2016-03-23 18:56 ` Andrew Lunn
2016-03-23 17:51 ` [PATCH 3/3] led: at8030: Add LED driver for AT8030 ethernet PHY Vishal Thanki
2016-03-23 18:52 ` Andrew Lunn
2016-03-23 18:50 ` [PATCH 0/3] Control ethernet PHY LEDs via LED subsystem Andrew Lunn
2016-03-23 20:24 ` Vishal Thanki
2016-03-23 21:10 ` Andrew Lunn
2016-03-23 21:24 ` Vishal Thanki
2016-03-24 13:29 ` Andrew Lunn [this message]
2016-03-24 17:35 ` Vishal Thanki
2016-03-24 18:50 ` Andrew Lunn
2016-03-28 15:43 ` Stephen Hemminger
2016-03-28 16:10 ` Andrew Lunn
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=20160324132935.GA15624@lunn.ch \
--to=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=ujhelyi.m@gmail.com \
--cc=vishalthanki@gmail.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.