Merge branches 'for-3.12/devm', 'for-3.12/i2c-hid', 'for-3.12/i2c-hid-dt', 'for-3...
authorJiri Kosina <jkosina@suse.cz>
Fri, 6 Sep 2013 09:58:37 +0000 (11:58 +0200)
committerJiri Kosina <jkosina@suse.cz>
Fri, 6 Sep 2013 09:58:37 +0000 (11:58 +0200)
1  2  3  4  5  6  7  8 
drivers/hid/hid-apple.c
drivers/hid/hid-core.c
drivers/hid/hid-input.c
drivers/hid/hid-logitech-dj.c
drivers/hid/hid-magicmouse.c
drivers/hid/hid-sony.c
drivers/hid/i2c-hid/i2c-hid.c
drivers/hid/uhid.c
drivers/hid/usbhid/hid-core.c
include/linux/hid.h
include/linux/mod_devicetable.h

Simple merge
@@@@@@@@@ -690,48 -690,48 -690,48 -739,41 -690,48 -690,48 -694,48 -690,48 +743,41 @@@@@@@@@ static int hid_scan_main(struct hid_par
         */
        static int hid_scan_report(struct hid_device *hid)
        {
--- ----        unsigned int page = 0, delim = 0;
+++ ++++        struct hid_parser *parser;
+++ ++++        struct hid_item item;
                __u8 *start = hid->dev_rdesc;
                __u8 *end = start + hid->dev_rsize;
--- ----        unsigned int u, u_min = 0, u_max = 0;
--- ----        struct hid_item item;
+++ ++++        static int (*dispatch_type[])(struct hid_parser *parser,
+++ ++++                                      struct hid_item *item) = {
+++ ++++                hid_scan_main,
+++ ++++                hid_parser_global,
+++ ++++                hid_parser_local,
+++ ++++                hid_parser_reserved
+++ ++++        };
+++ +++ 
+++ ++++        parser = vzalloc(sizeof(struct hid_parser));
+++ ++++        if (!parser)
+++ ++++                return -ENOMEM;
       +
+++ ++++        parser->device = hid;
                hid->group = HID_GROUP_GENERIC;
--- ----        while ((start = fetch_item(start, end, &item)) != NULL) {
--- ----                if (item.format != HID_ITEM_FORMAT_SHORT)
--- ----                        return -EINVAL;
--- ----                if (item.type == HID_ITEM_TYPE_GLOBAL) {
--- ----                        if (item.tag == HID_GLOBAL_ITEM_TAG_USAGE_PAGE)
--- ----                                page = item_udata(&item) << 16;
--- ----                } else if (item.type == HID_ITEM_TYPE_LOCAL) {
--- ----                        if (delim > 1)
--- ----                                break;
--- ----                        u = item_udata(&item);
--- ----                        if (item.size <= 2)
--- ----                                u += page;
--- ----                        switch (item.tag) {
--- ----                        case HID_LOCAL_ITEM_TAG_DELIMITER:
--- ----                                delim += !!u;
--- ----                                break;
--- ----                        case HID_LOCAL_ITEM_TAG_USAGE:
--- ----                                hid_scan_usage(hid, u);
--- ----                                break;
--- ----                        case HID_LOCAL_ITEM_TAG_USAGE_MINIMUM:
--- ----                                u_min = u;
--- ----                                break;
--- ----                        case HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM:
--- ----                                u_max = u;
--- ----                                for (u = u_min; u <= u_max; u++)
--- ----                                        hid_scan_usage(hid, u);
--- ----                                break;
--- ----                        }
--- ----                } else if (page == HID_UP_SENSOR &&
--- ----                        item.type == HID_ITEM_TYPE_MAIN &&
--- ----                        item.tag == HID_MAIN_ITEM_TAG_BEGIN_COLLECTION &&
--- ----                        (item_udata(&item) & 0xff) == HID_COLLECTION_PHYSICAL)
--- ----                        hid->group = HID_GROUP_SENSOR_HUB;
--- ----        }
        
+++ ++++        /*
+++ ++++         * The parsing is simpler than the one in hid_open_report() as we should
+++ ++++         * be robust against hid errors. Those errors will be raised by
+++ ++++         * hid_open_report() anyway.
+++ ++++         */
+++ ++++        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;
        }
        
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge