Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-10-10 Thread Pavel Machek
On Wed 2016-08-31 14:23:13, Alan Stern wrote: > On Tue, 30 Aug 2016, Rafał Miłecki wrote: > > > >> As you quite often need more complex LED management, there are > > >> triggers that were introduced in 2006 by c3bc9956ec52f ("[PATCH] LED: > > >> add LED trigger tupport"). Some triggers are

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-10-10 Thread Pavel Machek
Hi! > 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

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-09-05 Thread Rafał Miłecki
On 4 September 2016 at 02:24, Alan Stern wrote: > On Sat, 3 Sep 2016, Jacek Anaszewski wrote: > >> >> The remaining issue is the sysfs interface design for defining and >> >> presenting multiple USB ports. I'm still in favour of a single >> >> attribute with space

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-09-03 Thread Alan Stern
On Sat, 3 Sep 2016, Jacek Anaszewski wrote: > >> The remaining issue is the sysfs interface design for defining and > >> presenting multiple USB ports. I'm still in favour of a single > >> attribute with space separated list. This scheme is commonly used > >> in existing interfaces. > > > > No

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-09-03 Thread Jacek Anaszewski
On 09/03/2016 05:17 PM, Alan Stern wrote: On Sat, 3 Sep 2016, Jacek Anaszewski wrote: Maybe it would make more sense, in this case, to allow only three possibilities for a USB port activity trigger. Toggle the LED whenever: There is activity on the specified port, or There

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-09-03 Thread Alan Stern
On Sat, 3 Sep 2016, Jacek Anaszewski wrote: > >>> Maybe it would make more sense, in this case, to allow only three > >>> possibilities for a USB port activity trigger. Toggle the LED > >>> whenever: > >>> > >>> There is activity on the specified port, or > >>> > >>> There is any activity on

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-09-03 Thread Jacek Anaszewski
On 09/02/2016 04:33 PM, Alan Stern wrote: On Fri, 2 Sep 2016, Jacek Anaszewski wrote: I'm pretty sure noone ever planned to have more than 1 trigger assigned to a single LED. I just realized there will be a problem with proposed solution: sysfs files conflict. ... Currently we support only

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-09-02 Thread Alan Stern
On Fri, 2 Sep 2016, Jacek Anaszewski wrote: > >>> I'm pretty sure noone ever planned to have more than 1 trigger > >>> assigned to a single LED. I just realized there will be a problem with > >>> proposed solution: sysfs files conflict. ... > >> Currently we support only triggers dedicated to

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-09-02 Thread Jacek Anaszewski
On 09/01/2016 04:36 PM, Alan Stern wrote: On Thu, 1 Sep 2016, Jacek Anaszewski wrote: On 09/01/2016 07:25 AM, Rafał Miłecki wrote: On 31 August 2016 at 21:00, Rafał Miłecki wrote: On 31 August 2016 at 20:23, Alan Stern wrote: On Tue, 30 Aug

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-09-01 Thread Alan Stern
On Thu, 1 Sep 2016, Jacek Anaszewski wrote: > On 09/01/2016 07:25 AM, Rafał Miłecki wrote: > > On 31 August 2016 at 21:00, Rafał Miłecki wrote: > >> On 31 August 2016 at 20:23, Alan Stern wrote: > >>> On Tue, 30 Aug 2016, Rafał Miłecki wrote: >

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-09-01 Thread Jacek Anaszewski
On 09/01/2016 07:25 AM, Rafał Miłecki wrote: On 31 August 2016 at 21:00, Rafał Miłecki wrote: On 31 August 2016 at 20:23, Alan Stern wrote: On Tue, 30 Aug 2016, Rafał Miłecki wrote: Not really as it won't cover some pretty common use cases. Many

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-08-31 Thread Rafał Miłecki
On 31 August 2016 at 21:00, Rafał Miłecki wrote: > On 31 August 2016 at 20:23, Alan Stern wrote: >> On Tue, 30 Aug 2016, Rafał Miłecki wrote: >>> Not really as it won't cover some pretty common use cases. Many home >>> routers have few USB ports (2-5)

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-08-31 Thread Rafał Miłecki
On 31 August 2016 at 20:23, Alan Stern wrote: > On Tue, 30 Aug 2016, Rafał Miłecki wrote: > >> >> As you quite often need more complex LED management, there are >> >> triggers that were introduced in 2006 by c3bc9956ec52f ("[PATCH] LED: >> >> add LED trigger tupport").

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-08-31 Thread Alan Stern
On Tue, 30 Aug 2016, Rafał Miłecki wrote: > >> As you quite often need more complex LED management, there are > >> triggers that were introduced in 2006 by c3bc9956ec52f ("[PATCH] LED: > >> add LED trigger tupport"). Some triggers are trivial and could be > >> implemented in userspace as well

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-08-30 Thread Rafał Miłecki
On 30 August 2016 at 22:54, Alan Stern wrote: > On Tue, 30 Aug 2016, Rafał Miłecki wrote: > >> Please take a look at Documentation to get some idea of LED triggers: >> Documentation/leds/leds-class.txt >> >> Basically a LED (/sys/class/leds/foo/) can be controller with

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-08-30 Thread Alan Stern
On Tue, 30 Aug 2016, Rafał Miłecki wrote: > Please take a look at Documentation to get some idea of LED triggers: > Documentation/leds/leds-class.txt > > Basically a LED (/sys/class/leds/foo/) can be controller with > "brightness" sysfs file like this: > echo 0 > brightness > echo 5 > brightness

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-08-30 Thread Rafał Miłecki
On 30 August 2016 at 14:05, Greg KH wrote: > On Fri, Aug 26, 2016 at 05:38:05PM +0200, Rafał Miłecki wrote: >> On 25 August 2016 at 14:49, Greg KH wrote: >> > On Thu, Aug 25, 2016 at 10:03:52AM +0200, Rafał Miłecki wrote: >> >> +static void

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-08-30 Thread Greg KH
On Fri, Aug 26, 2016 at 05:38:05PM +0200, Rafał Miłecki wrote: > On 25 August 2016 at 14:49, Greg KH wrote: > > On Thu, Aug 25, 2016 at 10:03:52AM +0200, Rafał Miłecki wrote: > >> +static void usbport_trig_activate(struct led_classdev *led_cdev) > >> +{ > >> +

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-08-26 Thread Rafał Miłecki
On 25 August 2016 at 14:49, Greg KH wrote: > On Thu, Aug 25, 2016 at 10:03:52AM +0200, Rafał Miłecki wrote: >> +static void usbport_trig_activate(struct led_classdev *led_cdev) >> +{ >> + struct usbport_trig_data *usbport_data; >> + int err; >> + >> +

Re: [PATCH V4] leds: trigger: Introduce an USB port trigger

2016-08-25 Thread Greg KH
On Thu, Aug 25, 2016 at 10:03:52AM +0200, Rafał Miłecki wrote: > +static void usbport_trig_activate(struct led_classdev *led_cdev) > +{ > + struct usbport_trig_data *usbport_data; > + int err; > + > + usbport_data = kzalloc(sizeof(*usbport_data), GFP_KERNEL); > + if (!usbport_data)