public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hp-wmi: set initial docking state
@ 2009-01-26 14:36 Frans Pop
  2009-01-26 14:38 ` Matthew Garrett
  0 siblings, 1 reply; 2+ messages in thread
From: Frans Pop @ 2009-01-26 14:36 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Matthew Garrett, Andrew Morton

If the initial state is not set when the input device is set up, the
first docking event after the module is loaded will be lost.
    
Signed-off-by: Frans Pop <elendil@planet.nl>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
---
Patch is based on what is done for the LID switch in drivers/acpi/button.c 
and has been tested on my HP 2510p.

As this is a (minor) bug fix, it would be nice to have it in 2.6.29.

Cheers,
FJP

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 7c789f0..8aaff0c 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -382,6 +382,11 @@ static int __init hp_wmi_input_setup(void)
 		case KE_SW:
 			set_bit(EV_SW, hp_wmi_input_dev->evbit);
 			set_bit(key->keycode, hp_wmi_input_dev->swbit);
+
+			/* Set initial dock state */
+			input_report_switch(hp_wmi_input_dev, key->keycode,
+					    hp_wmi_dock_state());
+			input_sync(hp_wmi_input_dev);
 			break;
 		}
 	}

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

* Re: [PATCH] hp-wmi: set initial docking state
  2009-01-26 14:36 [PATCH] hp-wmi: set initial docking state Frans Pop
@ 2009-01-26 14:38 ` Matthew Garrett
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Garrett @ 2009-01-26 14:38 UTC (permalink / raw)
  To: Frans Pop; +Cc: Linux Kernel Mailing List, Andrew Morton, linux-acpi

On Mon, Jan 26, 2009 at 03:36:01PM +0100, Frans Pop wrote:
> If the initial state is not set when the input device is set up, the
> first docking event after the module is loaded will be lost.
>     
> Signed-off-by: Frans Pop <elendil@planet.nl>
> Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Acked-by: Matthew Garrett <mjg@redhat.com>

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

end of thread, other threads:[~2009-01-26 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-26 14:36 [PATCH] hp-wmi: set initial docking state Frans Pop
2009-01-26 14:38 ` Matthew Garrett

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