X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=drivers%2Fhid%2Fhid-multitouch.c;h=25d3c4330bf69bbca32efb3883628f3af6a28875;hb=e1c9b9ff2420c0d8c25924be312bc422bf9dc056;hp=296d4991560e45a9fed565c8a2d3cd463efb9ff1;hpb=af2e628d6be7a510e2667c3b5358350464d0f5b7;p=mirror_ubuntu-artful-kernel.git diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 296d4991560e..25d3c4330bf6 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -396,6 +396,11 @@ static void mt_feature_mapping(struct hid_device *hdev, td->is_buttonpad = true; break; + case 0xff0000c5: + /* Retrieve the Win8 blob once to enable some devices */ + if (usage->usage_index == 0) + mt_get_feature(hdev, field->report); + break; } } @@ -1133,6 +1138,9 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) return ret; ret = sysfs_create_group(&hdev->dev.kobj, &mt_attribute_group); + if (ret) + dev_warn(&hdev->dev, "Cannot allocate sysfs group for %s\n", + hdev->name); mt_set_maxcontacts(hdev); mt_set_input_mode(hdev); @@ -1145,8 +1153,30 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) } #ifdef CONFIG_PM +static void mt_release_contacts(struct hid_device *hid) +{ + struct hid_input *hidinput; + + list_for_each_entry(hidinput, &hid->inputs, list) { + struct input_dev *input_dev = hidinput->input; + struct input_mt *mt = input_dev->mt; + int i; + + if (mt) { + for (i = 0; i < mt->num_slots; i++) { + input_mt_slot(input_dev, i); + input_mt_report_slot_state(input_dev, + MT_TOOL_FINGER, + false); + } + input_sync(input_dev); + } + } +} + static int mt_reset_resume(struct hid_device *hdev) { + mt_release_contacts(hdev); mt_set_maxcontacts(hdev); mt_set_input_mode(hdev); return 0;