mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 12:20:52 +07:00
[ACPI] generic Hot Key support
See Documentation/acpi-hotkey.txt Use cmdline "acpi_specific_hotkey" to enable legacy platform specific drivers. http://bugzilla.kernel.org/show_bug.cgi?id=3887 Signed-off-by: Luming Yu <luming.yu@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
d58da59045
commit
fb9802fa59
35
Documentation/acpi-hotkey.txt
Normal file
35
Documentation/acpi-hotkey.txt
Normal file
@ -0,0 +1,35 @@
|
||||
driver/acpi/hotkey.c implement:
|
||||
1. /proc/acpi/hotkey/event_config
|
||||
(event based hotkey or event config interface):
|
||||
a. add a event based hotkey(event) :
|
||||
echo "0:bus::action:method:num:num" > event_config
|
||||
|
||||
b. delete a event based hotkey(event):
|
||||
echo "1:::::num:num" > event_config
|
||||
|
||||
c. modify a event based hotkey(event):
|
||||
echo "2:bus::action:method:num:num" > event_config
|
||||
|
||||
2. /proc/acpi/hotkey/poll_config
|
||||
(polling based hotkey or event config interface):
|
||||
a.add a polling based hotkey(event) :
|
||||
echo "0:bus:method:action:method:num" > poll_config
|
||||
this adding command will create a proc file
|
||||
/proc/acpi/hotkey/method, which is used to get
|
||||
result of polling.
|
||||
|
||||
b.delete a polling based hotkey(event):
|
||||
echo "1:::::num" > event_config
|
||||
|
||||
c.modify a polling based hotkey(event):
|
||||
echo "2:bus:method:action:method:num" > poll_config
|
||||
|
||||
3./proc/acpi/hotkey/action
|
||||
(interface to call aml method associated with a
|
||||
specific hotkey(event))
|
||||
echo "event_num:event_type:event_argument" >
|
||||
/proc/acpi/hotkey/action.
|
||||
The result of the execution of this aml method is
|
||||
attached to /proc/acpi/hotkey/poll_method, which is dnyamically
|
||||
created. Please use command "cat /proc/acpi/hotkey/polling_method"
|
||||
to retrieve it.
|
@ -123,6 +123,15 @@ config ACPI_VIDEO
|
||||
Note that this is an ref. implementation only. It may or may not work
|
||||
for your integrated video device.
|
||||
|
||||
config ACPI_HOTKEY
|
||||
tristate "Generic Hotkey"
|
||||
depends on ACPI_INTERPRETER
|
||||
depends on EXPERIMENTAL
|
||||
depends on !IA64_SGI_SN
|
||||
default m
|
||||
help
|
||||
ACPI generic hotkey
|
||||
|
||||
config ACPI_FAN
|
||||
tristate "Fan"
|
||||
depends on !IA64_SGI_SN
|
||||
|
@ -42,7 +42,8 @@ obj-$(CONFIG_ACPI_BATTERY) += battery.o
|
||||
obj-$(CONFIG_ACPI_BUTTON) += button.o
|
||||
obj-$(CONFIG_ACPI_EC) += ec.o
|
||||
obj-$(CONFIG_ACPI_FAN) += fan.o
|
||||
obj-$(CONFIG_ACPI_VIDEO) += video.o
|
||||
obj-$(CONFIG_ACPI_VIDEO) += video.o
|
||||
obj-$(CONFIG_ACPI_HOTKEY) += hotkey.o
|
||||
obj-$(CONFIG_ACPI_PCI) += pci_root.o pci_link.o pci_irq.o pci_bind.o
|
||||
obj-$(CONFIG_ACPI_POWER) += power.o
|
||||
obj-$(CONFIG_ACPI_PROCESSOR) += processor.o
|
||||
|
@ -1204,6 +1204,10 @@ static int __init asus_acpi_init(void)
|
||||
if (acpi_disabled)
|
||||
return -ENODEV;
|
||||
|
||||
if (!acpi_specific_hotkey_enabled){
|
||||
printk(KERN_ERR "Using generic hotkey driver\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir);
|
||||
if (!asus_proc_dir) {
|
||||
printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n");
|
||||
|
1018
drivers/acpi/hotkey.c
Normal file
1018
drivers/acpi/hotkey.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -1185,6 +1185,10 @@ static int __init acpi_ibm_init(void)
|
||||
if (acpi_disabled)
|
||||
return -ENODEV;
|
||||
|
||||
if (!acpi_specific_hotkey_enabled){
|
||||
printk(IBM_ERR "Using generic hotkey driver\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
/* these handles are required */
|
||||
if (IBM_HANDLE_INIT(ec, 1) < 0 ||
|
||||
IBM_HANDLE_INIT(hkey, 1) < 0 ||
|
||||
|
@ -71,6 +71,9 @@ EXPORT_SYMBOL(acpi_in_debugger);
|
||||
extern char line_buf[80];
|
||||
#endif /*ENABLE_DEBUGGER*/
|
||||
|
||||
int acpi_specific_hotkey_enabled;
|
||||
EXPORT_SYMBOL(acpi_specific_hotkey_enabled);
|
||||
|
||||
static unsigned int acpi_irq_irq;
|
||||
static acpi_osd_handler acpi_irq_handler;
|
||||
static void *acpi_irq_context;
|
||||
@ -1152,6 +1155,15 @@ acpi_wake_gpes_always_on_setup(char *str)
|
||||
|
||||
__setup("acpi_wake_gpes_always_on", acpi_wake_gpes_always_on_setup);
|
||||
|
||||
int __init
|
||||
acpi_hotkey_setup(char *str)
|
||||
{
|
||||
acpi_specific_hotkey_enabled = TRUE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
__setup("acpi_specific_hotkey", acpi_hotkey_setup);
|
||||
|
||||
/*
|
||||
* max_cstate is defined in the base kernel so modules can
|
||||
* change it w/o depending on the state of the processor module.
|
||||
|
@ -529,6 +529,11 @@ toshiba_acpi_init(void)
|
||||
|
||||
if (acpi_disabled)
|
||||
return -ENODEV;
|
||||
|
||||
if (!acpi_specific_hotkey_enabled){
|
||||
printk(MY_INFO "Using generic hotkey driver\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
/* simple device detection: look for HCI method */
|
||||
if (is_valid_acpi_path(METHOD_HCI_1))
|
||||
method_hci = METHOD_HCI_1;
|
||||
|
@ -108,5 +108,10 @@ int acpi_ec_ecdt_probe (void);
|
||||
|
||||
int acpi_processor_set_thermal_limit(acpi_handle handle, int type);
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
Hot Keys
|
||||
-------------------------------------------------------------------------- */
|
||||
|
||||
extern int acpi_specific_hotkey_enabled;
|
||||
|
||||
#endif /*__ACPI_DRIVERS_H__*/
|
||||
|
Loading…
Reference in New Issue
Block a user