]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jan 2011 17:58:38 +0000 (09:58 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jan 2011 17:58:38 +0000 (09:58 -0800)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: hid-multitouch: minor fixes based on additional review
  HID: Switch turbox/mosart touchscreen to hid-mosart
  HID: add Add Cando touch screen 10.1-inch product id
  HID: hid-mulitouch: add support for the 'Sensing Win7-TwoFinger'
  HID: hid-multitouch: add support for Cypress TrueTouch panels
  HID: hid-multitouch: support for PixCir-based panels
  HID: set HID_MAX_FIELD at 128
  HID: add feature_mapping callback

1  2 
drivers/hid/Kconfig
drivers/hid/Makefile
drivers/hid/hid-cando.c
drivers/hid/hid-core.c
drivers/hid/hid-ids.h
drivers/hid/hid-input.c
drivers/hid/hid-mosart.c
drivers/hid/usbhid/hid-quirks.c
include/linux/hid.h

diff --combined drivers/hid/Kconfig
index ffbc278647bfc21cc13f247c60fa912d9c631b1f,97c200b0f4b8a262d5c32489c05c0898062adffe..24cca2f69dfcfb54df9d4a9a02196f83a5b1242b
@@@ -150,16 -150,6 +150,16 @@@ config DRAGONRISE_F
        Say Y here if you want to enable force feedback support for DragonRise Inc.
        game controllers.
  
 +config HID_EMS_FF
 +      tristate "EMS Production Inc. force feedback support"
 +      depends on USB_HID
 +      select INPUT_FF_MEMLESS
 +      ---help---
 +      Say Y here if you want to enable force feedback support for devices by
 +      EMS Production Ltd.
 +      Currently the following devices are known to be supported:
 +       - Trio Linker Plus II
 +
  config HID_EGALAX
        tristate "eGalax multi-touch panel"
        depends on USB_HID
@@@ -295,6 -285,23 +295,23 @@@ config HID_MONTERE
        ---help---
        Support for Monterey Genius KB29E.
  
+ config HID_MULTITOUCH
+       tristate "HID Multitouch panels"
+       depends on USB_HID
+       ---help---
+         Generic support for HID multitouch panels.
+         Say Y here if you have one of the following devices:
+         - Cypress TrueTouch panels
+         - Hanvon dual touch panels
+         - Pixcir dual touch panels
+         - 'Sensing Win7-TwoFinger' panel by GeneralTouch
+         If unsure, say N.
+         To compile this driver as a module, choose M here: the
+         module will be called hid-multitouch.
  config HID_NTRIG
        tristate "N-Trig touch screen"
        depends on USB_HID
@@@ -407,13 -414,6 +424,13 @@@ config HID_ROCCAT_KON
        ---help---
        Support for Roccat Kone mouse.
  
 +config HID_ROCCAT_KONEPLUS
 +      tristate "Roccat Kone[+] mouse support"
 +      depends on USB_HID
 +      select HID_ROCCAT
 +      ---help---
 +      Support for Roccat Kone[+] mouse.
 +
  config HID_ROCCAT_PYRA
        tristate "Roccat Pyra mouse support"
        depends on USB_HID
diff --combined drivers/hid/Makefile
index 6eae9a90b8dd96f1769918453f219ac18367d2ea,ec991d475809832a39ddd17fff04a0b661150d16..6efc2a0370ad1e8e7ff575653a4778b53aab4eea
@@@ -1,7 -1,7 +1,7 @@@
  #
  # Makefile for the HID driver
  #
 -hid-objs                      := hid-core.o hid-input.o
 +hid-y                 := hid-core.o hid-input.o
  
  ifdef CONFIG_DEBUG_FS
        hid-objs                += hid-debug.o
@@@ -11,18 -11,18 +11,18 @@@ obj-$(CONFIG_HID)          += hid.
  
  hid-$(CONFIG_HIDRAW)          += hidraw.o
  
 -hid-logitech-objs             := hid-lg.o
 +hid-logitech-y                := hid-lg.o
  ifdef CONFIG_LOGITECH_FF
 -      hid-logitech-objs       += hid-lgff.o
 +      hid-logitech-y  += hid-lgff.o
  endif
  ifdef CONFIG_LOGIRUMBLEPAD2_FF
 -      hid-logitech-objs       += hid-lg2ff.o
 +      hid-logitech-y  += hid-lg2ff.o
  endif
  ifdef CONFIG_LOGIG940_FF
 -      hid-logitech-objs       += hid-lg3ff.o
 +      hid-logitech-y  += hid-lg3ff.o
  endif
  ifdef CONFIG_LOGIWII_FF
 -      hid-logitech-objs       += hid-lg4ff.o
 +      hid-logitech-y  += hid-lg4ff.o
  endif
  
  obj-$(CONFIG_HID_3M_PCT)      += hid-3m-pct.o
@@@ -35,7 -35,6 +35,7 @@@ obj-$(CONFIG_HID_CHERRY)      += hid-cherry.
  obj-$(CONFIG_HID_CHICONY)     += hid-chicony.o
  obj-$(CONFIG_HID_CYPRESS)     += hid-cypress.o
  obj-$(CONFIG_HID_DRAGONRISE)  += hid-drff.o
 +obj-$(CONFIG_HID_EMS_FF)      += hid-emsff.o
  obj-$(CONFIG_HID_EGALAX)      += hid-egalax.o
  obj-$(CONFIG_HID_ELECOM)      += hid-elecom.o
  obj-$(CONFIG_HID_EZKEY)               += hid-ezkey.o
@@@ -47,6 -46,7 +47,7 @@@ obj-$(CONFIG_HID_MAGICMOUSE)    += hid-
  obj-$(CONFIG_HID_MICROSOFT)   += hid-microsoft.o
  obj-$(CONFIG_HID_MONTEREY)    += hid-monterey.o
  obj-$(CONFIG_HID_MOSART)      += hid-mosart.o
+ obj-$(CONFIG_HID_MULTITOUCH)  += hid-multitouch.o
  obj-$(CONFIG_HID_NTRIG)               += hid-ntrig.o
  obj-$(CONFIG_HID_ORTEK)               += hid-ortek.o
  obj-$(CONFIG_HID_PRODIKEYS)   += hid-prodikeys.o
@@@ -56,7 -56,6 +57,7 @@@ obj-$(CONFIG_HID_PETALYNX)    += hid-petal
  obj-$(CONFIG_HID_PICOLCD)     += hid-picolcd.o
  obj-$(CONFIG_HID_ROCCAT)      += hid-roccat.o
  obj-$(CONFIG_HID_ROCCAT_KONE) += hid-roccat-kone.o
 +obj-$(CONFIG_HID_ROCCAT_KONEPLUS)     += hid-roccat-koneplus.o
  obj-$(CONFIG_HID_ROCCAT_PYRA) += hid-roccat-pyra.o
  obj-$(CONFIG_HID_SAMSUNG)     += hid-samsung.o
  obj-$(CONFIG_HID_SMARTJOYPLUS)        += hid-sjoy.o
diff --combined drivers/hid/hid-cando.c
index 375b50929a507ad30144a604402ae1ec4df19033,343c41bac80e9ec908a5c173dbd1f07e283e24fb..1ea066c552016eb75ba375dda55cfabf3f9e1ca0
@@@ -207,7 -207,7 +207,7 @@@ static int cando_probe(struct hid_devic
  
        td = kmalloc(sizeof(struct cando_data), GFP_KERNEL);
        if (!td) {
 -              dev_err(&hdev->dev, "cannot allocate Cando Touch data\n");
 +              hid_err(hdev, "cannot allocate Cando Touch data\n");
                return -ENOMEM;
        }
        hid_set_drvdata(hdev, td);
@@@ -235,6 -235,8 +235,8 @@@ static void cando_remove(struct hid_dev
  static const struct hid_device_id cando_devices[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
                        USB_DEVICE_ID_CANDO_MULTI_TOUCH) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
+                       USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
                        USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
diff --combined drivers/hid/hid-core.c
index 261168607c9196899c83ef9cb388f22765dff873,809060ede6d7b6454f4dc3c5f237fce2e2a5f2bb..d678cf3d33d5eaf80ab46a7ea58bcd369637c308
@@@ -14,8 -14,6 +14,8 @@@
   * any later version.
   */
  
 +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 +
  #include <linux/module.h>
  #include <linux/slab.h>
  #include <linux/init.h>
@@@ -61,8 -59,7 +61,8 @@@ struct hid_report *hid_register_report(
        if (report_enum->report_id_hash[id])
                return report_enum->report_id_hash[id];
  
 -      if (!(report = kzalloc(sizeof(struct hid_report), GFP_KERNEL)))
 +      report = kzalloc(sizeof(struct hid_report), GFP_KERNEL);
 +      if (!report)
                return NULL;
  
        if (id != 0)
@@@ -93,11 -90,8 +93,11 @@@ static struct hid_field *hid_register_f
                return NULL;
        }
  
 -      if (!(field = kzalloc(sizeof(struct hid_field) + usages * sizeof(struct hid_usage)
 -              + values * sizeof(unsigned), GFP_KERNEL))) return NULL;
 +      field = kzalloc((sizeof(struct hid_field) +
 +                       usages * sizeof(struct hid_usage) +
 +                       values * sizeof(unsigned)), GFP_KERNEL);
 +      if (!field)
 +              return NULL;
  
        field->index = report->maxfield++;
        report->field[field->index] = field;
@@@ -178,14 -172,10 +178,14 @@@ static int close_collection(struct hid_
  
  static unsigned hid_lookup_collection(struct hid_parser *parser, unsigned type)
  {
 +      struct hid_collection *collection = parser->device->collection;
        int n;
 -      for (n = parser->collection_stack_ptr - 1; n >= 0; n--)
 -              if (parser->device->collection[parser->collection_stack[n]].type == type)
 -                      return parser->device->collection[parser->collection_stack[n]].usage;
 +
 +      for (n = parser->collection_stack_ptr - 1; n >= 0; n--) {
 +              unsigned index = parser->collection_stack[n];
 +              if (collection[index].type == type)
 +                      return collection[index].usage;
 +      }
        return 0; /* we know nothing about this usage type */
  }
  
@@@ -219,8 -209,7 +219,8 @@@ static int hid_add_field(struct hid_par
        unsigned offset;
        int i;
  
 -      if (!(report = hid_register_report(parser->device, report_type, parser->global.report_id))) {
 +      report = hid_register_report(parser->device, report_type, parser->global.report_id);
 +      if (!report) {
                dbg_hid("hid_register_report failed\n");
                return -1;
        }
  
        usages = max_t(int, parser->local.usage_index, parser->global.report_count);
  
 -      if ((field = hid_register_field(report, usages, parser->global.report_count)) == NULL)
 +      field = hid_register_field(report, usages, parser->global.report_count);
 +      if (!field)
                return 0;
  
        field->physical = hid_lookup_collection(parser, HID_COLLECTION_PHYSICAL);
@@@ -664,12 -652,13 +664,12 @@@ int hid_parse_report(struct hid_device 
                return -ENOMEM;
        device->rsize = size;
  
 -      parser = vmalloc(sizeof(struct hid_parser));
 +      parser = vzalloc(sizeof(struct hid_parser));
        if (!parser) {
                ret = -ENOMEM;
                goto err;
        }
  
 -      memset(parser, 0, sizeof(struct hid_parser));
        parser->device = device;
  
        end = start + size;
  
                if (dispatch_type[item.type](parser, &item)) {
                        dbg_hid("item %u %u %u %u parsing failed\n",
 -                              item.format, (unsigned)item.size, (unsigned)item.type, (unsigned)item.tag);
 +                              item.format, (unsigned)item.size,
 +                              (unsigned)item.type, (unsigned)item.tag);
                        goto err;
                }
  
@@@ -749,14 -737,13 +749,14 @@@ static u32 s32ton(__s32 value, unsigne
   * Search linux-kernel and linux-usb-devel archives for "hid-core extract".
   */
  
 -static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n)
 +static __u32 extract(const struct hid_device *hid, __u8 *report,
 +                   unsigned offset, unsigned n)
  {
        u64 x;
  
        if (n > 32)
 -              printk(KERN_WARNING "HID: extract() called with n (%d) > 32! (%s)\n",
 -                              n, current->comm);
 +              hid_warn(hid, "extract() called with n (%d) > 32! (%s)\n",
 +                       n, current->comm);
  
        report += offset >> 3;  /* adjust byte index */
        offset &= 7;            /* now only need bit offset into one byte */
   * endianness of register values by considering a register
   * a "cached" copy of the little endiad bit stream.
   */
 -static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value)
 +static void implement(const struct hid_device *hid, __u8 *report,
 +                    unsigned offset, unsigned n, __u32 value)
  {
        u64 x;
        u64 m = (1ULL << n) - 1;
  
        if (n > 32)
 -              printk(KERN_WARNING "HID: implement() called with n (%d) > 32! (%s)\n",
 -                              n, current->comm);
 +              hid_warn(hid, "%s() called with n (%d) > 32! (%s)\n",
 +                       __func__, n, current->comm);
  
        if (value > m)
 -              printk(KERN_WARNING "HID: implement() called with too large value %d! (%s)\n",
 -                              value, current->comm);
 +              hid_warn(hid, "%s() called with too large value %d! (%s)\n",
 +                       __func__, value, current->comm);
        WARN_ON(value > m);
        value &= m;
  
   * Search an array for a value.
   */
  
 -static __inline__ int search(__s32 *array, __s32 value, unsigned n)
 +static int search(__s32 *array, __s32 value, unsigned n)
  {
        while (n--) {
                if (*array++ == value)
@@@ -901,22 -887,18 +901,22 @@@ static void hid_input_field(struct hid_
        __s32 max = field->logical_maximum;
        __s32 *value;
  
 -      if (!(value = kmalloc(sizeof(__s32) * count, GFP_ATOMIC)))
 +      value = kmalloc(sizeof(__s32) * count, GFP_ATOMIC);
 +      if (!value)
                return;
  
        for (n = 0; n < count; n++) {
  
 -                      value[n] = min < 0 ? snto32(extract(data, offset + n * size, size), size) :
 -                                                  extract(data, offset + n * size, size);
 +              value[n] = min < 0 ?
 +                      snto32(extract(hid, data, offset + n * size, size),
 +                             size) :
 +                      extract(hid, data, offset + n * size, size);
  
 -                      if (!(field->flags & HID_MAIN_ITEM_VARIABLE) /* Ignore report if ErrorRollOver */
 -                          && value[n] >= min && value[n] <= max
 -                          && field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1)
 -                              goto exit;
 +              /* Ignore report if ErrorRollOver */
 +              if (!(field->flags & HID_MAIN_ITEM_VARIABLE) &&
 +                  value[n] >= min && value[n] <= max &&
 +                  field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1)
 +                      goto exit;
        }
  
        for (n = 0; n < count; n++) {
@@@ -946,8 -928,7 +946,8 @@@ exit
   * Output the field into the report.
   */
  
 -static void hid_output_field(struct hid_field *field, __u8 *data)
 +static void hid_output_field(const struct hid_device *hid,
 +                           struct hid_field *field, __u8 *data)
  {
        unsigned count = field->report_count;
        unsigned offset = field->report_offset;
  
        for (n = 0; n < count; n++) {
                if (field->logical_minimum < 0) /* signed values */
 -                      implement(data, offset + n * size, size, s32ton(field->value[n], size));
 +                      implement(hid, data, offset + n * size, size,
 +                                s32ton(field->value[n], size));
                else                            /* unsigned values */
 -                      implement(data, offset + n * size, size, field->value[n]);
 +                      implement(hid, data, offset + n * size, size,
 +                                field->value[n]);
        }
  }
  
@@@ -977,7 -956,7 +977,7 @@@ void hid_output_report(struct hid_repor
  
        memset(data, 0, ((report->size - 1) >> 3) + 1);
        for (n = 0; n < report->maxfield; n++)
 -              hid_output_field(report->field[n], data);
 +              hid_output_field(report->device, report->field[n], data);
  }
  EXPORT_SYMBOL_GPL(hid_output_report);
  
@@@ -1190,7 -1169,8 +1190,7 @@@ int hid_connect(struct hid_device *hdev
                hdev->claimed |= HID_CLAIMED_HIDRAW;
  
        if (!hdev->claimed) {
 -              dev_err(&hdev->dev, "claimed by neither input, hiddev nor "
 -                              "hidraw\n");
 +              hid_err(hdev, "claimed by neither input, hiddev nor hidraw\n");
                return -ENODEV;
        }
  
                bus = "<UNKNOWN>";
        }
  
 -      dev_info(&hdev->dev, "%s: %s HID v%x.%02x %s [%s] on %s\n",
 -                      buf, bus, hdev->version >> 8, hdev->version & 0xff,
 -                      type, hdev->name, hdev->phys);
 +      hid_info(hdev, "%s: %s HID v%x.%02x %s [%s] on %s\n",
 +               buf, bus, hdev->version >> 8, hdev->version & 0xff,
 +               type, hdev->name, hdev->phys);
  
        return 0;
  }
@@@ -1250,7 -1230,7 +1250,7 @@@ void hid_disconnect(struct hid_device *
  EXPORT_SYMBOL_GPL(hid_disconnect);
  
  /* a list of devices for which there is a specialized driver on HID bus */
 -static const struct hid_device_id hid_blacklist[] = {
 +static const struct hid_device_id hid_have_special_driver[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M1968) },
        { HID_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M2256) },
        { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ISO) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_JIS) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
        { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) },
        { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE_2) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_PIXCIR_MULTI_TOUCH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_PRODIKEYS_PCMIDI) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_TRUETOUCH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
        { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1) },
        { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH3) },
        { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH4) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II) },
        { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0003) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0012) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_HANVON, USB_DEVICE_ID_HANVON_MULTITOUCH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
        { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONE) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPLUS) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
        { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) },
        { HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) },
        { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209) },
        { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U) },
        { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U) },
