diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2008-01-08 10:02:51 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-02-01 22:26:08 -0500 |
commit | 3b64b51d20d9b633bb2efe63af785a49f8092898 (patch) | |
tree | c03ff90f8fca9821d068f1b315e6a6685829de10 /drivers/misc/thinkpad_acpi.c | |
parent | 083f17606f624c79555e313d87cf37ac1486b073 (diff) |
ACPI: thinkpad-acpi: cleanup hotkey_notify and HKEY log messages
Use a generic message on hotkey_notify to log unknown and unhandled events,
and cleanup hotkey_notify a little.
Also, document event 0x5010 (brightness changed notification) and do not
log it as an unknown event (even if we do not use it for anything right
now).
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/thinkpad_acpi.c')
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index c6c25a460c9c..f5f306ae4413 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -2007,6 +2007,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) | |||
2007 | unsigned int scancode; | 2007 | unsigned int scancode; |
2008 | int send_acpi_ev; | 2008 | int send_acpi_ev; |
2009 | int ignore_acpi_ev; | 2009 | int ignore_acpi_ev; |
2010 | int unk_ev; | ||
2010 | 2011 | ||
2011 | if (event != 0x80) { | 2012 | if (event != 0x80) { |
2012 | printk(TPACPI_ERR | 2013 | printk(TPACPI_ERR |
@@ -2030,8 +2031,9 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) | |||
2030 | return; | 2031 | return; |
2031 | } | 2032 | } |
2032 | 2033 | ||
2033 | send_acpi_ev = 0; | 2034 | send_acpi_ev = 1; |
2034 | ignore_acpi_ev = 0; | 2035 | ignore_acpi_ev = 0; |
2036 | unk_ev = 0; | ||
2035 | 2037 | ||
2036 | switch (hkey >> 12) { | 2038 | switch (hkey >> 12) { |
2037 | case 1: | 2039 | case 1: |
@@ -2041,33 +2043,34 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) | |||
2041 | scancode--; | 2043 | scancode--; |
2042 | if (!(hotkey_source_mask & (1 << scancode))) { | 2044 | if (!(hotkey_source_mask & (1 << scancode))) { |
2043 | tpacpi_input_send_key(scancode); | 2045 | tpacpi_input_send_key(scancode); |
2046 | send_acpi_ev = 0; | ||
2044 | } else { | 2047 | } else { |
2045 | ignore_acpi_ev = 1; | 2048 | ignore_acpi_ev = 1; |
2046 | } | 2049 | } |
2047 | } else { | 2050 | } else { |
2048 | printk(TPACPI_ERR | 2051 | unk_ev = 1; |
2049 | "hotkey 0x%04x out of range " | ||
2050 | "for keyboard map\n", hkey); | ||
2051 | send_acpi_ev = 1; | ||
2052 | } | 2052 | } |
2053 | break; | 2053 | break; |
2054 | case 5: | 2054 | case 5: |
2055 | /* 0x5000-0x5FFF: LID */ | 2055 | /* 0x5000-0x5FFF: On screen display helpers */ |
2056 | /* we don't handle it through this path, just | 2056 | switch (hkey) { |
2057 | * eat up known LID events */ | 2057 | case 0x5010: |
2058 | if (hkey != 0x5001 && hkey != 0x5002) { | 2058 | /* Lenovo Vista BIOS: brightness changed */ |
2059 | printk(TPACPI_ERR | 2059 | break; |
2060 | "unknown LID-related HKEY event: " | 2060 | case 0x5001: |
2061 | "0x%04x\n", hkey); | 2061 | case 0x5002: |
2062 | send_acpi_ev = 1; | 2062 | /* LID switch events. Do not propagate */ |
2063 | } else { | ||
2064 | ignore_acpi_ev = 1; | 2063 | ignore_acpi_ev = 1; |
2064 | break; | ||
2065 | default: | ||
2066 | unk_ev = 1; | ||
2065 | } | 2067 | } |
2066 | break; | 2068 | break; |
2067 | case 7: | 2069 | case 7: |
2068 | /* 0x7000-0x7FFF: misc */ | 2070 | /* 0x7000-0x7FFF: misc */ |
2069 | if (tp_features.hotkey_wlsw && hkey == 0x7000) { | 2071 | if (tp_features.hotkey_wlsw && hkey == 0x7000) { |
2070 | tpacpi_input_send_radiosw(); | 2072 | tpacpi_input_send_radiosw(); |
2073 | send_acpi_ev = 0; | ||
2071 | break; | 2074 | break; |
2072 | } | 2075 | } |
2073 | /* fallthrough to default */ | 2076 | /* fallthrough to default */ |
@@ -2078,9 +2081,11 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) | |||
2078 | /* case 3: ultra-bay related. maybe bay in dock? */ | 2081 | /* case 3: ultra-bay related. maybe bay in dock? */ |
2079 | /* 0x3003 - T43 after wake up by bay lever | 2082 | /* 0x3003 - T43 after wake up by bay lever |
2080 | * eject (0x2305) */ | 2083 | * eject (0x2305) */ |
2084 | unk_ev = 1; | ||
2085 | } | ||
2086 | if (unk_ev) { | ||
2081 | printk(TPACPI_NOTICE | 2087 | printk(TPACPI_NOTICE |
2082 | "unhandled HKEY event 0x%04x\n", hkey); | 2088 | "unhandled HKEY event 0x%04x\n", hkey); |
2083 | send_acpi_ev = 1; | ||
2084 | } | 2089 | } |
2085 | 2090 | ||
2086 | /* Legacy events */ | 2091 | /* Legacy events */ |