public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <rpurdie@rpsys.net>
To: dtor_core@ameritech.net
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Pavel Machek <pavel@suse.cz>
Subject: Re: [RFC] [PATCH] Make ACPI button driver an input device
Date: Mon, 24 Apr 2006 17:05:30 +0100	[thread overview]
Message-ID: <1145894731.7155.120.camel@localhost.localdomain> (raw)
In-Reply-To: <d120d5000604240745i71bd56b8n99b97130388d36f6@mail.gmail.com>

On Mon, 2006-04-24 at 10:45 -0400, Dmitry Torokhov wrote:
> Yes, I still need to apply it.
> 
> Matthew, I would recommend not adding KEY_LID but using one of the
> switch codes (SW_0?) for the lid.
> 
> Richard, on your handhelds what switch would be most similar to
> notebook's lid? Should we alias one of the switches to SW_LID?

This gets tricky as the handhelds have two "lid" switches. Pictures of
how it can fold are at http://www.dynamism.com/sl-c3000/main.shtml . To
summarise, it can be in three positions:

* Screen folded facing the keys (shut like a laptop)
* Screen open above the keyboard (like an open laptop)
* Screen folded over the keys but with the screen visible (becomes a
tablet like handheld with no keyboard)

Shut is when both switches (SW_0 and SW_1) are pressed, open is when
neither are pressed and the "no keyboard" mode has only one switch
pressed.

The final switch (SW_2) is mapped to headphone detection.

If we are going to have a KEY_LID switch, we should probably decide now
whether the switch is pressed (1) when the lid is either open or shut
otherwise things are going to get confused.

I've often wondered whether the input system could/should be used to
pass more generic events. I know my handheld has lots of other switch
like events such as MMC/SD card insertion, CF card insertion, a battery
lock switch, AC power insertion switch and USB cable detection "switch".
Most of these are currently acted on by the kernel so userspace doesn't
need to see them but some like the USB cable detection would be useful.
It could then load the user's chosen USB gadget kernel module for
example. In that case its a user choice as there is no "right" gadget
module to autoload. I'm not sure if it would be right for these to go
via the input system and last time I looked, udev wasn't able to handle
generic events like this. 

In an ideal world, given the system nature of the events, perhaps they'd
be better suited to a more generalised or specialised piece of code
based on the input system. A more general events system would mean we
could have:

EVENT_LID_SHUT
EVENT_LID_OPEN
EVENT_LID_OPEN_NOKEYBOARD

or similar which would avoid the issues associated with a single SW_LID
switch. I suspect there are no easy answers though.

Whilst sort of on the subject (AC power switches and AC power events)
I'd like to see some standard way of exporting power/battery information
to userspace. Currently, the ARM handhelds use kernel emulation of an
APM bios and export the battery info as part of that. Making ARM emulate
ACPI interfaces doesn't appeal. The answer could be a battery sysfs
class and the above system events interface but I'm open to other
suggestions.

Cheers,

Richard


  parent reply	other threads:[~2006-04-24 16:05 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-19 19:53 [RFC] [PATCH] Make ACPI button driver an input device Matthew Garrett
2006-04-19 20:04 ` Dominik Brodowski
2006-04-19 20:24   ` Matthew Garrett
2006-04-24 14:45     ` Dmitry Torokhov
2006-04-24 15:10       ` Matthew Garrett
2006-04-24 16:05       ` Richard Purdie [this message]
2006-04-24 16:26         ` Dmitry Torokhov
2006-04-24 17:05           ` Richard Purdie
2006-04-24 20:34             ` Pavel Machek
2006-04-24 20:59               ` Richard Purdie
2006-04-24 21:29                 ` Pavel Machek
2006-04-24 20:20         ` Pavel Machek
2006-04-20 21:56 ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2006-04-20  5:45 Yu, Luming
2006-04-20  7:37 ` Matthew Garrett
2006-04-20 15:35   ` Alexey Starikovskiy
2006-04-20 15:38     ` Matthew Garrett
2006-04-20 15:57       ` Alexey Starikovskiy
2006-04-20 16:11         ` Xavier Bestel
2006-04-20 16:33           ` Alexey Starikovskiy
2006-04-20 16:44             ` Matthew Garrett
2006-04-20 16:47               ` Alexey Starikovskiy
2006-04-20 16:55                 ` Matthew Garrett
2006-04-20 17:06                   ` Alexey Starikovskiy
2006-04-20 22:03                     ` Pavel Machek
2006-04-20 19:30             ` Dmitry Torokhov
2006-04-20 20:07               ` Xavier Bestel
2006-04-21  8:52                 ` Alexey Starikovskiy
2006-04-20 22:04                   ` Pavel Machek
2006-04-21 12:56                   ` Dmitry Torokhov
2006-04-20 22:01             ` Pavel Machek
2006-04-22 20:59             ` David Weinehall
2006-04-20 16:15         ` Matthew Garrett
2006-04-20 16:28           ` Alexey Starikovskiy
2006-04-20 16:32             ` Matthew Garrett
2006-04-20 16:35               ` Alexey Starikovskiy
2006-04-20 16:45                 ` Matthew Garrett
2006-04-20 22:10                 ` Pavel Machek
2006-04-20 16:58         ` Martin Mares
2006-04-20 17:08           ` Alexey Starikovskiy
2006-04-20 22:07             ` Pavel Machek
2006-04-24  6:54               ` Alexey Starikovskiy
2006-04-24  8:31                 ` Pavel Machek
2006-04-24 14:39                   ` Alexey Starikovskiy
2006-04-24 15:09                     ` Matthew Garrett
2006-04-28 17:43                     ` Stefan Seyfried
2006-04-21  7:27 Yu, Luming
2006-04-20 21:55 ` Pavel Machek
2006-04-24 14:51   ` Dmitry Torokhov
2006-04-21 11:37 ` Martin Mares
2006-04-21 12:21 ` Dmitry Torokhov
2006-04-25 14:17 Yu, Luming

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=1145894731.7155.120.camel@localhost.localdomain \
    --to=rpurdie@rpsys.net \
    --cc=dtor_core@ameritech.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=mjg59@srcf.ucam.org \
    --cc=pavel@suse.cz \
    /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