[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGXE3d9Zv572L22swzHctNR0QNiA-tDAPEhTZKSXBA6SZfeLFg@mail.gmail.com>
Date: Tue, 16 Jul 2013 08:56:51 +0200
From: Helmut Schaa <helmut.schaa@...glemail.com>
To: Florian Fainelli <florian@...nwrt.org>
Cc: netdev <netdev@...r.kernel.org>, David Miller <davem@...emloft.net>
Subject: Re: [PATCH 2/2] drivers: net: phy: at803x: LED control via led subsystem
On Fri, Jul 12, 2013 at 9:19 AM, Florian Fainelli <florian@...nwrt.org> wrote:
> 2013/7/11 Helmut Schaa <helmut.schaa@...glemail.com>:
>>>
>>> I do like this and I believe that there is nothing specific that would
>>> prevent you from making software controllable LEDs from being used
>>> with other PHYs. How about you create a small LED class helper that
>>> PHY drivers supporting controllable LEDs can hook into and provide
>>> their own callback and LED name for setting the LED state?
>>
>> Hmm, nice idea. However, there is not much complexity in the code. The only
>> thing worth to make generic would be the delayed register access via workqueue.
>> The rest is just registering the led device :)
>>
>> I thought about moving the code into the generic phy code and using a new
>> phy_driver callback for setting the LED state but there might be more then one
>> LED pin on some PHYs (activity, speed, duplexmode etc.).
>
> I think that the same callback for all LEDs and just take actions
> based on which led_classdev pointer we get passed should be enough. I
> agree with you that there is not much complexity, but for sure, if we
> add support for LEDs to another PHY driver there will be similar stuff
> done (registering a LED classdev, etc...) so we might just want to
> specialize the led_brightness_set() callback and the number of LEDs.
> One thing with moving this closer to the PHY state machine would be to
> allow for better integration, like setting the LED brightness to 0
> when the link goes down etc...
Agreed, let me see if I can come up with a more generic approach.
Thanks,
Helmut
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists