public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [gpm] Untangling the sleep hotkey mess
@ 2006-07-26 23:41 Brown, Len
  2006-07-26 23:52 ` Matthew Garrett
  2006-07-27  4:12 ` Dmitry Torokhov
  0 siblings, 2 replies; 34+ messages in thread
From: Brown, Len @ 2006-07-26 23:41 UTC (permalink / raw)
  To: Richard Hughes, Dmitry Torokhov
  Cc: Matthew Garrett, linux-acpi, gnome-power-manager-list, hal,
	desktop_portables

 
>> But input layer will be a hub of sorts and I am arguing for ACPI
>> to be converted to use input layer directly.
>
>What does lkml think of ACPI using the input layer directly? 

I think it is a good idea.

The only question I have is how to transition.
If I replace the acpi_bus_generate_event() calls for
power/sleep/lid/hotkeys
and replace them with input_report_key(), will there be something up
there
listening for these events when acpid does not get them?

thanks,
-Len

ps. the long term goal is to delete /proc/acpi, including
/proc/acpi/event.
Getting rid of the events that are like keys is a step in that
direction,
but there are a bunch of other steps for non key-like events too.

^ permalink raw reply	[flat|nested] 34+ messages in thread
* RE: [gpm] Untangling the sleep hotkey mess
@ 2006-08-31  1:49 Brown, Len
  2006-08-31  2:53 ` Dmitry Torokhov
  0 siblings, 1 reply; 34+ messages in thread
From: Brown, Len @ 2006-08-31  1:49 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Richard Hughes, Matthew Garrett, linux-acpi,
	gnome-power-manager-list, hal, desktop_portables

>> >> But input layer will be a hub of sorts and I am arguing for ACPI
>> >> to be converted to use input layer directly.
>> >
>> >What does lkml think of ACPI using the input layer directly? 
>> 
>> I think it is a good idea.
>> 
>> The only question I have is how to transition.
>> If I replace the acpi_bus_generate_event() calls for
>> power/sleep/lid/hotkeys
>> and replace them with input_report_key(), will there be something up
>> there
>> listening for these events when acpid does not get them?
>> 
>
>Let's start with adding reporting through input layer while still
>reporintg through /proc/acpi/event, this will allow gradual transition.
>
>What do you think about the patch below (should be applied on top of
>cleanup patch which is attached)? I will need to adjust it to
>!CONFIG_INPUT, but it can be done later if we agree on principle.

sorry for the delayed response -- looks like this one arrived at the
tail end of the ottawa trip...

I agree with this patch in principle.
it would be good to cut over to handing the power/sleep/lid buttons
as input device sooner rather than later.  Hopefully we don't get
all confused with double reporting of the events and can do one
or the other in user-space.

I don't understand some parts of the diff, including why the LID
event is always assumed to be an open event, and some of the diff
seemed to be moving code around and I wasn't clear on why.

thanks,
-Len

^ permalink raw reply	[flat|nested] 34+ messages in thread
* RE: [gpm] Untangling the sleep hotkey mess
@ 2006-01-09  1:37 Yu, Luming
  2006-01-09  1:43 ` Matthew Garrett
  0 siblings, 1 reply; 34+ messages in thread
From: Yu, Luming @ 2006-01-09  1:37 UTC (permalink / raw)
  To: Richard Hughes
  Cc: Matthew Garrett, linux-acpi-u79uwXL29TY76Z2rM5mHXA,
	gnome-power-manager-list-rDKQcyrBJuzYtjvyW6yDsg,
	hal-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	desktop_portables-qjLDD68F18O7TbgM5vRIOg

 

