public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thinkpad-acpi: setup hotkey polling after changing hotkey_driver_mask
@ 2010-02-07 18:32 Thadeu Lima de Souza Cascardo
  2010-02-08 23:50 ` Andrew Morton
  2010-02-09  0:37 ` Henrique de Moraes Holschuh
  0 siblings, 2 replies; 10+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2010-02-07 18:32 UTC (permalink / raw)
  To: linux-acpi
  Cc: Thadeu Lima de Souza Cascardo, Henrique de Moraes Holschuh,
	ibm-acpi-devel, linux-kernel

Brightness notification does not work until the user writes to
hotkey_mask attribute. That's because the polling thread will only run
if hotkey_user_mask is set and someone is reading the input device or if
hotkey_driver_mask is set. In this second case, this condition is not
tested after the mask is changed, because the brightness and volume
drivers are started after the hotkey drivers.

This fix test for the polling condition that ends up starting the
polling thread after hotkey_driver_mask is set in brightness and volume
init functions.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
---
 drivers/platform/x86/thinkpad_acpi.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e67e4fe..d69749d 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6272,6 +6272,11 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
 	tpacpi_hotkey_driver_mask_set(hotkey_driver_mask
 				| TP_ACPI_HKEY_BRGHTUP_MASK
 				| TP_ACPI_HKEY_BRGHTDWN_MASK);;
+
+#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
+	hotkey_poll_setup(true);
+#endif
+
 	return 0;
 }
 
@@ -6903,6 +6908,10 @@ static int __init volume_init(struct ibm_init_struct *iibm)
 			| TP_ACPI_HKEY_VOLDWN_MASK
 			| TP_ACPI_HKEY_MUTE_MASK);
 
+#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
+	hotkey_poll_setup(true);
+#endif
+
 	return 0;
 }
 
-- 
1.6.6.1


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

end of thread, other threads:[~2010-02-10  1:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-07 18:32 [PATCH] thinkpad-acpi: setup hotkey polling after changing hotkey_driver_mask Thadeu Lima de Souza Cascardo
2010-02-08 23:50 ` Andrew Morton
2010-02-09  0:08   ` Thadeu Lima de Souza Cascardo
2010-02-09  0:21     ` Andrew Morton
2010-02-09  0:31       ` Thadeu Lima de Souza Cascardo
2010-02-09  0:38         ` Henrique de Moraes Holschuh
2010-02-09  0:37 ` Henrique de Moraes Holschuh
2010-02-09  1:37   ` Henrique de Moraes Holschuh
2010-02-10  0:16     ` Thadeu Lima de Souza Cascardo
2010-02-10  1:28       ` Henrique de Moraes Holschuh

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