All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] support wlan hotkey on Acer Travelmate 5735Z
@ 2011-05-24  8:35 Melchior FRANZ
  0 siblings, 0 replies; 3+ messages in thread
From: Melchior FRANZ @ 2011-05-24  8:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: Joey Lee, Carlos Corbacho, platform-driver-x86

From: Melchior FRANZ <mfranz@aon.at>
    
On an Acer Travelmate 5735Z-452G32Mnss the WLAN-enable/disable key
doesn't send 0x1 as acpi event key code, but 0x3. This patch also
makes the module ignore hotkey acpi events for functions that are
already handled without. This avoids warning message "keyboard:
can't emulate rawmode for keycode 240".

Signed-off-by: Melchior FRANZ <mfranz@aon.at>
---

This patch requires that Joey LEE's 64 bit fix be applied,
otherwise the whole acer-wmi module fails to load on this
machine. See https://bugzilla.kernel.org/show_bug.cgi?id=34142#c21
(0001-acer-wmi-allow-64-bits-return-buffer-from-WMI-metho.patch)


diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 6cb55a6..fb4ee5f 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -98,13 +98,26 @@ enum acer_wmi_event_ids {
 
 static const struct key_entry acer_wmi_keymap[] = {
 	{KE_KEY, 0x01, {KEY_WLAN} },     /* WiFi */
+	{KE_KEY, 0x03, {KEY_WLAN} },     /* WiFi */
 	{KE_KEY, 0x12, {KEY_BLUETOOTH} },	/* BT */
 	{KE_KEY, 0x21, {KEY_PROG1} },    /* Backup */
 	{KE_KEY, 0x22, {KEY_PROG2} },    /* Arcade */
 	{KE_KEY, 0x23, {KEY_PROG3} },    /* P_Key */
 	{KE_KEY, 0x24, {KEY_PROG4} },    /* Social networking_Key */
+	{KE_IGNORE, 0x41, {KEY_MUTE} },
+	{KE_IGNORE, 0x42, {KEY_PREVIOUSSONG} },
+	{KE_IGNORE, 0x43, {KEY_NEXTSONG} },
+	{KE_IGNORE, 0x44, {KEY_PLAYPAUSE} },
+	{KE_IGNORE, 0x45, {KEY_STOP} },
+	{KE_IGNORE, 0x48, {KEY_VOLUMEUP} },
+	{KE_IGNORE, 0x49, {KEY_VOLUMEDOWN} },
+	{KE_IGNORE, 0x61, {KEY_SWITCHVIDEOMODE} },
+	{KE_IGNORE, 0x62, {KEY_BRIGHTNESSUP} },
+	{KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} },
 	{KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} },	/* Display Switch */
+	{KE_IGNORE, 0x81, {KEY_SLEEP} },
 	{KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} },	/* Touch Pad On/Off */
+	{KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
 	{KE_END, 0}
 };
 
