aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/i2c-hid/i2c-hid.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/i2c-hid/i2c-hid.c')
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index e914f2755491..d1f81f52481a 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -850,37 +850,23 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client,
850 0xF7, 0xF6, 0xDF, 0x3C, 0x67, 0x42, 0x55, 0x45, 850 0xF7, 0xF6, 0xDF, 0x3C, 0x67, 0x42, 0x55, 0x45,
851 0xAD, 0x05, 0xB3, 0x0A, 0x3D, 0x89, 0x38, 0xDE, 851 0xAD, 0x05, 0xB3, 0x0A, 0x3D, 0x89, 0x38, 0xDE,
852 }; 852 };
853 union acpi_object params[4]; 853 union acpi_object *obj;
854 struct acpi_object_list input;
855 struct acpi_device *adev; 854 struct acpi_device *adev;
856 unsigned long long value;
857 acpi_handle handle; 855 acpi_handle handle;
858 856
859 handle = ACPI_HANDLE(&client->dev); 857 handle = ACPI_HANDLE(&client->dev);
860 if (!handle || acpi_bus_get_device(handle, &adev)) 858 if (!handle || acpi_bus_get_device(handle, &adev))
861 return -ENODEV; 859 return -ENODEV;
862 860
863 input.count = ARRAY_SIZE(params); 861 obj = acpi_evaluate_dsm_typed(handle, i2c_hid_guid, 1, 1, NULL,
864 input.pointer = params; 862 ACPI_TYPE_INTEGER);
865 863 if (!obj) {
866 params[0].type = ACPI_TYPE_BUFFER;
867 params[0].buffer.length = sizeof(i2c_hid_guid);
868 params[0].buffer.pointer = i2c_hid_guid;
869 params[1].type = ACPI_TYPE_INTEGER;
870 params[1].integer.value = 1;
871 params[2].type = ACPI_TYPE_INTEGER;
872 params[2].integer.value = 1; /* HID function */
873 params[3].type = ACPI_TYPE_PACKAGE;
874 params[3].package.count = 0;
875 params[3].package.elements = NULL;
876
877 if (ACPI_FAILURE(acpi_evaluate_integer(handle, "_DSM", &input,
878 &value))) {
879 dev_err(&client->dev, "device _DSM execution failed\n"); 864 dev_err(&client->dev, "device _DSM execution failed\n");
880 return -ENODEV; 865 return -ENODEV;
881 } 866 }
882 867
883 pdata->hid_descriptor_address = value; 868 pdata->hid_descriptor_address = obj->integer.value;
869 ACPI_FREE(obj);
884 870
885 return 0; 871 return 0;
886} 872}