]> Git Repo - linux.git/commitdiff
Merge branches 'for-5.1/upstream-fixes', 'for-5.2/core', 'for-5.2/ish', 'for-5.2...
authorJiri Kosina <[email protected]>
Mon, 6 May 2019 13:45:18 +0000 (15:45 +0200)
committerJiri Kosina <[email protected]>
Mon, 6 May 2019 13:45:18 +0000 (15:45 +0200)
1  2  3  4  5  6  7  8 
drivers/hid/Kconfig
drivers/hid/Makefile
drivers/hid/hid-core.c
drivers/hid/hid-ids.h
include/linux/hid.h

diff --combined drivers/hid/Kconfig
index 4ca0cdfa6b33af35f951a3969cf9c02b67d7a1b0,6ca8d322b487279348d90513caa10d6bb6745e40,6ca8d322b487279348d90513caa10d6bb6745e40,0091954dfff3ccfc05dc1c77654d99476ba445b6,aef4a2a690e1df085f4f62fc469bf201914fe550,6ca8d322b487279348d90513caa10d6bb6745e40,6ca8d322b487279348d90513caa10d6bb6745e40,a0c678d28af0e6d1c4a3bd428c9c9e8d5f95a86a..c3c390ca369022f0de310c1ad99960ac2e53d6b3
@@@@@@@@@ -150,7 -150,6 -150,6 -150,7 -150,6 -150,6 -150,6 -150,7 +150,7 @@@@@@@@@ config HID_ASU
                tristate "Asus"
                depends on LEDS_CLASS
                depends on ASUS_WMI || ASUS_WMI=n
 ++ +++         select POWER_SUPPLY
                ---help---
                Support for Asus notebook built-in keyboard and touchpad via i2c, and
                the Asus Republic of Gamers laptop keyboard special keys.
@@@@@@@@@ -231,6 -230,6 -230,6 -231,6 -230,16 -230,6 -230,6 -231,6 +231,16 @@@@@@@@@ config HID_COUGA
                Supported devices:
                - Cougar 500k Gaming Keyboard
        
++++ +++config HID_MACALLY
++++ +++        tristate "Macally devices"
++++ +++        depends on HID
++++ +++        help
++++ +++        Support for Macally devices that are not fully compliant with the
++++ +++        HID standard.
++++ +++
++++ +++        supported devices:
++++ +++        - Macally ikey keyboard
++++ +++
        config HID_PRODIKEYS
                tristate "Prodikeys PC-MIDI Keyboard support"
                depends on HID && SND
@@@@@@@@@ -511,6 -510,6 -510,6 -511,7 -520,6 -510,6 -510,6 -511,6 +521,7 @@@@@@@@@ config HID_LOGITEC
        
        config HID_LOGITECH_DJ
                tristate "Logitech Unifying receivers full support"
+++ ++++        depends on USB_HID
                depends on HIDRAW
                depends on HID_LOGITECH
                select HID_LOGITECH_HIDPP
@@@@@@@@@ -1003,6 -1002,6 -1002,6 -1004,6 -1012,6 -1002,6 -1002,6 -1003,22 +1014,22 @@@@@@@@@ config HID_UDRAW_PS
                  Say Y here if you want to use the THQ uDraw gaming tablet for
                  the PS3.
        
+++++++ config HID_U2FZERO
+++++++         tristate "U2F Zero LED and RNG support"
+++++++         depends on USB_HID
+++++++         depends on LEDS_CLASS
+++++++         depends on HW_RANDOM
+++++++         help
+++++++           Support for the LED of the U2F Zero device.
+++++++ 
+++++++           U2F Zero supports custom commands for blinking the LED
+++++++           and getting data from the internal hardware RNG.
+++++++           The internal hardware can be used to feed the enthropy pool.
+++++++ 
+++++++           U2F Zero only supports blinking its LED, so this driver doesn't
+++++++           allow setting the brightness to anything but 1, which will
+++++++           trigger a single blink and immediately reset to back 0.
+++++++ 
        config HID_WACOM
                tristate "Wacom Intuos/Graphire tablet support (USB)"
                depends on USB_HID