@@ -1345,7 +1358,7 @@ static void acer_wmi_notify(u32 value, void *context)
 	case WMID_HOTKEY_EVENT:
 		if (return_value.device_state) {
 			u16 device_state = return_value.device_state;
-			pr_debug("deivces states: 0x%x\n", device_state);
+			pr_debug("device state: 0x%x\n", device_state);
 			if (has_cap(ACER_CAP_WIRELESS))
 				rfkill_set_sw_state(wireless_rfkill,
 				!(device_state & ACER_WMID3_GDS_WIRELESS));

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

* Re: [PATCH] support wlan hotkey on Acer Travelmate 5735Z
@ 2011-05-24 10:31 ` Joey Lee
  0 siblings, 0 replies; 3+ messages in thread
From: Joey Lee @ 2011-05-24 10:31 UTC (permalink / raw)
  To: melchior.franz; +Cc: Joey Lee, carlos, linux-kernel, platform-driver-x86

於 二,2011-05-24 於 10:35 +0200,Melchior FRANZ 提到:
> From: Melchior FRANZ <mfranz@aon.at>
>     
> On an Acer Travelmate 5735Z-452G32Mnss the WLAN-enable/disable key
> doesn't send 0x1 as acpi event key code, but 0x3. This patch also
> makes the module ignore hotkey acpi events for functions that are
> already handled without. This avoids warning message "keyboard:
> can't emulate rawmode for keycode 240".
> 
> Signed-off-by: Melchior FRANZ <mfranz@aon.at>

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>

Thank's for your patch, it also works to me on TravelMate 8572.

Joey Lee

> ---
> 
> This patch requires that Joey LEE's 64 bit fix be applied,
> otherwise the whole acer-wmi module fails to load on this
> machine. See https://bugzilla.kernel.org/show_bug.cgi?id=34142#c21
> (0001-acer-wmi-allow-64-bits-return-buffer-from-WMI-metho.patch)
> 
> 
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index 6cb55a6..fb4ee5f 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -98,13 +98,26 @@ enum acer_wmi_event_ids {
>  
>  static const struct key_entry acer_wmi_keymap[] = {
>  	{KE_KEY, 0x01, {KEY_WLAN} },     /* WiFi */
> +	{KE_KEY, 0x03, {KEY_WLAN} },     /* WiFi */
>  	{KE_KEY, 0x12, {KEY_BLUETOOTH} },	/* BT */
>  	{KE_KEY, 0x21, {KEY_PROG1} },    /* Backup */
>  	{KE_KEY, 0x22, {KEY_PROG2} },    /* Arcade */
>  	{KE_KEY, 0x23, {KEY_PROG3} },    /* P_Key */
>  	{KE_KEY, 0x24, {KEY_PROG4} },    /* Social networking_Key */
> +	{KE_IGNORE, 0x41, {KEY_MUTE} },
> +	{KE_IGNORE, 0x42, {KEY_PREVIOUSSONG} },
> +	{KE_IGNORE, 0x43, {KEY_NEXTSONG} },
> +	{KE_IGNORE, 0x44, {KEY_PLAYPAUSE} },
> +	{KE_IGNORE, 0x45, {KEY_STOP} },
> +	{KE_IGNORE, 0x48, {KEY_VOLUMEUP} },
> +	{KE_IGNORE, 0x49, {KEY_VOLUMEDOWN} },
> +	{KE_IGNORE, 0x61, {KEY_SWITCHVIDEOMODE} },
> +	{KE_IGNORE, 0x62, {KEY_BRIGHTNESSUP} },
> +	{KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} },
>  	{KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} },	/* Display Switch */
> +	{KE_IGNORE, 0x81, {KEY_SLEEP} },
>  	{KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} },	/* Touch Pad On/Off */
> +	{KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
>  	{KE_END, 0}
>  };
>  
> @@ -1345,7 +1358,7 @@ static void acer_wmi_notify(u32 value, void *context)
>  	case WMID_HOTKEY_EVENT:
>  		if (return_value.device_state) {
>  			u16 device_state = return_value.device_state;
> -			pr_debug("deivces states: 0x%x\n", device_state);
> +			pr_debug("device state: 0x%x\n", device_state);
>  			if (has_cap(ACER_CAP_WIRELESS))
>  				rfkill_set_sw_state(wireless_rfkill,
>  				!(device_state & ACER_WMID3_GDS_WIRELESS));



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

* Re: [PATCH] support wlan hotkey on Acer Travelmate 5735Z
@ 2011-05-24 10:31 ` Joey Lee
  0 siblings, 0 replies; 3+ messages in thread
From: Joey Lee @ 2011-05-24 10:31 UTC (permalink / raw)
  To: melchior.franz; +Cc: Joey Lee, carlos, linux-kernel, platform-driver-x86

於 二,2011-05-24 於 10:35 +0200,Melchior FRANZ 提到:
> From: Melchior FRANZ <mfranz@aon.at>
>     
> On an Acer Travelmate 5735Z-452G32Mnss the WLAN-enable/disable key
> doesn't send 0x1 as acpi event key code, but 0x3. This patch also
> makes the module ignore hotkey acpi events for functions that are
> already handled without. This avoids warning message "keyboard:
> can't emulate rawmode for keycode 240".
> 
> Signed-off-by: Melchior FRANZ <mfranz@aon.at>

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>

Thank's for your patch, it also works to me on TravelMate 8572.

Joey Lee

> ---
> 
> This patch requires that Joey LEE's 64 bit fix be applied,
> otherwise the whole acer-wmi module fails to load on this
> machine. See https://bugzilla.kernel.org/show_bug.cgi?id=34142#c21
> (0001-acer-wmi-allow-64-bits-return-buffer-from-WMI-metho.patch)
> 
> 
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index 6cb55a6..fb4ee5f 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -98,13 +98,26 @@ enum acer_wmi_event_ids {
>  
>  static const struct key_entry acer_wmi_keymap[] = {
>  	{KE_KEY, 0x01, {KEY_WLAN} },     /* WiFi */
> +	{KE_KEY, 0x03, {KEY_WLAN} },     /* WiFi */
>  	{KE_KEY, 0x12, {KEY_BLUETOOTH} },	/* BT */
>  	{KE_KEY, 0x21, {KEY_PROG1} },    /* Backup */
>  	{KE_KEY, 0x22, {KEY_PROG2} },    /* Arcade */
>  	{KE_KEY, 0x23, {KEY_PROG3} },    /* P_Key */
>  	{KE_KEY, 0x24, {KEY_PROG4} },    /* Social networking_Key */
> +	{KE_IGNORE, 0x41, {KEY_MUTE} },
> +	{KE_IGNORE, 0x42, {KEY_PREVIOUSSONG} },
> +	{KE_IGNORE, 0x43, {KEY_NEXTSONG} },
> +	{KE_IGNORE, 0x44, {KEY_PLAYPAUSE} },
> +	{KE_IGNORE, 0x45, {KEY_STOP} },
> +	{KE_IGNORE, 0x48, {KEY_VOLUMEUP} },
> +	{KE_IGNORE, 0x49, {KEY_VOLUMEDOWN} },
> +	{KE_IGNORE, 0x61, {KEY_SWITCHVIDEOMODE} },
> +	{KE_IGNORE, 0x62, {KEY_BRIGHTNESSUP} },
> +	{KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} },
>  	{KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} },	/* Display Switch */
> +	{KE_IGNORE, 0x81, {KEY_SLEEP} },
>  	{KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} },	/* Touch Pad On/Off */
> +	{KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
>  	{KE_END, 0}
>  };
>  
> @@ -1345,7 +1358,7 @@ static void acer_wmi_notify(u32 value, void *context)
>  	case WMID_HOTKEY_EVENT:
>  		if (return_value.device_state) {
>  			u16 device_state = return_value.device_state;
> -			pr_debug("deivces states: 0x%x\n", device_state);
> +			pr_debug("device state: 0x%x\n", device_state);
>  			if (has_cap(ACER_CAP_WIRELESS))
>  				rfkill_set_sw_state(wireless_rfkill,
>  				!(device_state & ACER_WMID3_GDS_WIRELESS));

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

end of thread, other threads:[~2011-05-24 10:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-24  8:35 [PATCH] support wlan hotkey on Acer Travelmate 5735Z Melchior FRANZ
2011-05-24 10:31 Joey Lee
2011-05-24 10:31 ` Joey Lee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.