linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: linux-leds@vger.kernel.org, b.zolnierkie@samsung.com,
	cooloney@gmail.com, rpurdie@rpsys.net, sakari.ailus@iki.fi,
	s.nawrocki@samsung.com
Subject: Re: [PATCH v2] Documentation: leds: Add description of LED Flash class extension
Date: Thu, 12 Feb 2015 11:54:17 +0100	[thread overview]
Message-ID: <20150212105417.GA10377@amd> (raw)
In-Reply-To: <54DC7C1E.5020105@samsung.com>

On Thu 2015-02-12 11:10:38, Jacek Anaszewski wrote:
> On 02/12/2015 10:07 AM, Pavel Machek wrote:
> >Hi!
> >
> >>I can be 0 or 1. Let's make it more precise:
> >>
> >>- flash_strobe - flash strobe state (RW):
> >>			semantics on write:
> >>				0: turn the flash LED off
> >>				1: strobe the flash LED
> >>			semantics on read:
> >>				0: flash LED is off
> >>				1: flash LED is strobing
> >
> >Thanks.
> >
> >>>>+	- available_sync_leds - list of sub-LEDs available for flash strobe
> >>>>+				synchronization (RO)
> >>>
> >>>"space separated"?
> >>
> >>- available_sync_leds - space separated list of sub-LEDs available for
> >>			flash strobe synchronization; each sub-LED is
> >>			described in the form of chunks:
> >>			[led_id: led_name]
> >>
> >>
> >>>So this will say something like "0 3 5"
> >>
> >>Rather e.g.: [0: none] [1: max77693-led1] [2: max77693-led2]
> >
> >No no, sorry, you can't do that. Sysfs is supposed to be one value per
> >file, and this is stretching it. (It would be also difficult to parse;
> >for example, you can reasonably have ":" in led name, and perhaps even
> >" " or "]"....
> 
> You acked LED Flash class patch, didn't you? :)
> 
> There are many attributes documented in the list fashion, e.g.:
> available_frequencies in the Documentation/ABI/testing/sysfs-class-devfreq.

No, sorry, you can't do this. We have this parsing nightmare in /proc,
before, and we don't want it again.

> If we changed this a bit it would be easily parsed with AWK:
> 
> echo "0 none;1 max77693-led1;2 max77693-led2" | awk -F';' '{ for (i=1;
> i<=NF; i++) print $i}' | awk '{print $1": "$2}'

sysfs is one entry per file. If someone screwed it up in devfreq, it
is not reason to screw it up here. (Space separated lists of integers
might be acceptable. Fixed strings with one marked by []s happen,
too. Maps between ints and names are not.)
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2015-02-12 10:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05  8:42 [PATCH v2] Documentation: leds: Add description of LED Flash class extension Jacek Anaszewski
2015-02-06 18:48 ` Bryan Wu
2015-02-09  8:17   ` Jacek Anaszewski
2015-02-11 21:57 ` Pavel Machek
2015-02-12  8:41   ` Jacek Anaszewski
2015-02-12  9:07     ` Pavel Machek
2015-02-12 10:10       ` Jacek Anaszewski
2015-02-12 10:54         ` Pavel Machek [this message]
2015-02-12 11:15           ` Jacek Anaszewski
2015-02-12 17:44             ` Pavel Machek
2015-02-16 11:18               ` Jacek Anaszewski
2015-02-16 13:06                 ` Sakari Ailus
2015-02-16 13:30                   ` Jacek Anaszewski
2015-02-16 19:45                 ` 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=20150212105417.GA10377@amd \
    --to=pavel@ucw.cz \
    --cc=b.zolnierkie@samsung.com \
    --cc=cooloney@gmail.com \
    --cc=j.anaszewski@samsung.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    --cc=s.nawrocki@samsung.com \
    --cc=sakari.ailus@iki.fi \
    /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).