@@@ -1528,9 -1505,9 +1534,9 @@@ static int hid_bus_match(struct device 
        if (!hid_match_device(hdev, hdrv))
                return 0;
  
 -      /* generic wants all non-blacklisted */
 +      /* generic wants all that don't have specialized driver */
        if (!strncmp(hdrv->name, "generic-", 8))
 -              return !hid_match_id(hdev, hid_blacklist);
 +              return !hid_match_id(hdev, hid_have_special_driver);
  
        return 1;
  }
@@@ -1640,7 -1617,6 +1646,6 @@@ static const struct hid_device_id hid_i
        { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC4UM) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0001) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0002) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0003) },
        { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 0x0004) },
@@@ -1790,12 -1766,6 +1795,12 @@@ static const struct hid_device_id hid_m
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ISO) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_JIS) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
        { }
@@@ -1987,12 -1957,12 +1992,12 @@@ static int __init hid_init(void
        int ret;
  
        if (hid_debug)
 -              printk(KERN_WARNING "HID: hid_debug is now used solely for parser and driver debugging.\n"
 -                              "HID: debugfs is now used for inspecting the device (report descriptor, reports)\n");
 +              pr_warn("hid_debug is now used solely for parser and driver debugging.\n"
 +                      "debugfs is now used for inspecting the device (report descriptor, reports)\n");
  
        ret = bus_register(&hid_bus_type);
        if (ret) {
 -              printk(KERN_ERR "HID: can't register hid bus\n");
 +              pr_err("can't register hid bus\n");
                goto err;
        }
  
diff --combined drivers/hid/hid-ids.h
index f65cace777299933ba3b4b1eda2190f36d53c612,372b5cf2a92f0553f78fbcb9ed9ea48a125eb042..92a0d61a7379c9f315e63e58f98445b2c3bb033d
  #define USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI  0x0236
  #define USB_DEVICE_ID_APPLE_WELLSPRING3_ISO   0x0237
  #define USB_DEVICE_ID_APPLE_WELLSPRING3_JIS   0x0238
 +#define USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI  0x023f
 +#define USB_DEVICE_ID_APPLE_WELLSPRING4_ISO   0x0240
 +#define USB_DEVICE_ID_APPLE_WELLSPRING4_JIS   0x0241
 +#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI 0x0242
 +#define USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO  0x0243
 +#define USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS  0x0244
  #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI  0x0239
  #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO   0x023a
  #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS   0x023b
  #define USB_DEVICE_ID_BTC_EMPREX_REMOTE_2     0x5577
  
  #define USB_VENDOR_ID_CANDO           0x2087
+ #define USB_DEVICE_ID_CANDO_PIXCIR_MULTI_TOUCH 0x0703
  #define USB_DEVICE_ID_CANDO_MULTI_TOUCH       0x0a01
+ #define USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1 0x0a02
  #define USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6 0x0b03
  #define USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6 0x0f01
  
  #define USB_VENDOR_ID_CHICONY         0x04f2
  #define USB_DEVICE_ID_CHICONY_TACTICAL_PAD    0x0418
  #define USB_DEVICE_ID_CHICONY_MULTI_TOUCH     0xb19d
 +#define USB_DEVICE_ID_CHICONY_WIRELESS        0x0618
  
  #define USB_VENDOR_ID_CIDC            0x1677
  
  #define USB_DEVICE_ID_CYPRESS_BARCODE_1       0xde61
  #define USB_DEVICE_ID_CYPRESS_BARCODE_2       0xde64
  #define USB_DEVICE_ID_CYPRESS_BARCODE_3       0xbca1
+ #define USB_DEVICE_ID_CYPRESS_TRUETOUCH       0xc001
  
  #define USB_VENDOR_ID_DEALEXTREAME    0x10c5
  #define USB_DEVICE_ID_DEALEXTREAME_RADIO_SI4701       0x819a
  #define USB_VENDOR_ID_ELO             0x04E7
  #define USB_DEVICE_ID_ELO_TS2700      0x0020
  
 +#define USB_VENDOR_ID_EMS             0x2006
 +#define USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II 0x0118
 +
  #define USB_VENDOR_ID_ESSENTIAL_REALITY       0x0d7f
  #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100
  
  #define USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR        0x0002
  
  #define USB_VENDOR_ID_GENERAL_TOUCH   0x0dfc
+ #define USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS 0x0001
  
  #define USB_VENDOR_ID_GLAB            0x06c2
  #define USB_DEVICE_ID_4_PHIDGETSERVO_30       0x0038
  #define USB_DEVICE_ID_HANWANG_TABLET_FIRST    0x5000
  #define USB_DEVICE_ID_HANWANG_TABLET_LAST     0x8fff
  
+ #define USB_VENDOR_ID_HANVON          0x20b3
+ #define USB_DEVICE_ID_HANVON_MULTITOUCH       0x0a18
  #define USB_VENDOR_ID_HAPP            0x078b
  #define USB_DEVICE_ID_UGCI_DRIVING    0x0010
  #define USB_DEVICE_ID_UGCI_FLYING     0x0020
  
  #define USB_VENDOR_ID_ROCCAT          0x1e7d
  #define USB_DEVICE_ID_ROCCAT_KONE     0x2ced
 +#define USB_DEVICE_ID_ROCCAT_KONEPLUS 0x2d51
  #define USB_DEVICE_ID_ROCCAT_PYRA_WIRED       0x2c24
  #define USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS    0x2cf6
  
diff --combined drivers/hid/hid-input.c
index e60fdb88101fd7e6213c015e0526523050874ccc,8703b2cd27ca4318f7eae7a79fbc542c2cf6c13a..7f552bfad32c01a26bb52a239175a801754103bd
@@@ -290,6 -290,14 +290,14 @@@ static void hidinput_configure_usage(st
                goto ignore;
        }
  
+       if (field->report_type == HID_FEATURE_REPORT) {
+               if (device->driver->feature_mapping) {
+                       device->driver->feature_mapping(device, hidinput, field,
+                               usage);
+               }
+               goto ignore;
+       }
        if (device->driver->input_mapping) {
                int ret = device->driver->input_mapping(device, hidinput, field,
                                usage, &bit, &max);
  
                switch (field->application) {
                case HID_GD_MOUSE:
 -              case HID_GD_POINTER:  code += 0x110; break;
 +              case HID_GD_POINTER:  code += BTN_MOUSE; break;
                case HID_GD_JOYSTICK:
                                if (code <= 0xf)
                                        code += BTN_JOYSTICK;
                                else
                                        code += BTN_TRIGGER_HAPPY;
                                break;
 -              case HID_GD_GAMEPAD:  code += 0x130; break;
 +              case HID_GD_GAMEPAD:  code += BTN_GAMEPAD; break;
                default:
                        switch (field->physical) {
                        case HID_GD_MOUSE:
 -                      case HID_GD_POINTER:  code += 0x110; break;
 -                      case HID_GD_JOYSTICK: code += 0x120; break;
 -                      case HID_GD_GAMEPAD:  code += 0x130; break;
 -                      default:              code += 0x100;
 +                      case HID_GD_POINTER:  code += BTN_MOUSE; break;
 +                      case HID_GD_JOYSTICK: code += BTN_JOYSTICK; break;
 +                      case HID_GD_GAMEPAD:  code += BTN_GAMEPAD; break;
 +                      default:              code += BTN_MISC;
                        }
                }
  
@@@ -817,14 -825,14 +825,14 @@@ static int hidinput_open(struct input_d
  {
        struct hid_device *hid = input_get_drvdata(dev);
  
 -      return hid->ll_driver->open(hid);
 +      return hid_hw_open(hid);
  }
  
  static void hidinput_close(struct input_dev *dev)
  {
        struct hid_device *hid = input_get_drvdata(dev);
  
 -      hid->ll_driver->close(hid);
 +      hid_hw_close(hid);
  }
  
  /*
@@@ -839,7 -847,6 +847,6 @@@ int hidinput_connect(struct hid_device 
        struct hid_input *hidinput = NULL;
        struct input_dev *input_dev;
        int i, j, k;
-       int max_report_type = HID_OUTPUT_REPORT;
  
        INIT_LIST_HEAD(&hid->inputs);
  
                        return -1;
        }
  
-       if (hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS)
-               max_report_type = HID_INPUT_REPORT;
+       for (k = HID_INPUT_REPORT; k <= HID_FEATURE_REPORT; k++) {
+               if (k == HID_OUTPUT_REPORT &&
+                       hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS)
+                       continue;
  
-       for (k = HID_INPUT_REPORT; k <= max_report_type; k++)
                list_for_each_entry(report, &hid->report_enum[k].report_list, list) {
  
                        if (!report->maxfield)
                                if (!hidinput || !input_dev) {
                                        kfree(hidinput);
                                        input_free_device(input_dev);
 -                                      err_hid("Out of memory during hid input probe");
 +                                      hid_err(hid, "Out of memory during hid input probe\n");
                                        goto out_unwind;
                                }
  
                                hidinput = NULL;
                        }
                }
+       }
  
        if (hidinput && input_register_device(hidinput->input))
                goto out_cleanup;
diff --combined drivers/hid/hid-mosart.c
index 9fb050ce6f04fc8ee82f8c2f78bb07a2bab440ee,251eaa4eedb3d1ac0f83fc1eb88678af131646c0..aed7ffe36283981c29aad688d6a06dc8d7c3ab9b
@@@ -90,10 -90,6 +90,10 @@@ static int mosart_input_mapping(struct 
        case 0xff000000:
                /* ignore HID features */
                return -1;
 +
 +      case HID_UP_BUTTON:
 +              /* ignore buttons */
 +              return -1;
        }
  
        return 0;
@@@ -203,7 -199,7 +203,7 @@@ static int mosart_probe(struct hid_devi
  
        td = kmalloc(sizeof(struct mosart_data), GFP_KERNEL);
        if (!td) {
 -              dev_err(&hdev->dev, "cannot allocate MosArt data\n");
 +              hid_err(hdev, "cannot allocate MosArt data\n");
                return -ENOMEM;
        }
        td->valid = false;
        return ret;
  }
  
 +#ifdef CONFIG_PM
 +static int mosart_reset_resume(struct hid_device *hdev)
 +{
 +      struct hid_report_enum *re = hdev->report_enum
 +                                              + HID_FEATURE_REPORT;
 +      struct hid_report *r = re->report_id_hash[7];
 +
 +      r->field[0]->value[0] = 0x02;
 +      usbhid_submit_report(hdev, r, USB_DIR_OUT);
 +      return 0;
 +}
 +#endif
 +
  static void mosart_remove(struct hid_device *hdev)
  {
        hid_hw_stop(hdev);
  static const struct hid_device_id mosart_devices[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_T91MT) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUSTEK_MULTITOUCH_YFO) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART) },
        { }
  };
  MODULE_DEVICE_TABLE(hid, mosart_devices);
