Commit b25b732a authored by Mattia Dongili's avatar Mattia Dongili Committed by Len Brown

sony-laptop: Invoke _INI for SNC devices that provide it

Signed-off-by: default avatarMattia Dongili <malattia@linux.it>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 6315fd1c
...@@ -864,6 +864,15 @@ static int sony_nc_add(struct acpi_device *device) ...@@ -864,6 +864,15 @@ static int sony_nc_add(struct acpi_device *device)
sony_nc_acpi_handle = device->handle; sony_nc_acpi_handle = device->handle;
/* read device status */
result = acpi_bus_get_status(device);
/* bail IFF the above call was successful and the device is not present */
if (!result && !device->status.present) {
dprintk("Device not present\n");
result = -ENODEV;
goto outwalk;
}
if (debug) { if (debug) {
status = acpi_walk_namespace(ACPI_TYPE_METHOD, sony_nc_acpi_handle, status = acpi_walk_namespace(ACPI_TYPE_METHOD, sony_nc_acpi_handle,
1, sony_walk_callback, NULL, NULL); 1, sony_walk_callback, NULL, NULL);
...@@ -874,6 +883,15 @@ static int sony_nc_add(struct acpi_device *device) ...@@ -874,6 +883,15 @@ static int sony_nc_add(struct acpi_device *device)
} }
} }
/* try to _INI the device if such method exists (ACPI spec 3.0-6.5.1
* should be respected as we already checked for the device presence above */
if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, METHOD_NAME__INI, &handle))) {
dprintk("Invoking _INI\n");
if (ACPI_FAILURE(acpi_evaluate_object(sony_nc_acpi_handle, METHOD_NAME__INI,
NULL, NULL)))
dprintk("_INI Method failed\n");
}
/* setup input devices and helper fifo */ /* setup input devices and helper fifo */
result = sony_laptop_setup_input(); result = sony_laptop_setup_input();
if (result) { if (result) {
...@@ -886,7 +904,7 @@ static int sony_nc_add(struct acpi_device *device) ...@@ -886,7 +904,7 @@ static int sony_nc_add(struct acpi_device *device)
ACPI_DEVICE_NOTIFY, ACPI_DEVICE_NOTIFY,
sony_acpi_notify, NULL); sony_acpi_notify, NULL);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
printk(KERN_WARNING DRV_PFX "unable to install notify handler\n"); printk(KERN_WARNING DRV_PFX "unable to install notify handler (%u)\n", status);
result = -ENODEV; result = -ENODEV;
goto outinput; goto outinput;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment