[PATCH V2 7/14] sony-laptop: sony_nc_function_setup modifications

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Removed every init code, already present in sony_nc_snc_setup and
sony_nc_snc_resume. Now calling only the handles present on the device,
using the new setup and resume code.

Signed-off-by: Marco Chiappero <marco@xxxxxxxxxx> 
--- 

--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1225,18 +1225,14 @@ static acpi_status sony_walk_callback(ac
 /*
  * ACPI device
  */
-static int sony_nc_function_setup(struct acpi_device *device)
+static int sony_nc_function_setup(unsigned int handle)
 {
 	unsigned int result;
 
-	/* Enable all events */
-	acpi_callsetfunc(sony_nc_acpi_handle, "SN02", 0xffff, &result);
-
-	/* Setup hotkeys */
-	sony_call_snc_handle(0x0100, 0, &result);
-	sony_call_snc_handle(0x0101, 0, &result);
-	sony_call_snc_handle(0x0102, 0x100, &result);
-	sony_call_snc_handle(0x0127, 0, &result);
+	if (handle == 0x0102)
+		sony_call_snc_handle(0x0102, 0x100, &result);
+	else
+		sony_call_snc_handle(handle, 0, &result);
 
 	return 0;
 }
@@ -1721,6 +1717,12 @@ static int sony_nc_handles_setup(struct 
 		dprintk("looking at handle 0x%.4x\n", handle);
 
 		switch (handle) {
+		case 0x0100:
+		case 0x0127:
+		case 0x0101:
+		case 0x0102:
+			ret = sony_nc_function_setup(handle);
+			break;
 		case 0x0137:
 			ret = sony_nc_kbd_backlight_setup(pd);
 		case 0x0124:
@@ -1806,6 +1808,12 @@ static int sony_nc_handles_resume(void)
 		dprintk("looking at handle 0x%.4x\n", handle);
 
 		switch (handle) {
+		case 0x0100:
+		case 0x0127:
+		case 0x0101:
+		case 0x0102:
+			sony_nc_function_setup(handle);
+			break;
 		case 0x0137: /* kbd + als */
 			sony_nc_kbd_backlight_resume();
 			break;
@@ -1871,7 +1879,7 @@ static int sony_nc_add(struct acpi_devic
 	if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "SN00",
 					 &handle))) {
 		dprintk("Doing SNC setup\n");
-		sony_nc_function_setup(device);
+
 		result = sony_nc_handles_setup(sony_pf_device);
 		if (result)
 			goto outsnc;
@@ -1996,7 +2004,7 @@ static int sony_nc_resume(struct acpi_de
 	if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "SN00",
 					 &handle))) {
 		dprintk("Doing SNC setup\n");
-		sony_nc_function_setup(device);
+
 		sony_nc_handles_resume();
 	}
 

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


[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux