linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <hzpeterchen@gmail.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "Richard Purdie" <rpurdie@rpsys.net>,
	"Jacek Anaszewski" <j.anaszewski@samsung.com>,
	"Felipe Balbi" <balbi@kernel.org>,
	"Greg KH" <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, "Rafał Miłecki" <rafal@milecki.pl>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Ezequiel Garcia" <ezequiel@vanguardiasur.com.ar>,
	"Matthias Brugger" <mbrugger@suse.com>,
	"Pavel Machek" <pavel@ucw.cz>, "Stephan Linz" <linz@li-pro.net>,
	"Boris Brezillon" <boris.brezillon@free-electrons.com>,
	"open list" <linux-kernel@vger.kernel.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	"open list:LED SUBSYSTEM" <linux-leds@vger.kernel.org>
Subject: Re: [PATCH V5] leds: trigger: Introduce a USB port trigger
Date: Fri, 9 Sep 2016 17:34:40 +0800	[thread overview]
Message-ID: <20160909093440.GF15637@b29397-desktop> (raw)
In-Reply-To: <20160908160904.31719-1-zajec5@gmail.com>

On Thu, Sep 08, 2016 at 06:08:24PM +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> This commit adds a new trigger responsible for turning on LED when USB
> device gets connected to the selected USB port. This can can useful for
> various home routers that have USB port(s) and a proper LED telling user
> a device is connected.
> 
> The trigger gets its documentation file but basically it just requires
> enabling it and selecting USB ports (e.g. echo 1 > ports/usb1-1).
> 
> There was a long discussion on design of this driver. Its current state
> is a result of picking them most adjustable solution as others couldn't
> handle all cases.
> 
> 1) It wasn't possible for the driver to register separated trigger for
>    each USB port. Some physical USB ports are handled by more than one
>    controller and so by more than one USB port. E.g. USB 2.0 physical
>    port may be handled by OHCI's port and EHCI's port.
>    It's also not possible to assign more than 1 trigger to a single LED
>    and implementing such feature would be tricky due to syncing triggers
>    and sysfs conflicts with old triggers.
> 
> 2) Another idea was to register trigger per USB hub. This wouldn't allow
>    handling devices with multiple USB LEDs and controllers (hubs)
>    controlling more than 1 physical port. It's common for hubs to have
>    few ports and each may have its own LED.
> 
> This final trigger is highly flexible. It allows selecting any USB ports
> for any LED. It was also modified (compared to the initial version) to
> allow choosing ports rather than having user /guess/ proper names. It
> was successfully tested on SmartRG SR400ac which has 3 USB LEDs,
> 2 physical ports and 3 controllers.
> 
> Another planned feature is support for LED reacting to the USB activity.
> This can be implemented with another sysfs file for setting mode. The
> default mode wouldn't change so there won't be ABI breakage and such
> feature can be safely implemented later.
> 

It has such driver at: drivers/usb/common/led.c

-- 

Best Regards,
Peter Chen

  reply	other threads:[~2016-09-09  9:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08 16:08 [PATCH V5] leds: trigger: Introduce a USB port trigger Rafał Miłecki
2016-09-09  9:34 ` Peter Chen [this message]
2016-09-09  9:52   ` Rafał Miłecki
2016-09-09 11:05   ` Greg KH
2016-09-09 11:31     ` Rafał Miłecki
2016-09-15 12:56       ` Pavel Machek
2016-09-15 13:33         ` Rafał Miłecki
2016-09-15 14:54           ` Jacek Anaszewski
2016-09-16 19:18           ` Pavel Machek

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=20160909093440.GF15637@b29397-desktop \
    --to=hzpeterchen@gmail.com \
    --cc=balbi@kernel.org \
    --cc=boris.brezillon@free-electrons.com \
    --cc=corbet@lwn.net \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=gregkh@linuxfoundation.org \
    --cc=j.anaszewski@samsung.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linz@li-pro.net \
    --cc=mbrugger@suse.com \
    --cc=pavel@ucw.cz \
    --cc=rafal@milecki.pl \
    --cc=rpurdie@rpsys.net \
    --cc=zajec5@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).