RE: generic hotkey driver

Yu, Luming
2004-09-08T15:42:09Z

>> We don't need to care about the format of event. Since it is
>> configurable,
>> we just need to understand the internal meaning. So maybe we
>> need to define the internal event number, which stands for a
>> special purpose. such as:
>>
>> 001 turn off display
>> 002 inc brightness
>> 003 dec brightness
>> 004 s3
>> ......
>
>Hmm, ASUS laptops support some 16 distinct events, I don't see your
>solution maintainable.
>

Hmm, I will maintain a table internally, which will keep the mapping
between
the raw event value with the standard internal event num. If the raw
event value
cannot be mapped to any known standard event num, then the user can
treat
it as extended event. The entry could be:

struct raw_value_2_event {
int raw_event_number;
int standard_event;
int raw_event_flags;
ACTION_LIST *AML_METHOD;
}

The user or init script can input the mapping against the actual laptop
through
the interface:
/proc/acpi/hotkey/config/raw_event_mapping

To register expected acpi_handle which is needed to install
notify handler, which will generate event through /proc/acpi/event for
acpid.
we can input AML pathname on which driver will generate event
when get notified in AML method, like Notify( VGA, 0x80), through

/proc/acpi/hotkey/config/bus_notify

To register polling methods which will generate pseudo event, we can
input the expected AML methods pathname through
/proc/acpi/hotkey/config/pulling_method

Each successful pull will generate a event through /proc/acpi/event to
notify user land to get pulling data from /proc/acpi/hotkey/pulling_data
And the userland daemon will interpret the actual meaning of the raw
data.

To register the AML methods that should be executed , with
respect to the hotkey get pressed. we can input AML pathname through
/proc/acpi/hotkey/config/event_action.

When userland daemon received a event, the daemon just need to feed
/proc/acpi/hotkey/action_argument with the proper argument string.
A "" means no argument is need for the method.

This is just a rough idea.

Thanks,
Luming

-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.