diff --combined drivers/hid/Makefile
index 170163b413033504d69c9b58a3d8b1ecd5bc8e48,170163b413033504d69c9b58a3d8b1ecd5bc8e48,d8d393e7a1f967369b4d7ec8089df7a181c5b901,170163b413033504d69c9b58a3d8b1ecd5bc8e48,44b9caea46a713c7b49590e01af77a9c7df9369e,170163b413033504d69c9b58a3d8b1ecd5bc8e48,170163b413033504d69c9b58a3d8b1ecd5bc8e48,338d93f0c1397b0a46ca22286f354197c69f0cf1..cc5d827c9164432f7a9f88884e224561d445c0dc
@@@@@@@@@ -65,6 -65,6 -65,6 -65,6 -65,7 -65,6 -65,6 -65,6 +65,7 @@@@@@@@@ obj-$(CONFIG_HID_LENOVO)      += hid-lenovo.
        obj-$(CONFIG_HID_LOGITECH)      += hid-logitech.o
        obj-$(CONFIG_HID_LOGITECH_DJ)   += hid-logitech-dj.o
        obj-$(CONFIG_HID_LOGITECH_HIDPP)        += hid-logitech-hidpp.o
++++ +++obj-$(CONFIG_HID_MACALLY)       += hid-macally.o
        obj-$(CONFIG_HID_MAGICMOUSE)    += hid-magicmouse.o
        obj-$(CONFIG_HID_MALTRON)       += hid-maltron.o
        obj-$(CONFIG_HID_MAYFLASH)      += hid-mf.o
@@@@@@@@@ -109,6 -109,6 -109,6 -109,6 -110,6 -109,6 -109,6 -109,7 +110,7 @@@@@@@@@ obj-$(CONFIG_HID_THRUSTMASTER)       += hid-t
        obj-$(CONFIG_HID_TIVO)          += hid-tivo.o
        obj-$(CONFIG_HID_TOPSEED)       += hid-topseed.o
        obj-$(CONFIG_HID_TWINHAN)       += hid-twinhan.o
+++++++ obj-$(CONFIG_HID_U2FZERO)       += hid-u2fzero.o
        hid-uclogic-objs                := hid-uclogic-core.o \
                                           hid-uclogic-rdesc.o \
                                           hid-uclogic-params.o
@@@@@@@@@ -134,3 -134,3 -134,4 -134,3 -135,3 -134,3 -134,3 -135,3 +136,4 @@@@@@@@@ obj-$(CONFIG_USB_KBD)                += usbhid
        obj-$(CONFIG_I2C_HID)           += i2c-hid/
        
        obj-$(CONFIG_INTEL_ISH_HID)     += intel-ish-hid/
++ +++++obj-$(INTEL_ISH_FIRMWARE_DOWNLOADER)    += intel-ish-hid/
diff --combined drivers/hid/hid-core.c
index bff8186e1ea5aec651e8d936f530a10a3e0a5f1a,59e95768142dcd461661adb9ccf36b91db1e2226,9993b692598fb84d1700e26ef7f97856ff842955,860e21ec6a492a35392f2b47146f5e0a811c1068,9993b692598fb84d1700e26ef7f97856ff842955,9993b692598fb84d1700e26ef7f97856ff842955,9993b692598fb84d1700e26ef7f97856ff842955,860e21ec6a492a35392f2b47146f5e0a811c1068..92387fc0bf180e730d606556b018fe34dd916de6
        #include <linux/vmalloc.h>
        #include <linux/sched.h>
        #include <linux/semaphore.h>
+ ++++++#include <linux/async.h>
        
        #include <linux/hid.h>
        #include <linux/hiddev.h>