>-----Original Message-----
>From: Richard Hughes [mailto:hughsient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org] 
>Sent: 2006年1月9日 9:22
>To: Yu, Luming
>Cc: Matthew Garrett; linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; 
>gnome-power-manager-list-rDKQcyrBJuzYtjvyW6yDsg@public.gmane.org; hal-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; 
>desktop_portables-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
>Subject: Re: [gpm] Untangling the sleep hotkey mess
>
>On Mon, 2006-01-09 at 09:10 +0800, Yu Luming wrote:
>> >  3. Use the new acpi kernel hotkeys stuff -- not that I 
>really understand
>> >  the interface, nor how to use it correctly. Plus I'm not 
>sure how much
>> >  of the vendor kernel modules can use this new interface, 
>or if it's
>> >  suitable. It all seemed a bit fragile last time I looked.
>> 
>> Please take a look at 
>> http://bugzilla.kernel.org/show_bug.cgi?id=5749
>> 
>> There are some examples to use hotkey.c for specific laptops 
>with dedicated
>> hotkey acpi device objects , and dedicated AML methods.
>> This patch: http://bugzilla.kernel.org/show_bug.cgi?id=5749#c3
>> can be used to replace sony_acpi.c
>> 
>> This patch: http://bugzilla.kernel.org/show_bug.cgi?id=5749#c4
>> can be used to support brightness control for panasonic laptop.
>> 
>> This patch: http://bugzilla.kernel.org/show_bug.cgi?id=5749#c5
>> can be used to support brighness contrl for ASUS laptop.
>> 
>> Please notes, I will update these patch against len's 
>testing tree, and 
>> ask for inclusion.
>
>Why do we want to use the new hotkey stuff when we can just process all
>the events in userspace using acpi events? The hotkey stuff seems
>overcomplicated and fragile in my opinion.
>
>Sending and receiving :::data:in:some::odd:format seems a 
>little unusual
>to me when we can just listen for the event in one place (like HAL) --
>but then maybe I don't understand all the details. It's not 
>like we will
>have different programs registering for different acpi button events,
>right?

The hotkey.c is NOT like what you said above.
It is used to support dedicated hotkey device and dedicated hotkey AML methods
that are used by ODM to implement hotkey function on their own laptops.
As for hotkey event, hotkey.c doesn't handle it yet.  
And so-called event_num in hotkey.c are mainly used as a key for searching and storing.
 
>
>Richard.
>
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 34+ messages in thread
* Untangling the sleep hotkey mess
@ 2006-01-07 17:24 Matthew Garrett
  2006-01-08 12:58 ` [gpm] " Richard Hughes
  0 siblings, 1 reply; 34+ messages in thread
From: Matthew Garrett @ 2006-01-07 17:24 UTC (permalink / raw)
  To: linux-acpi-u79uwXL29TY76Z2rM5mHXA,
	gnome-power-manager-list-rDKQcyrBJuzYtjvyW6yDsg,
	hal-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	desktop_portables-qjLDD68F18O7TbgM5vRIOg

Currently, there are three ways that a sleep hotkey may generate an 
event:

1) Exposed in DSDT as an ACPI object, generates an ACPI notification 
event (the "normal" way)

2) Uses hardware-specific ACPI driver, generates an ACPI notification 
event. Not exposed in the DSDT in any standard way (ibm-acpi, 
toshiba-acpi, panasonic-acpi)

3) Generates a scancode, which is picked up by the kernel and turned 
into a keycode (HP laptops work like this)

This is all quite horribly confusing, and makes life miserable for 
userspace. I would like to suggest the following standardisation:

a) Hal should assume that all hardware has a sleep key, since there's no 
way to actually tell.

b) Events generated in cases (1) and (2) should, for now, be caught by 
acpid (or something similar) and then fed back into the input layer via 
uinput. This should be scancode 142, which will end up as X keycode 223.

c) Most keyboards in case (3) will already send scancode 142. For 
laptops, those that shouldn't should be remapped at boot time by 
checking the system DMI information and consulting a lookup table.

Rationale:

Having one type of event rather than three makes it easier for userspace 
coders. Choosing to do it through the input layer lets people take 
advantage of pre-existing code for binding userspace events to keyboard 
events, and is significantly easier to do than getting keyboard events 
back to the ACPI layer. Keycode 142 is chosen because it's what 
Microsoft uses, and so most manufacturers who have taken this approach 
have copied them.

Future:

1) OSDL have just set up a mailing list 
(desktop_portables-qjLDD68F18O7TbgM5vRIOg@public.gmane.org) for discussion of userspace and 
laptop interaction. Can I encourage people who are interested in 
hammering out cross-distribution solutions to problems like this to 
subscribe?

2) /usr/include/linux/input.h defines two keycodes for suspend-type 
behaviour: KEY_SLEEP (scancode 142) and KEY_SUSPEND (scancode 205). I'd 
like to propose using the second of these for keys that trigger suspend 
to disk. There's much less standardisation here, though, so I'd be 
interested in hearing what other people think.

-- 
Matthew Garrett | mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2006-09-18 17:53 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-26 23:41 [gpm] Untangling the sleep hotkey mess Brown, Len
2006-07-26 23:52 ` Matthew Garrett
2006-07-27  4:12 ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2006-08-31  1:49 Brown, Len
2006-08-31  2:53 ` Dmitry Torokhov
2006-08-31  3:03   ` Len Brown
     [not found]     ` <200608302303.38458.len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2006-08-31  3:07       ` Dmitry Torokhov
