Util-Linux package development
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Daniel Drake <dsd@laptop.org>
Cc: util-linux@vger.kernel.org, pgf@laptop.org,
	dmitry.torokhov@gmail.com, Kay Sievers <kay.sievers@vrfy.org>
Subject: Re: [PATCH] evstate: new utility for querying evdev key/switch/event state
Date: Mon, 11 Jul 2011 14:18:36 +0200	[thread overview]
Message-ID: <20110711121836.GJ5214@nb.net.home> (raw)
In-Reply-To: <20110709132046.90A119D401C@zog.reactivated.net>

On Sat, Jul 09, 2011 at 02:20:46PM +0100, Daniel Drake wrote:
> evstate is a small utility that queries evdev state of a specific
> key, switch, button, LED or sound event. This is useful in programs
> such as powerd (http://wiki.laptop.org/go/Powerd) which need to query
> things like the state of the laptop lid switch from shell code.
> 
> Our earlier non-upstream approach to this was to add sysfs nodes that
> would indicate button state, but Dmitry Torokhov is against seeing those
> in the upstream kernel as it is duplicating info from the input layer:

Sounds too crazy...

The duplication is normal (see for example block devices). There is
many places where we have the same information accessible by ioctl()
as well as by sysfs.

The sysfs is usually the preferred way, because it does not require root
permissions to read the attributes and you can use standard file/text
utils rather than any specialized ioctl wrappers.

> http://article.gmane.org/gmane.linux.drivers.platform.x86.devel/1089

Wow, so you have already implemented a patch that exports the state
in *human readable format* by sysfs. This patch was NACKed.

Now it's expected that everyone in userspace will use ioctl() (with
root permissions?) and translate any crazy bit array to something
human readable. Right? Really?

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2011-07-11 12:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-09 13:20 [PATCH] evstate: new utility for querying evdev key/switch/event state Daniel Drake
2011-07-11 12:18 ` Karel Zak [this message]
2011-07-11 13:12   ` Daniel Drake
2011-07-11 13:14     ` Daniel Drake
2011-07-11 16:39   ` Dmitry Torokhov
2011-07-11 16:48     ` Daniel Drake
2011-07-12 20:07       ` Paul Fox
2011-07-12 20:35         ` Dmitry Torokhov

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=20110711121836.GJ5214@nb.net.home \
    --to=kzak@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dsd@laptop.org \
    --cc=kay.sievers@vrfy.org \
    --cc=pgf@laptop.org \
    --cc=util-linux@vger.kernel.org \
    /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