Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1470869
| From | Rafał Miłecki <zajec5@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger |
| Date | 2016-08-26 18:00 +0200 |
| Message-ID | <sarHX-B0-5@gated-at.bofh.it> (permalink) |
| References | <sa48G-2d0-21@gated-at.bofh.it> <sa7SV-4G3-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 25 August 2016 at 20:48, Jacek Anaszewski <jacek.anaszewski@gmail.com> wrote: > On 08/25/2016 04:30 PM, Alan Stern wrote: >> >> On Thu, 25 Aug 2016, Jacek Anaszewski wrote: >> >>> I'd see it as follows: >>> >>> #cat available_ports >>> #1-1 1-2 2-1 >>> >>> #echo "1-1" > new_port >>> >>> #cat observed_ports >>> #1-1 >>> >>> #echo "2-1" > new_port >>> >>> #cat observed_ports >>> #1-1 2-1 >>> >>> We've already had few discussions about the sysfs designs trying >>> to break the one-value-per-file rule for LED class device, and >>> there was always strong resistance against. >> >> >> This scheme has multiple values in both the available_ports and >> observed_ports files. :-( Not that I have any better suggestions... > > > Right, I forgot to add a note here, that this follows space > separated list pattern similarly as in case of triggers attribute. > Of course other suggestions are welcome. So ppl have doubts about multiple values in a single sysfs file (whatever we call it: "ports" or "observed_ports"). Greg clearly said: > sysfs is "one value per file", here you are listing a bunch of things in > one sysfs file. Please don't do that. What about my idea of using "ports" subdirectory and having each port as separated file inside that subdir? I think there are two ways of doing this: 1) Having "ports" subdir with 0x0000 chmod files, one per each port specified as observable In this solution we need "new_port" and "remove_port" that can be used for management of observable ports. I think Jacek wasn't happy with this chmod and he believes Greg meant R/W files. 2) Having "ports" subdir with RW files, one per each existing physical port In this situation we don't need "new_port" or "remove_port". If we want port to be observable we just do: echo 1 > 1-1 Implementing this solution needs reading more details from USB subsystem. Do you find any of solutions with "ports" subdir better than dealing with new-line/space separated values in a single sysfs file? -- Rafał
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Alan Stern <stern@rowland.harvard.edu> - 2016-08-25 16:50 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2016-08-25 20:50 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Alan Stern <stern@rowland.harvard.edu> - 2016-08-25 21:40 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Alan Stern <stern@rowland.harvard.edu> - 2016-08-25 22:10 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-26 18:00 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-08-29 10:00 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Pavel Machek <pavel@ucw.cz> - 2016-08-29 10:10 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-29 10:30 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Pavel Machek <pavel@ucw.cz> - 2016-08-29 10:50 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-29 11:10 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Pavel Machek <pavel@ucw.cz> - 2016-08-26 22:00 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-08-29 10:40 +0200
csiph-web