@@@ -275,9 -259,6 +276,9 @@@ static struct hid_driver mosart_driver 
        .input_mapped = mosart_input_mapped,
        .usage_table = mosart_grabbed_usages,
        .event = mosart_event,
 +#ifdef CONFIG_PM
 +      .reset_resume = mosart_reset_resume,
 +#endif
  };
  
  static int __init mosart_init(void)
index 76b9a149c7df6b46d7d990e7e5a27144ea78fced,af343760529c830383b4b2bcffdf610be552b8b2..9a94b643ccde7e7b62423d8b1ea0f878f3366be1
@@@ -35,7 -35,6 +35,6 @@@ static const struct hid_blacklist 
        { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD },
        { USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER, HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET },
        { USB_VENDOR_ID_MOJO, USB_DEVICE_ID_RETRO_ADAPTER, HID_QUIRK_MULTI_INPUT },
-       { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART, HID_QUIRK_MULTI_INPUT },
        { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
        { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
        { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
@@@ -85,7 -84,7 +84,7 @@@
        { USB_VENDOR_ID_PI_ENGINEERING, USB_DEVICE_ID_PI_ENGINEERING_VEC_USB_FOOTPEDAL, HID_QUIRK_HIDINPUT_FORCE },
  
        { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH, HID_QUIRK_MULTI_INPUT },
 -
 +      { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS, HID_QUIRK_MULTI_INPUT },
        { 0, 0 }
  };
  
diff --combined include/linux/hid.h
index 20b9801f669bf53750043b5402ecce92a680c25a,1ebc6e39f20def018b7a7db0aefc6b14ff34d311..d91c25e253c87e8f940e34d31d1eee854e7ce4bb
@@@ -402,7 -402,7 +402,7 @@@ struct hid_field 
        __u16 dpad;                     /* dpad input code */
  };
  
- #define HID_MAX_FIELDS 64
+ #define HID_MAX_FIELDS 128
  
  struct hid_report {
        struct list_head list;
@@@ -593,6 -593,7 +593,7 @@@ struct hid_usage_id 
   * @report_fixup: called before report descriptor parsing (NULL means nop)
   * @input_mapping: invoked on input registering before mapping an usage
   * @input_mapped: invoked on input registering after mapping an usage
+  * @feature_mapping: invoked on feature registering
   * @suspend: invoked on suspend (NULL means nop)
   * @resume: invoked on resume if device was not reset (NULL means nop)
   * @reset_resume: invoked on resume if device was reset (NULL means nop)
@@@ -636,6 -637,9 +637,9 @@@ struct hid_driver 
        int (*input_mapped)(struct hid_device *hdev,
                        struct hid_input *hidinput, struct hid_field *field,
                        struct hid_usage *usage, unsigned long **bit, int *max);
+       void (*feature_mapping)(struct hid_device *hdev,
+                       struct hid_input *hidinput, struct hid_field *field,
+                       struct hid_usage *usage);
  #ifdef CONFIG_PM
        int (*suspend)(struct hid_device *hdev, pm_message_t message);
        int (*resume)(struct hid_device *hdev);
@@@ -820,49 -824,6 +824,49 @@@ static inline void hid_hw_stop(struct h
        hdev->ll_driver->stop(hdev);
  }
  
 +/**
 + * hid_hw_open - signal underlaying HW to start delivering events
 + *
 + * @hdev: hid device
 + *
 + * Tell underlying HW to start delivering events from the device.
 + * This function should be called sometime after successful call
 + * to hid_hiw_start().
 + */
 +static inline int __must_check hid_hw_open(struct hid_device *hdev)
 +{
 +      return hdev->ll_driver->open(hdev);
 +}
 +
 +/**
 + * hid_hw_close - signal underlaying HW to stop delivering events
 + *
 + * @hdev: hid device
 + *
 + * This function indicates that we are not interested in the events
 + * from this device anymore. Delivery of events may or may not stop,
 + * depending on the number of users still outstanding.
 + */
 +static inline void hid_hw_close(struct hid_device *hdev)
 +{
 +      hdev->ll_driver->close(hdev);
 +}
 +
 +/**
 + * hid_hw_power - requests underlying HW to go into given power mode
 + *
 + * @hdev: hid device
 + * @level: requested power level (one of %PM_HINT_* defines)
 + *
 + * This function requests underlying hardware to enter requested power
 + * mode.
 + */
 +
 +static inline int hid_hw_power(struct hid_device *hdev, int level)
 +{
 +      return hdev->ll_driver->power ? hdev->ll_driver->power(hdev, level) : 0;
 +}
 +
  void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
                int interrupt);
  
@@@ -881,32 -842,12 +885,32 @@@ int hid_pidff_init(struct hid_device *h
  #define hid_pidff_init NULL
  #endif
  
 -#define dbg_hid(format, arg...) if (hid_debug) \
 -                              printk(KERN_DEBUG "%s: " format ,\
 -                              __FILE__ , ## arg)
 -#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
 -              __FILE__ , ## arg)
 -#endif /* HID_FF */
 +#define dbg_hid(format, arg...)                                               \
 +do {                                                                  \
 +      if (hid_debug)                                                  \
 +              printk(KERN_DEBUG "%s: " format, __FILE__, ##arg);      \
 +} while (0)
 +
 +#define hid_printk(level, hid, fmt, arg...)           \
 +      dev_printk(level, &(hid)->dev, fmt, ##arg)
 +#define hid_emerg(hid, fmt, arg...)                   \
 +      dev_emerg(&(hid)->dev, fmt, ##arg)
 +#define hid_crit(hid, fmt, arg...)                    \
 +      dev_crit(&(hid)->dev, fmt, ##arg)
 +#define hid_alert(hid, fmt, arg...)                   \
 +      dev_alert(&(hid)->dev, fmt, ##arg)
 +#define hid_err(hid, fmt, arg...)                     \
 +      dev_err(&(hid)->dev, fmt, ##arg)
 +#define hid_notice(hid, fmt, arg...)                  \
 +      dev_notice(&(hid)->dev, fmt, ##arg)
 +#define hid_warn(hid, fmt, arg...)                    \
 +      dev_warn(&(hid)->dev, fmt, ##arg)
 +#define hid_info(hid, fmt, arg...)                    \
 +      dev_info(&(hid)->dev, fmt, ##arg)
 +#define hid_dbg(hid, fmt, arg...)                     \
 +      dev_dbg(&(hid)->dev, fmt, ##arg)
 +
 +#endif /* __KERNEL__ */
  
  #endif