From: Pavel Machek <pavel@ucw.cz>
To: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: "Rafał Miłecki" <zajec5@gmail.com>,
"Richard Purdie" <rpurdie@rpsys.net>,
"Felipe Balbi" <balbi@kernel.org>,
"Greg KH" <gregkh@linuxfoundation.org>,
"Peter Chen" <hzpeterchen@gmail.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"Rafał Miłecki" <rafal@milecki.pl>,
"Jonathan Corbet" <corbet@lwn.net>,
"Ezequiel Garcia" <ezequiel@vanguardiasur.com.ar>,
"Stephan Linz" <linz@li-pro.net>,
"Matthias Brugger" <mbrugger@suse.com>,
"Boris Brezillon" <boris.brezillon@free-electrons.com>,
"Geert Uytterhoeven" <geert@linux-m68k.org>,
"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
"open list" <linux-kernel@vger.kernel.org>,
"open list:LED SUBSYSTEM" <linux-leds@vger.kernel.org>
Subject: Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger
Date: Fri, 26 Aug 2016 21:48:47 +0200 [thread overview]
Message-ID: <20160826194847.GB21442@amd> (raw)
In-Reply-To: <d9d2ae14-c009-3518-ac4c-4b71abe91e88@samsung.com>
On Thu 2016-08-25 11:04:38, Jacek Anaszewski wrote:
> On 08/25/2016 10:29 AM, Rafał Miłecki wrote:
> >On 25 August 2016 at 10:03, Jacek Anaszewski <j.anaszewski@samsung.com> wrote:
> >>On 08/24/2016 07:52 PM, 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 specified 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
> >>>specifying USB port in a Linux format (e.g. echo 1-1 > new_port).
> >>>
> >>>During work on this trigger there was a plan to add DT bindings for it,
> >>>but there wasn't an agreement on the format yet. This can be worked on
> >>>later, a sysfs interface is needed anyway for platforms not using DT.
> >>>
> >>>Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> >>>---
> >>>V2: Trying to add DT support, idea postponed as it will take more time
> >>> to discuss the bindings.
> >>>V3: Fix typos in commit and Documentation (thanks Jacek!)
> >>> Use "ports" sysfs file for adding and removing USB ports (thx Jacek)
> >>> Check if there is USB device connected after adding new USB port
> >>> Fix memory leak or two
> >>>V3.5: Fix e-mail address (thanks Matthias)
> >>> Simplify conditions in usbport_trig_notify (thx Matthias)
> >>> Make "ports" a subdirectory with file per port, to match one value
> >>> per file sysfs rule (thanks Greg)
> >>> As "ports" couldn't be used for adding and removing ports anymore,
> >>> there are now "new_port" and "remove_port". Having them makes this
> >>> API also common with e.g. pci and usb buses.
> >>
> >>
> >>Now writing new_port with "1-1" produces a file named "1-1" in the
> >>ports directory with 000 permissions. I think that what Greg had
> >>on mind by referring to "one value per file" rule was a set of
> >>files representing ports, like "1-1 1-2 2-1", and each file should be
> >>readable/writeable.
> >>
> >>For instance "echo 1 > 1-1" would enable the trigger for the port 1-1
> >>and "echo 0 > 1-1" would disable it. The problem is that we don't know
> >>the number of required ports at compilation time and the sysfs
> >>attributes would have to be dynamically created on driver instantiation.
> >>What is more, as the USB ports can dynamically appear/disappear in the
> >>system, the files would have to be created/removed accordingly during
> >>LED class device lifetime, which is not the best design for the sysfs
> >>interface I think.
Could we add a flag to the USB port, instead? That way, USB code would
take care of creating the enable file in its own directory.
Is per-port control needed? Would just global control be sufficient?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2016-08-26 19:48 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-23 22:03 [PATCH V3] leds: trigger: Introduce an USB port trigger Rafał Miłecki
2016-08-24 9:21 ` Greg KH
[not found] ` <20160824092129.GA23180-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2016-08-24 9:26 ` Rafał Miłecki
2016-08-24 21:04 ` Greg KH
2016-08-24 9:22 ` Greg KH
2016-08-24 9:29 ` Rafał Miłecki
2016-08-24 21:04 ` Greg KH
2016-08-25 5:14 ` Rafał Miłecki
2016-08-25 12:53 ` Greg KH
2016-08-25 18:39 ` Bjørn Mork
2016-08-25 20:55 ` Greg KH
2016-08-24 10:49 ` Matthias Brugger
2016-08-24 11:02 ` Rafał Miłecki
2016-08-24 11:27 ` Matthias Brugger
2016-08-24 17:52 ` [PATCH RFC V3.5] " Rafał Miłecki
2016-08-24 18:48 ` Bjørn Mork
2016-08-24 20:42 ` Rafał Miłecki
2016-08-25 8:03 ` Jacek Anaszewski
2016-08-25 8:27 ` Matthias Brugger
2016-08-25 8:29 ` Rafał Miłecki
2016-08-25 9:04 ` Jacek Anaszewski
2016-08-25 14:30 ` Alan Stern
2016-08-25 18:48 ` Jacek Anaszewski
2016-08-25 19:35 ` Alan Stern
2016-08-25 20:08 ` Alan Stern
2016-08-26 15:58 ` Rafał Miłecki
2016-08-29 7:41 ` Jacek Anaszewski
2016-08-29 8:05 ` Pavel Machek
2016-08-29 8:21 ` Rafał Miłecki
2016-08-29 8:41 ` Pavel Machek
2016-08-29 9:01 ` Rafał Miłecki
2016-08-26 19:50 ` Pavel Machek
2016-08-29 8:29 ` Jacek Anaszewski
2016-08-26 19:48 ` Pavel Machek [this message]
2016-08-25 8:32 ` Rafał Miłecki
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=20160826194847.GB21442@amd \
--to=pavel@ucw.cz \
--cc=balbi@kernel.org \
--cc=boris.brezillon@free-electrons.com \
--cc=corbet@lwn.net \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=hzpeterchen@gmail.com \
--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=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).