linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Pali Rohár" <pali.rohar@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	Darren Hart <dvhart@infradead.org>,
	platform-driver-x86@vger.kernel.org
Subject: Re: LED devices & poll() for brightness attribute
Date: Wed, 22 Feb 2017 21:54:08 +0100	[thread overview]
Message-ID: <20170222205408.GB8467@amd> (raw)
In-Reply-To: <20170222123929.GD21558@pali>

[-- Attachment #1: Type: text/plain, Size: 2006 bytes --]

On Wed 2017-02-22 13:39:29, Pali Rohár wrote:
> On Wednesday 22 February 2017 13:25:57 Pavel Machek wrote:
> > Hi!
> > 
> > > But this support is useful just for one single central userspace
> > > application which will control all leds in system other application
> > > which will change state by /sys/class/leds/ will de-synchronize that one
> > > central application.

Actually this is wrong.

> > Yes. Does it matter for some real use case?
> 
> Yes. E.g. systemd has already some support for changing leds. And I do
> not want to be forced to use systemd (or any other specific application)
> just because it already controls leds.

So... you don't want to use systemd, so don't use systemd. What is the
problem? :-)

> And my own application for controlling leds should know current state of
> them if it is possible.

If you have at most one application controlling each LED, you are
fine. That's quite common situation, serial port can also be opened at
most once. Do you actually have two applications accessing one led? If
so, what applications?

> > > So I think new ABI is not sufficient and I would propose to add poll()
> > > support also for changes done by userspace, write() to attribute
> > > /sys/class/leds/.../brightness.
> > 
> > Not easily possible, as we have triggers, and this was discussed in
> > great great lengths before. Please go through that discussion.
> 
> Without triggers and blinking it should be possible.
> 
> Just notify only when some application do echo > brightness.

Yes, we _could_ do that. Would be slightly confusing
w.r.t. triggers. But is it good idea?

Userspace could easily keep /var/run/led/XXX/brightness, and inotify
works over regular files..

And yes, with three color LEDs, userspace daemon managing LED state
will be pretty much mandatory...

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2017-02-22 20:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22  9:06 LED devices & poll() for brightness attribute Pali Rohár
2017-02-22 12:25 ` Pavel Machek
2017-02-22 12:39   ` Pali Rohár
2017-02-22 20:54     ` Pavel Machek [this message]
2017-02-22 21:16       ` Pali Rohár
2017-02-23 14:37         ` Pavel Machek
2017-02-23 14:48           ` Pali Rohár
2017-02-23 20:23             ` Pavel Machek
2017-02-23 20:44               ` Pali Rohár
2017-02-23 21:03                 ` Pavel Machek
2017-02-24  8:50                   ` Pali Rohár
2017-02-24  8:52                     ` Hans de Goede
2017-02-24  8:58                       ` Pali Rohár

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=20170222205408.GB8467@amd \
    --to=pavel@ucw.cz \
    --cc=dvhart@infradead.org \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /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).