summary | shortlog | log | commit | commitdiff | tree
raw | combined (merge: befde02 0d1e4b0 0f690cc 92241e6)
raw | combined (merge: befde02 0d1e4b0 0f690cc 92241e6)
author | Jiri Kosina <jkosina@suse.cz> | |
Thu, 21 Feb 2013 09:42:39 +0000 (10:42 +0100) | ||
committer | Jiri Kosina <jkosina@suse.cz> | |
Thu, 21 Feb 2013 09:42:39 +0000 (10:42 +0100) |
Conflicts:
drivers/hid/i2c-hid/i2c-hid.c
drivers/hid/i2c-hid/i2c-hid.c
1 | 2 | 3 | 4 | |||
---|---|---|---|---|---|---|
drivers/hid/i2c-hid/i2c-hid.c | patch | | diff1 | | diff2 | | diff3 | | diff4 | | blob | history |
diff --cc drivers/hid/i2c-hid/i2c-hid.c
index 5774ebf4298c7ba1d4f8ddbbbe42cbb9d857f7be,e766b5614ef59fcae45aaeff49a98df9de3e9693,e766b5614ef59fcae45aaeff49a98df9de3e9693,9e46e4295bd9006addbb92ea136f7d98d0e1d093..ec7930217a6dff1fceb15b1a445ec0462cb47b82
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;