All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Pavel Machek <pavel@ucw.cz>
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: Mon, 16 Feb 2015 12:18:48 +0100	[thread overview]
Message-ID: <54E1D218.6020000@samsung.com> (raw)
In-Reply-To: <20150212174444.GA9450@amd>

Hi Pavel,

On 02/12/2015 06:44 PM, Pavel Machek wrote:
> Hi!
>
>>>> 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.)
>>
>> "Fixed strings with one marked by []s happen" - I don't quite
>> get this.
>
> root@duo:~# cat /sys/power/state
> freeze mem disk
> root@duo:~# cat /sys/power/disk
> [platform] shutdown reboot suspend
> root@duo:~#
>
>> Could you propose the acceptable format then?
>> The numbers alone are inconvenient to use, we need a human
>> readable description next to them. Or some another way
>> to obtain the name.
>
> Files like "0.active", "0.name", "1.active", "1.name"?
>
> Subdirectories 0/1 with "name" and "active" files?

We have flash_sync_strobe attribute which allows to read currently
chosen sync_led. I would simplify this:

Let's assume there are two LED Flash class deviecs:

- max77693-flash1
- max77693-flash2

Proposed design described by use cases:

#cd /sys/class/leds/max77693-flash1
#cat available_flash_leds
#[0.none] 1.max77693-flash2
#cat flash_sync_strobe
#0.none
#echo 1 > flash_sync_strobe
#cat flash_sync_strobe
#1.max77693-flash2
#cat available_sync_leds
#0.none [1.max77693-flash2]


-- 
Best Regards,
Jacek Anaszewski

  reply	other threads:[~2015-02-16 11:18 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
2015-02-12 11:15           ` Jacek Anaszewski
2015-02-12 17:44             ` Pavel Machek
2015-02-16 11:18               ` Jacek Anaszewski [this message]
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=54E1D218.6020000@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=cooloney@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.