@@@@@@@@@ -218,13 -219,14 -218,13 -218,13 -218,13 -218,13 -218,13 -218,13 +219,14 @@@@@@@@@ static unsigned hid_lookup_collection(s
         * Add a usage to the temporary parser table.
         */
        
- ------static int hid_add_usage(struct hid_parser *parser, unsigned usage)
+ ++++++static int hid_add_usage(struct hid_parser *parser, unsigned usage, u8 size)
        {
                if (parser->local.usage_index >= HID_MAX_USAGES) {
                        hid_err(parser->device, "usage index exceeded\n");
                        return -1;
                }
                parser->local.usage[parser->local.usage_index] = usage;
+ ++++++        parser->local.usage_size[parser->local.usage_index] = size;
                parser->local.collection_index[parser->local.usage_index] =
                        parser->collection_stack_ptr ?
                        parser->collection_stack[parser->collection_stack_ptr - 1] : 0;
@@@@@@@@@ -486,10 -488,7 -486,10 -486,10 -486,10 -486,10 -486,10 -486,10 +488,7 @@@@@@@@@ static int hid_parser_local(struct hid_
                                return 0;
                        }
        
- ------                if (item->size <= 2)
- ------                        data = (parser->global.usage_page << 16) + data;
- ------
- ------                return hid_add_usage(parser, data);
+ ++++++                return hid_add_usage(parser, data, item->size);
        
                case HID_LOCAL_ITEM_TAG_USAGE_MINIMUM:
        
                                return 0;
                        }
        
- ------                if (item->size <= 2)
- ------                        data = (parser->global.usage_page << 16) + data;
- ------
                        parser->local.usage_minimum = data;
                        return 0;
        
                                return 0;
                        }
        
