aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2008-02-15 23:17:52 -0500
committerLen Brown <len.brown@intel.com>2008-02-16 00:33:55 -0500
commit1bc6b9cdd5e608f0b7e6160a823c9dcd51820410 (patch)
tree1d31c139086540603c1c6ba13406e12fc518ad7e /drivers/misc
parent5f24927f48c63e79ff8e286fc8530f4525b4182a (diff)
ACPI: thinkpad-acpi: always track input device open/close
The open() and close() hooks for the input device are useful even when hotkey NVRAM polling support is not in use, so it is better to always have them around. 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')
-rw-r--r--drivers/misc/thinkpad_acpi.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 723d37b9e6a2..6da3f40ac9f6 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -1417,6 +1417,14 @@ static void hotkey_poll_setup_safe(int may_warn)
1417 mutex_unlock(&hotkey_mutex); 1417 mutex_unlock(&hotkey_mutex);
1418} 1418}
1419 1419
1420#else /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
1421
1422static void hotkey_poll_setup_safe(int __unused)
1423{
1424}
1425
1426#endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
1427
1420static int hotkey_inputdev_open(struct input_dev *dev) 1428static int hotkey_inputdev_open(struct input_dev *dev)
1421{ 1429{
1422 switch (tpacpi_lifecycle) { 1430 switch (tpacpi_lifecycle) {
@@ -1444,7 +1452,6 @@ static void hotkey_inputdev_close(struct input_dev *dev)
1444 if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING) 1452 if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING)
1445 hotkey_poll_setup_safe(0); 1453 hotkey_poll_setup_safe(0);
1446} 1454}
1447#endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
1448 1455
1449/* sysfs hotkey enable ------------------------------------------------- */ 1456/* sysfs hotkey enable ------------------------------------------------- */
1450static ssize_t hotkey_enable_show(struct device *dev, 1457static ssize_t hotkey_enable_show(struct device *dev,
@@ -2023,12 +2030,10 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
2023 (hotkey_report_mode < 2) ? 2030 (hotkey_report_mode < 2) ?
2024 "enabled" : "disabled"); 2031 "enabled" : "disabled");
2025 2032
2026#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
2027 tpacpi_inputdev->open = &hotkey_inputdev_open; 2033 tpacpi_inputdev->open = &hotkey_inputdev_open;
2028 tpacpi_inputdev->close = &hotkey_inputdev_close; 2034 tpacpi_inputdev->close = &hotkey_inputdev_close;
2029 2035
2030 hotkey_poll_setup_safe(1); 2036 hotkey_poll_setup_safe(1);
2031#endif
2032 } 2037 }
2033 2038
2034 return (tp_features.hotkey)? 0 : 1; 2039 return (tp_features.hotkey)? 0 : 1;
@@ -2221,9 +2226,7 @@ static void hotkey_resume(void)
2221 hotkey_radio_sw_notify_change(); 2226 hotkey_radio_sw_notify_change();
2222 hotkey_wakeup_reason_notify_change(); 2227 hotkey_wakeup_reason_notify_change();
2223 hotkey_wakeup_hotunplug_complete_notify_change(); 2228 hotkey_wakeup_hotunplug_complete_notify_change();
2224#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
2225 hotkey_poll_setup_safe(0); 2229 hotkey_poll_setup_safe(0);
2226#endif
2227} 2230}
2228 2231
2229/* procfs -------------------------------------------------------------- */ 2232/* procfs -------------------------------------------------------------- */