From: Jiri Kosina Date: Thu, 21 Feb 2013 09:42:39 +0000 (+0100) Subject: Merge branches 'for-3.8/upstream-fixes', 'for-3.9/hid-sensor', 'for-3.9/hidraw' and... X-Git-Tag: v3.9-rc1~112^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=539cf54bdd922474d22585837c9fec3343d7061b;p=platform%2Fkernel%2Flinux-exynos.git Merge branches 'for-3.8/upstream-fixes', 'for-3.9/hid-sensor', 'for-3.9/hidraw' and 'for-3.9/i2c-hid' into for-linus Conflicts: drivers/hid/i2c-hid/i2c-hid.c --- 539cf54bdd922474d22585837c9fec3343d7061b diff --cc drivers/hid/i2c-hid/i2c-hid.c index 5774ebf,e766b56,e766b56,9e46e42..ec79302 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@@@@ -821,8 -821,8 -821,8 -813,72 +824,72 @@@@@ static int i2c_hid_fetch_hid_descriptor return 0; } - static int __devinit i2c_hid_probe(struct i2c_client *client, - const struct i2c_device_id *dev_id) +++ #ifdef CONFIG_ACPI +++ static int i2c_hid_acpi_pdata(struct i2c_client *client, +++ struct i2c_hid_platform_data *pdata) +++ { +++ static u8 i2c_hid_guid[] = { +++ 0xF7, 0xF6, 0xDF, 0x3C, 0x67, 0x42, 0x55, 0x45, +++ 0xAD, 0x05, 0xB3, 0x0A, 0x3D, 0x89, 0x38, 0xDE, +++ }; +++ struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL }; +++ union acpi_object params[4], *obj; +++ struct acpi_object_list input; +++ struct acpi_device *adev; +++ acpi_handle handle; +++ +++ handle = ACPI_HANDLE(&client->dev); +++ if (!handle || acpi_bus_get_device(handle, &adev)) +++ return -ENODEV; +++ +++ input.count = ARRAY_SIZE(params); +++ input.pointer = params; +++ +++ params[0].type = ACPI_TYPE_BUFFER; +++ params[0].buffer.length = sizeof(i2c_hid_guid); +++ params[0].buffer.pointer = i2c_hid_guid; +++ params[1].type = ACPI_TYPE_INTEGER; +++ params[1].integer.value = 1; +++ params[2].type = ACPI_TYPE_INTEGER; +++ params[2].integer.value = 1; /* HID function */ +++ params[3].type = ACPI_TYPE_INTEGER; +++ params[3].integer.value = 0; +++ +++ if (ACPI_FAILURE(acpi_evaluate_object(handle, "_DSM", &input, &buf))) { +++ dev_err(&client->dev, "device _DSM execution failed\n"); +++ return -ENODEV; +++ } +++ +++ obj = (union acpi_object *)buf.pointer; +++ if (obj->type != ACPI_TYPE_INTEGER) { +++ dev_err(&client->dev, "device _DSM returned invalid type: %d\n", +++ obj->type); +++ kfree(buf.pointer); +++ return -EINVAL; +++ } +++ +++ pdata->hid_descriptor_address = obj->integer.value; +++ +++ kfree(buf.pointer); +++ return 0; +++ } +++ +++ static const struct acpi_device_id i2c_hid_acpi_match[] = { +++ {"ACPI0C50", 0 }, +++ {"PNP0C50", 0 }, +++ { }, +++ }; +++ MODULE_DEVICE_TABLE(acpi, i2c_hid_acpi_match); +++ #else +++ static inline int i2c_hid_acpi_pdata(struct i2c_client *client, +++ struct i2c_hid_platform_data *pdata) +++ { +++ return -ENODEV; +++ } +++ #endif +++ -static int __devinit i2c_hid_probe(struct i2c_client *client, - const struct i2c_device_id *dev_id) + +static int i2c_hid_probe(struct i2c_client *client, + + const struct i2c_device_id *dev_id) { int ret; struct i2c_hid *ihid;