- ------                if (item->size <= 2)
- ------                        data = (parser->global.usage_page << 16) + data;
- ------
                        count = data - parser->local.usage_minimum;
                        if (count + parser->local.usage_index >= HID_MAX_USAGES) {
                                /*
                        }
        
                        for (n = parser->local.usage_minimum; n <= data; n++)
- ------                        if (hid_add_usage(parser, n)) {
+ ++++++                        if (hid_add_usage(parser, n, item->size)) {
                                        dbg_hid("hid_add_usage failed\n");
                                        return -1;
                                }
                return 0;
        }
        
+ ++++++/*
+ ++++++ * Concatenate Usage Pages into Usages where relevant:
+ ++++++ * As per specification, 6.2.2.8: "When the parser encounters a main item it
+ ++++++ * concatenates the last declared Usage Page with a Usage to form a complete
+ ++++++ * usage value."
+ ++++++ */
+ ++++++
+ ++++++static void hid_concatenate_usage_page(struct hid_parser *parser)
+ ++++++{
+ ++++++        int i;
+ ++++++
+ ++++++        for (i = 0; i < parser->local.usage_index; i++)
+ ++++++                if (parser->local.usage_size[i] <= 2)
+ ++++++                        parser->local.usage[i] += parser->global.usage_page << 16;
+ ++++++}
+ ++++++
        /*
         * Process a main item.
         */
@@@@@@@@@ -556,6 -565,8 -556,6 -556,6 -556,6 -556,6 -556,6 -556,6 +565,8 @@@@@@@@@ static int hid_parser_main(struct hid_p
                __u32 data;
                int ret;
        
+ ++++++        hid_concatenate_usage_page(parser);
+ ++++++
                data = item_udata(item);
        
                switch (item->tag) {
@@@@@@@@@ -765,6 -776,8 -765,6 -765,6 -765,6 -765,6 -765,6 -765,6 +776,8 @@@@@@@@@ static int hid_scan_main(struct hid_par
                __u32 data;
                int i;
        
+ ++++++        hid_concatenate_usage_page(parser);
+ ++++++
                data = item_udata(item);
        
                switch (item->tag) {
@@@@@@@@@ -1301,10 -1314,10 -1301,10 -1301,10 -1301,10 -1301,10 -1301,10 -1301,10 +1314,10 @@@@@@@@@ static u32 __extract(u8 *report, unsign
        u32 hid_field_extract(const struct hid_device *hid, u8 *report,
                                unsigned offset, unsigned n)
        {
 -- ---         if (n > 32) {
 -- ---                 hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n",
 ++ +++         if (n > 256) {
 ++ +++                 hid_warn(hid, "hid_field_extract() called with n (%d) > 256! (%s)\n",
                                 n, current->comm);
 -- ---                 n = 32;
 ++ +++                 n = 256;
                }
        
                return __extract(report, offset, n);
@@@@@@@@@ -1624,7 -1637,7 -1624,7 -1624,7 -1624,7 -1624,7 -1624,7 -1624,7 +1637,7 @@@@@@@@@ static struct hid_report *hid_get_repor
         * Implement a generic .request() callback, using .raw_request()
         * DO NOT USE in hid drivers directly, but through hid_hw_request instead.
         */
 -------void __hid_request(struct hid_device *hid, struct hid_report *report,
 +++++++int __hid_request(struct hid_device *hid, struct hid_report *report,
                        int reqtype)
        {
                char *buf;
        
                buf = hid_alloc_report_buf(report, GFP_KERNEL);
                if (!buf)
 -------                return;
 +++++++                return -ENOMEM;
        
                len = hid_report_len(report);
        
                if (reqtype == HID_REQ_GET_REPORT)
                        hid_input_report(hid, report->type, buf, ret, 0);
        
 +++++++        ret = 0;
 +++++++
        out:
                kfree(buf);
 +++++++        return ret;
        }
        EXPORT_SYMBOL_GPL(__hid_request);
        
@@@@@@@@@ -2352,6 -2362,15 -2349,6 -2349,6 -2349,6 -2349,6 -2349,6 -2349,6 +2365,15 @@@@@@@@@ int hid_add_device(struct hid_device *h
                dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus,
                             hdev->vendor, hdev->product, atomic_inc_return(&id));
        
+ ++++++        /*
+ ++++++         * Try loading the module for the device before the add, so that we do
+ ++++++         * not first have hid-generic binding only to have it replaced
+ ++++++         * immediately afterwards with a specialized driver.
+ ++++++         */
+ ++++++        if (!current_is_async())
+ ++++++                request_module("hid:b%04Xg%04Xv%08Xp%08X", hdev->bus,
+ ++++++                               hdev->group, hdev->vendor, hdev->product);
+ ++++++
                hid_debug_register(hdev, dev_name(&hdev->dev));
                ret = device_add(&hdev->dev);
                if (!ret)
diff --combined drivers/hid/hid-ids.h
index b6d93f4ad037e440d1e5d23d76058e4be606159c,b6d93f4ad037e440d1e5d23d76058e4be606159c,b6d93f4ad037e440d1e5d23d76058e4be606159c,621384f8b9ee5ee03563186bc4147ffeeae38028,aacc7534b076bc03ec34672ac07c61acb5e56f9f,b6d93f4ad037e440d1e5d23d76058e4be606159c,b6d93f4ad037e440d1e5d23d76058e4be606159c,03d86cace0747311e854b7939ac88ebcab5a66eb..1c8c72093b5a2ec25af405cfff95319f10f098b2
        #define USB_DEVICE_ID_CYGNAL_RADIO_SI470X       0x818a
        #define USB_DEVICE_ID_FOCALTECH_FTXXXX_MULTITOUCH       0x81b9
        #define USB_DEVICE_ID_CYGNAL_CP2112     0xea90
+++++++ #define USB_DEVICE_ID_U2F_ZERO          0x8acf
        
        #define USB_DEVICE_ID_CYGNAL_RADIO_SI4713       0x8244
        
        #define USB_DEVICE_ID_S510_RECEIVER_2   0xc517
        #define USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500   0xc512
        #define USB_DEVICE_ID_MX3000_RECEIVER   0xc513
+++ ++++#define USB_DEVICE_ID_LOGITECH_27MHZ_MOUSE_RECEIVER     0xc51b
        #define USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER        0xc52b
+++ ++++#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER            0xc52f
        #define USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER_2      0xc532
+++ ++++#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_2          0xc534
+++ ++++#define USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_GAMING     0xc539
        #define USB_DEVICE_ID_SPACETRAVELLER    0xc623
        #define USB_DEVICE_ID_SPACENAVIGATOR    0xc626
        #define USB_DEVICE_ID_DINOVO_DESKTOP    0xc704
        #define USB_DEVICE_ID_SINO_LITE_CONTROLLER      0x3008
        
        #define USB_VENDOR_ID_SOLID_YEAR                        0x060b
++++ +++#define USB_DEVICE_ID_MACALLY_IKEY_KEYBOARD             0x0001
        #define USB_DEVICE_ID_COUGAR_500K_GAMING_KEYBOARD       0x500a
        #define USB_DEVICE_ID_COUGAR_700K_GAMING_KEYBOARD       0x700a
        
        #define USB_DEVICE_ID_SYNAPTICS_HD      0x0ac3
        #define USB_DEVICE_ID_SYNAPTICS_QUAD_HD 0x1ac3
        #define USB_DEVICE_ID_SYNAPTICS_TP_V103 0x5710
       -#define I2C_DEVICE_ID_SYNAPTICS_7E7E    0x7e7e
        
        #define USB_VENDOR_ID_TEXAS_INSTRUMENTS 0x2047
        #define USB_DEVICE_ID_TEXAS_INSTRUMENTS_LENOVO_YOGA     0x0855
diff --combined include/linux/hid.h
index 2c69340d372dcd195d19cca4e968ce77c736acb1,ac0c70b4ce10a03adee0636738e7ef90da6966b6,f9707d1dcb584a8bf9cac4d614fef4659bb00b12,9f161fa5cbd4274791b2087b3ea4089f6ac747dc,f9707d1dcb584a8bf9cac4d614fef4659bb00b12,f9707d1dcb584a8bf9cac4d614fef4659bb00b12,f9707d1dcb584a8bf9cac4d614fef4659bb00b12,f9707d1dcb584a8bf9cac4d614fef4659bb00b12..ae9da674b7498e15ffe3e295c2eb7f61519d32c2
@@@@@@@@@ -382,6 -382,6 -382,6 -382,7 -382,6 -382,6 -382,6 -382,6 +382,7 @@@@@@@@@ struct hid_item 
        #define HID_GROUP_WACOM                         0x0101
        #define HID_GROUP_LOGITECH_DJ_DEVICE            0x0102
        #define HID_GROUP_STEAM                         0x0103
+++ ++++#define HID_GROUP_LOGITECH_27MHZ_DEVICE         0x0104
        
        /*
         * HID protocol status
@@@@@@@@@ -417,6 -417,7 -417,6 -418,6 -417,6 -417,6 -417,6 -417,6 +418,7 @@@@@@@@@ struct hid_global 
        
        struct hid_local {
                unsigned usage[HID_MAX_USAGES]; /* usage array */
+ ++++++        u8 usage_size[HID_MAX_USAGES]; /* usage size array */
                unsigned collection_index[HID_MAX_USAGES]; /* collection index array */
                unsigned usage_index;
                unsigned usage_minimum;
@@@@@@@@@ -893,7 -894,7 -893,7 -894,7 -893,7 -893,7 -893,7 -893,7 +895,7 @@@@@@@@@ struct hid_field *hidinput_get_led_fiel
        unsigned int hidinput_count_leds(struct hid_device *hid);
        __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code);
        void hid_output_report(struct hid_report *report, __u8 *data);
 -------void __hid_request(struct hid_device *hid, struct hid_report *rep, int reqtype);
 +++++++int __hid_request(struct hid_device *hid, struct hid_report *rep, int reqtype);
        u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags);
        struct hid_device *hid_allocate_device(void);
        struct hid_report *hid_register_report(struct hid_device *device,
This page took 0.096768 seconds and 4 git commands to generate.