diff mbox

[57/98] sony-laptop: Add support for extra keyboard events

Message ID 200903291908.36826.matze@welwarsky.de (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Matthias Welwarsky March 29, 2009, 5:08 p.m. UTC
On Sunday 29 March 2009 18:41:07 Matthew Garrett wrote:
> Yes, that looks good, just move the acpi_bus_generate_proc_event into
> the same blocks as sony_laptop_report_input_event.
>
> Acked-by: Matthew Garrett <mjg@redhat.com>

final version:



--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Matthew Garrett March 29, 2009, 5:13 p.m. UTC | #1
On Sun, Mar 29, 2009 at 07:08:36PM +0200, Matthias Welwarsky wrote:
> +			} else
> +				sony_laptop_report_input_event(ev);
>  		} else if (sony_find_snc_handle(0x124) == ev) {
>  			sony_nc_rfkill_update();
>  			return;

Nitpicky, but with this codeflow I think we can skip the return there?
diff mbox

Patch

--- sony-laptop.c.orig	2009-03-29 12:41:44.000000000 +0200
+++ sony-laptop.c	2009-03-29 19:05:24.000000000 +0200
@@ -865,7 +865,7 @@ 
 static struct sony_nc_event sony_100_events[] = {
 	{ 0x90, SONYPI_EVENT_PKEY_P1 },
 	{ 0x10, SONYPI_EVENT_ANYBUTTON_RELEASED },
-	{ 0x91, SONYPI_EVENT_PKEY_P1 },
+	{ 0x91, SONYPI_EVENT_PKEY_P2 },
 	{ 0x11, SONYPI_EVENT_ANYBUTTON_RELEASED },
 	{ 0x81, SONYPI_EVENT_FNKEY_F1 },
 	{ 0x01, SONYPI_EVENT_FNKEY_RELEASED },
@@ -929,7 +929,7 @@ 
 		if (sony_find_snc_handle(0x127) == ev)
 			key_handle = 0x127;
 
-		if (handle) {
+		if (key_handle) {
 			struct sony_nc_event *key_event;
 
 			if (sony_call_snc_handle(key_handle, 0x200, &result))
@@ -955,16 +955,17 @@ 
 				printk(KERN_INFO DRV_PFX
 				       "Unknown event: 0x%x 0x%x\n", key_handle,
 				       ev);
-			}
+			} else
+				sony_laptop_report_input_event(ev);
 		} else if (sony_find_snc_handle(0x124) == ev) {
 			sony_nc_rfkill_update();
 			return;
 		}
+	} else {
+		dprintk("sony_acpi_notify, event: 0x%.2x\n", ev);
+		sony_laptop_report_input_event(ev);
+		acpi_bus_generate_proc_event(sony_nc_acpi_device, 1, ev);
 	}
-
-	dprintk("sony_acpi_notify, event: 0x%.2x\n", ev);
-	sony_laptop_report_input_event(ev);
-	acpi_bus_generate_proc_event(sony_nc_acpi_device, 1, ev);
 }
 
 static acpi_status sony_walk_callback(acpi_handle handle, u32 level,