2006-09-18  7:55         ` Richard Hughes
     [not found]           ` <1158566150.2332.14.camel-Qvr7v16j6+Ap96r9Hs7rR1Kr0EmMEXJSn9A1Ff6Mc9Q@public.gmane.org>
2006-09-18 15:17             ` Dmitry Torokhov
2006-09-18 17:52               ` Richard Hughes
2006-01-09  1:37 Yu, Luming
2006-01-09  1:43 ` Matthew Garrett
     [not found]   ` <20060109014350.GA672-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2006-01-09  2:19     ` Yu Luming
     [not found]       ` <200601091019.01083.luming.yu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2006-01-09  2:30         ` Matthew Garrett
     [not found]           ` <20060109023037.GA1316-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2006-01-09  3:13             ` Yu Luming
     [not found]               ` <200601091113.16092.luming.yu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2006-01-09  3:27                 ` Matthew Garrett
     [not found]                   ` <20060109032717.GA2238-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2006-01-09  3:55                     ` Yu Luming
     [not found]                       ` <200601091155.24380.luming.yu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2006-01-09  4:07                         ` Matthew Garrett
2006-01-09 10:04             ` Richard Hughes
2006-01-09 21:14               ` Dmitry Torokhov
     [not found]               ` <d120d5000601091314g7cef73fk445976b14c549a04@mail.gmail.com>
2006-01-09 21:40                 ` Matthew Garrett
     [not found]                 ` <20060109214050.GA19974@srcf.ucam.org>
2006-01-09 21:52                   ` Dmitry Torokhov
     [not found]                   ` <d120d5000601091352m19ba5eb0n80c462cba49bd2a6@mail.gmail.com>
     [not found]                     ` <d120d5000601091352m19ba5eb0n80c462cba49bd2a6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2006-01-09 22:04                       ` Matthew Garrett
2006-01-07 17:24 Matthew Garrett
2006-01-08 12:58 ` [gpm] " Richard Hughes
2006-01-08 13:47   ` Matthew Garrett
     [not found]     ` <20060108134744.GA21538-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2006-01-08 14:13       ` Richard Hughes
2006-01-09  1:10         ` Yu Luming
2006-01-09  1:21           ` Richard Hughes
2006-01-09  1:14         ` Richard Hughes
2006-01-09  5:07           ` Dmitry Torokhov
     [not found]             ` <20060109052407.GA4213@srcf.ucam.org>
     [not found]               ` <20060109052407.GA4213-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
2006-01-09  6:09                 ` Dmitry Torokhov
     [not found]                   ` <200601090109.05791.dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
2006-01-09  9:44                     ` Richard Hughes
     [not found]             ` <200601090007.43578.dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
2006-01-09  5:24               ` Matthew Garrett
2006-01-09  9:43               ` Richard Hughes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox