hid->group = HID_GROUP_MULTITOUCH;
 }
 
+static void hid_scan_feature_usage(struct hid_parser *parser, u32 usage)
+{
+       if (usage == 0xff0000c5 && parser->global.report_count == 256 &&
+           parser->global.report_size == 8)
+               parser->scan_flags |= HID_SCAN_FLAG_MT_WIN_8;
+}
+
 static void hid_scan_collection(struct hid_parser *parser, unsigned type)
 {
        struct hid_device *hid = parser->device;
        case HID_MAIN_ITEM_TAG_OUTPUT:
                break;
        case HID_MAIN_ITEM_TAG_FEATURE:
+               for (i = 0; i < parser->local.usage_index; i++)
+                       hid_scan_feature_usage(parser, parser->local.usage[i]);
                break;
        }
 
        while ((start = fetch_item(start, end, &item)) != NULL)
                dispatch_type[item.type](parser, &item);
 
+       /*
+        * Handle special flags set during scanning.
+        */
+       if ((parser->scan_flags & HID_SCAN_FLAG_MT_WIN_8) &&
+           (hid->group == HID_GROUP_MULTITOUCH))
+               hid->group = HID_GROUP_MULTITOUCH_WIN_8;
+
        vfree(parser);
        return 0;
 }
 
 #define MT_CLS_NSMU                            0x000a
 #define MT_CLS_DUAL_CONTACT_NUMBER             0x0010
 #define MT_CLS_DUAL_CONTACT_ID                 0x0011
+#define MT_CLS_WIN_8                           0x0012
 
 /* vendor specific classes */
 #define MT_CLS_3M                              0x0101
                        MT_QUIRK_CONTACT_CNT_ACCURATE |
                        MT_QUIRK_SLOT_IS_CONTACTID,
                .maxcontacts = 2 },
+       { .name = MT_CLS_WIN_8,
+               .quirks = MT_QUIRK_ALWAYS_VALID |
+                       MT_QUIRK_IGNORE_DUPLICATES |
+                       MT_QUIRK_HOVERING |
+                       MT_QUIRK_CONTACT_CNT_ACCURATE },
 
        /*
         * vendor specific classes
                        td->maxcontacts = td->mtclass.maxcontacts;
 
                break;
-       case 0xff0000c5:
-               if (field->report_count == 256 && field->report_size == 8) {
-                       /* Win 8 devices need special quirks */
-                       __s32 *quirks = &td->mtclass.quirks;
-                       *quirks |= MT_QUIRK_ALWAYS_VALID;
-                       *quirks |= MT_QUIRK_IGNORE_DUPLICATES;
-                       *quirks |= MT_QUIRK_HOVERING;
-                       *quirks |= MT_QUIRK_CONTACT_CNT_ACCURATE;
-                       *quirks &= ~MT_QUIRK_NOT_SEEN_MEANS_UP;
-                       *quirks &= ~MT_QUIRK_VALID_IS_INRANGE;
-                       *quirks &= ~MT_QUIRK_VALID_IS_CONFIDENCE;
-               }
-               break;
        }
 }
 
 
        /* Generic MT device */
        { HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH, HID_ANY_ID, HID_ANY_ID) },
+
+       /* Generic Win 8 certified MT device */
+       {  .driver_data = MT_CLS_WIN_8,
+               HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH_WIN_8,
+                       HID_ANY_ID, HID_ANY_ID) },
        { }
 };
 MODULE_DEVICE_TABLE(hid, mt_devices);
 
 #define HID_GROUP_GENERIC                      0x0001
 #define HID_GROUP_MULTITOUCH                   0x0002
 #define HID_GROUP_SENSOR_HUB                   0x0003
+#define HID_GROUP_MULTITOUCH_WIN_8             0x0004
 
 /*
  * This is the global environment of the parser. This information is
 #define HID_GLOBAL_STACK_SIZE 4
 #define HID_COLLECTION_STACK_SIZE 4
 
+#define HID_SCAN_FLAG_MT_WIN_8                 0x00000001
+
 struct hid_parser {
        struct hid_global     global;
        struct hid_global     global_stack[HID_GLOBAL_STACK_SIZE];
        unsigned              collection_stack[HID_COLLECTION_STACK_SIZE];
        unsigned              collection_stack_ptr;
        struct hid_device    *device;
+       unsigned              scan_flags;
 };
 
 struct hid_class_descriptor {