X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH 1/2] msi-wmi: Add mute key support
@ 2010-11-18 12:00 Anisse Astier
  2010-11-18 12:00 ` [PATCH 2/2] msi-wmi: fix semantically incorrect use of keycode instead of scancode Anisse Astier
  2010-11-24 16:52 ` [PATCH 1/2] msi-wmi: Add mute key support Matthew Garrett
  0 siblings, 2 replies; 3+ messages in thread
From: Anisse Astier @ 2010-11-18 12:00 UTC (permalink / raw)
  To: platform-driver-x86; +Cc: Matthew Garrett, Anisse Astier, Mark Huijgen

Add new MUTE key seen on Medion Akoya AIO PC P4010D using MSI motherboard
(Product Name: MS-7621)

Reported-and-tested-by: Mark Huijgen <mark.sf.net@huijgen.tk>
Signed-off-by: Anisse Astier <anisse@astier.eu>
---
 drivers/platform/x86/msi-wmi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c
index 42a5469..bde607d 100644
--- a/drivers/platform/x86/msi-wmi.c
+++ b/drivers/platform/x86/msi-wmi.c
@@ -48,11 +48,13 @@ MODULE_ALIAS("wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2");
 #define MSI_WMI_BRIGHTNESSDOWN (KEYCODE_BASE + 1)
 #define MSI_WMI_VOLUMEUP       (KEYCODE_BASE + 2)
 #define MSI_WMI_VOLUMEDOWN     (KEYCODE_BASE + 3)
+#define MSI_WMI_MUTE           (KEYCODE_BASE + 4)
 static struct key_entry msi_wmi_keymap[] = {
 	{ KE_KEY, MSI_WMI_BRIGHTNESSUP,   {KEY_BRIGHTNESSUP} },
 	{ KE_KEY, MSI_WMI_BRIGHTNESSDOWN, {KEY_BRIGHTNESSDOWN} },
 	{ KE_KEY, MSI_WMI_VOLUMEUP,       {KEY_VOLUMEUP} },
 	{ KE_KEY, MSI_WMI_VOLUMEDOWN,     {KEY_VOLUMEDOWN} },
+	{ KE_KEY, MSI_WMI_MUTE,           {KEY_MUTE} },
 	{ KE_END, 0}
 };
 static ktime_t last_pressed[ARRAY_SIZE(msi_wmi_keymap) - 1];
-- 
1.7.0.6

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

* [PATCH 2/2] msi-wmi: fix semantically incorrect use of keycode instead of scancode
  2010-11-18 12:00 [PATCH 1/2] msi-wmi: Add mute key support Anisse Astier
@ 2010-11-18 12:00 ` Anisse Astier
  2010-11-24 16:52 ` [PATCH 1/2] msi-wmi: Add mute key support Matthew Garrett
  1 sibling, 0 replies; 3+ messages in thread
From: Anisse Astier @ 2010-11-18 12:00 UTC (permalink / raw)
  To: platform-driver-x86; +Cc: Matthew Garrett, Anisse Astier

I didn't know the difference between the two when I wrote this code in
commit c30116c6f0d26cd6e46dfa578163d573ef4730b2.

Signed-off-by: Anisse Astier <anisse@astier.eu>
---
 drivers/platform/x86/msi-wmi.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c
index bde607d..35278ad 100644
--- a/drivers/platform/x86/msi-wmi.c
+++ b/drivers/platform/x86/msi-wmi.c
@@ -43,12 +43,12 @@ MODULE_ALIAS("wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2");
 
 #define dprintk(msg...) pr_debug(DRV_PFX msg)
 
-#define KEYCODE_BASE 0xD0
-#define MSI_WMI_BRIGHTNESSUP   KEYCODE_BASE
-#define MSI_WMI_BRIGHTNESSDOWN (KEYCODE_BASE + 1)
-#define MSI_WMI_VOLUMEUP       (KEYCODE_BASE + 2)
-#define MSI_WMI_VOLUMEDOWN     (KEYCODE_BASE + 3)
-#define MSI_WMI_MUTE           (KEYCODE_BASE + 4)
+#define SCANCODE_BASE 0xD0
+#define MSI_WMI_BRIGHTNESSUP   SCANCODE_BASE
+#define MSI_WMI_BRIGHTNESSDOWN (SCANCODE_BASE + 1)
+#define MSI_WMI_VOLUMEUP       (SCANCODE_BASE + 2)
+#define MSI_WMI_VOLUMEDOWN     (SCANCODE_BASE + 3)
+#define MSI_WMI_MUTE           (SCANCODE_BASE + 4)
 static struct key_entry msi_wmi_keymap[] = {
 	{ KE_KEY, MSI_WMI_BRIGHTNESSUP,   {KEY_BRIGHTNESSUP} },
 	{ KE_KEY, MSI_WMI_BRIGHTNESSDOWN, {KEY_BRIGHTNESSDOWN} },
@@ -171,7 +171,7 @@ static void msi_wmi_notify(u32 value, void *context)
 			ktime_t diff;
 			cur = ktime_get_real();
 			diff = ktime_sub(cur, last_pressed[key->code -
-					KEYCODE_BASE]);
+					SCANCODE_BASE]);
 			/* Ignore event if the same event happened in a 50 ms
 			   timeframe -> Key press may result in 10-20 GPEs */
 			if (ktime_to_us(diff) < 1000 * 50) {
@@ -180,7 +180,7 @@ static void msi_wmi_notify(u32 value, void *context)
 					 key->code, ktime_to_us(diff));
 				return;
 			}
-			last_pressed[key->code - KEYCODE_BASE] = cur;
+			last_pressed[key->code - SCANCODE_BASE] = cur;
 
 			if (key->type == KE_KEY &&
 			/* Brightness is served via acpi video driver */
-- 
1.7.0.6

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

* Re: [PATCH 1/2] msi-wmi: Add mute key support
  2010-11-18 12:00 [PATCH 1/2] msi-wmi: Add mute key support Anisse Astier
  2010-11-18 12:00 ` [PATCH 2/2] msi-wmi: fix semantically incorrect use of keycode instead of scancode Anisse Astier
@ 2010-11-24 16:52 ` Matthew Garrett
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Garrett @ 2010-11-24 16:52 UTC (permalink / raw)
  To: Anisse Astier; +Cc: platform-driver-x86, Mark Huijgen

Applied both of these, thanks

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

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

end of thread, other threads:[~2010-11-24 16:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18 12:00 [PATCH 1/2] msi-wmi: Add mute key support Anisse Astier
2010-11-18 12:00 ` [PATCH 2/2] msi-wmi: fix semantically incorrect use of keycode instead of scancode Anisse Astier
2010-11-24 16:52 ` [PATCH 1/2] msi-wmi: Add mute key support Matthew Garrett

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