Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 13 Jul 2012 17:33:18 +0000 (10:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 13 Jul 2012 17:33:18 +0000 (10:33 -0700)
Pull input layer fixes from Dmitry Torokhov:
 "The changes are limited to adding new VID/PID combinations to drivers
  to enable support for new versions of hardware, most notably hardware
  found in new MacBook Pro Retina boxes."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: xpad - add Andamiro Pump It Up pad
  Input: xpad - add signature for Razer Onza Tournament Edition
  Input: xpad - handle all variations of Mad Catz Beat Pad
  Input: bcm5974 - Add support for 2012 MacBook Pro Retina
  HID: add support for 2012 MacBook Pro Retina

1  2 
drivers/hid/hid-apple.c
drivers/hid/hid-core.c
drivers/hid/hid-ids.h
drivers/input/joystick/xpad.c
drivers/input/mouse/bcm5974.c

diff --combined drivers/hid/hid-apple.c
index fa10f847f7dbf163ba5856c296690039ba07b242,899c71200bd92a9efec7b66cd76cb2157bd891b3..585344b6d33815632b8d477ebb1f0eb9e7f80818
@@@ -234,7 -234,7 +234,7 @@@ static int hidinput_apple_event(struct 
                }
        }
  
 -        if (iso_layout) {
 +      if (iso_layout) {
                if (asc->quirks & APPLE_ISO_KEYBOARD) {
                        trans = apple_find_translation(apple_iso_keyboard, usage->code);
                        if (trans) {
@@@ -458,9 -458,6 +458,9 @@@ static const struct hid_device_id apple
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO),
                .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN |
                        APPLE_ISO_KEYBOARD },
 +      { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
 +                              USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI),
 +              .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS),
                .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI),
                .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS),
                .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI),
+               .driver_data = APPLE_HAS_FN },
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO),
+               .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS),
+               .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
                .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
diff --combined drivers/hid/hid-core.c
index 6ac0286b53757cd80e0f8d713b7af7f332497ae3,054677b3d168852ce404c861b1a0165b0f574ff4..4c87276c8ddba2f2a6f072cb536e84f8b7a6d256
@@@ -230,16 -230,9 +230,16 @@@ static int hid_add_field(struct hid_par
                return -1;
        }
  
 -      if (parser->global.logical_maximum < parser->global.logical_minimum) {
 -              hid_err(parser->device, "logical range invalid %d %d\n",
 -                              parser->global.logical_minimum, parser->global.logical_maximum);
 +      /* Handle both signed and unsigned cases properly */
 +      if ((parser->global.logical_minimum < 0 &&
 +              parser->global.logical_maximum <
 +              parser->global.logical_minimum) ||
 +              (parser->global.logical_minimum >= 0 &&
 +              (__u32)parser->global.logical_maximum <
 +              (__u32)parser->global.logical_minimum)) {
 +              dbg_hid("logical range invalid 0x%x 0x%x\n",
 +                      parser->global.logical_minimum,
 +                      parser->global.logical_maximum);
                return -1;
        }
  
@@@ -553,11 -546,12 +553,11 @@@ static void hid_free_report(struct hid_
  }
  
  /*
 - * Free a device structure, all reports, and all fields.
 + * Close report. This function returns the device
 + * state to the point prior to hid_open_report().
   */
 -
 -static void hid_device_release(struct device *dev)
 +static void hid_close_report(struct hid_device *device)
  {
 -      struct hid_device *device = container_of(dev, struct hid_device, dev);
        unsigned i, j;
  
        for (i = 0; i < HID_REPORT_TYPES; i++) {
                        if (report)
                                hid_free_report(report);
                }
 +              memset(report_enum, 0, sizeof(*report_enum));
 +              INIT_LIST_HEAD(&report_enum->report_list);
        }
  
        kfree(device->rdesc);
 +      device->rdesc = NULL;
 +      device->rsize = 0;
 +
        kfree(device->collection);
 -      kfree(device);
 +      device->collection = NULL;
 +      device->collection_size = 0;
 +      device->maxcollection = 0;
 +      device->maxapplication = 0;
 +
 +      device->status &= ~HID_STAT_PARSED;
 +}
 +
 +/*
 + * Free a device structure, all reports, and all fields.
 + */
 +
 +static void hid_device_release(struct device *dev)
 +{
 +      struct hid_device *hid = container_of(dev, struct hid_device, dev);
 +
 +      hid_close_report(hid);
 +      kfree(hid->dev_rdesc);
 +      kfree(hid);
  }
  
  /*
@@@ -665,60 -636,6 +665,60 @@@ static u8 *fetch_item(__u8 *start, __u
        return NULL;
  }
  
 +static void hid_scan_usage(struct hid_device *hid, u32 usage)
 +{
 +      if (usage == HID_DG_CONTACTID)
 +              hid->group = HID_GROUP_MULTITOUCH;
 +}
 +
 +/*
 + * Scan a report descriptor before the device is added to the bus.
 + * Sets device groups and other properties that determine what driver
 + * to load.
 + */
 +static int hid_scan_report(struct hid_device *hid)
 +{
 +      unsigned int page = 0, delim = 0;
 +      __u8 *start = hid->dev_rdesc;
 +      __u8 *end = start + hid->dev_rsize;
 +      unsigned int u, u_min = 0, u_max = 0;
 +      struct hid_item item;
 +
 +      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;
 +                      }
 +              }
 +      }
 +
 +      return 0;
 +}
 +
  /**
   * hid_parse_report - parse device report
   *
   * @start: report start
   * @size: report size
   *
 + * Allocate the device report as read by the bus driver. This function should
 + * only be called from parse() in ll drivers.
 + */
 +int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size)
 +{
 +      hid->dev_rdesc = kmemdup(start, size, GFP_KERNEL);
 +      if (!hid->dev_rdesc)
 +              return -ENOMEM;
 +      hid->dev_rsize = size;
 +      return 0;
 +}
 +EXPORT_SYMBOL_GPL(hid_parse_report);
 +
 +/**
 + * hid_open_report - open a driver-specific device report
 + *
 + * @device: hid device
 + *
   * Parse a report description into a hid_device structure. Reports are
   * enumerated, fields are attached to these reports.
   * 0 returned on success, otherwise nonzero error value.
 + *
 + * This function (or the equivalent hid_parse() macro) should only be
 + * called from probe() in drivers, before starting the device.
   */
 -int hid_parse_report(struct hid_device *device, __u8 *start,
 -              unsigned size)
 +int hid_open_report(struct hid_device *device)
  {
        struct hid_parser *parser;
        struct hid_item item;
 +      unsigned int size;
 +      __u8 *start;
        __u8 *end;
        int ret;
        static int (*dispatch_type[])(struct hid_parser *parser,
                hid_parser_reserved
        };
  
 +      if (WARN_ON(device->status & HID_STAT_PARSED))
 +              return -EBUSY;
 +
 +      start = device->dev_rdesc;
 +      if (WARN_ON(!start))
 +              return -ENODEV;
 +      size = device->dev_rsize;
 +
        if (device->driver->report_fixup)
                start = device->driver->report_fixup(device, start, &size);
  
        parser->device = device;
  
        end = start + size;
 +
 +      device->collection = kcalloc(HID_DEFAULT_NUM_COLLECTIONS,
 +                                   sizeof(struct hid_collection), GFP_KERNEL);
 +      if (!device->collection) {
 +              ret = -ENOMEM;
 +              goto err;
 +      }
 +      device->collection_size = HID_DEFAULT_NUM_COLLECTIONS;
 +
        ret = -EINVAL;
        while ((start = fetch_item(start, end, &item)) != NULL) {
  
                                goto err;
                        }
                        vfree(parser);
 +                      device->status |= HID_STAT_PARSED;
                        return 0;
                }
        }
        hid_err(device, "item fetching failed at offset %d\n", (int)(end - start));
  err:
        vfree(parser);
 +      hid_close_report(device);
        return ret;
  }
 -EXPORT_SYMBOL_GPL(hid_parse_report);
 +EXPORT_SYMBOL_GPL(hid_open_report);
  
  /*
   * Convert a signed n-bit integer to signed 32-bit integer. Common
@@@ -1156,7 -1032,7 +1156,7 @@@ static struct hid_report *hid_get_repor
        return report;
  }
  
 -void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
 +int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
                int interrupt)
  {
        struct hid_report_enum *report_enum = hid->report_enum + type;
        unsigned int a;
        int rsize, csize = size;
        u8 *cdata = data;
 +      int ret = 0;
  
        report = hid_get_report(report_enum, data);
        if (!report)
 -              return;
 +              goto out;
  
        if (report_enum->numbered) {
                cdata++;
  
        if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event)
                hid->hiddev_report_event(hid, report);
 -      if (hid->claimed & HID_CLAIMED_HIDRAW)
 -              hidraw_report_event(hid, data, size);
 +      if (hid->claimed & HID_CLAIMED_HIDRAW) {
 +              ret = hidraw_report_event(hid, data, size);
 +              if (ret)
 +                      goto out;
 +      }
  
        for (a = 0; a < report->maxfield; a++)
                hid_input_field(hid, report->field[a], cdata, interrupt);
  
        if (hid->claimed & HID_CLAIMED_INPUT)
                hidinput_report_event(hid, report);
 +out:
 +      return ret;
  }
  EXPORT_SYMBOL_GPL(hid_report_raw_event);
  
@@@ -1277,7 -1147,7 +1277,7 @@@ nomem
                }
        }
  
 -      hid_report_raw_event(hid, type, data, size, interrupt);
 +      ret = hid_report_raw_event(hid, type, data, size, interrupt);
  
  unlock:
        up(&hid->driver_lock);
@@@ -1288,8 -1158,7 +1288,8 @@@ EXPORT_SYMBOL_GPL(hid_input_report)
  static bool hid_match_one_id(struct hid_device *hdev,
                const struct hid_device_id *id)
  {
 -      return id->bus == hdev->bus &&
 +      return (id->bus == HID_BUS_ANY || id->bus == hdev->bus) &&
 +              (id->group == HID_GROUP_ANY || id->group == hdev->group) &&
                (id->vendor == HID_ANY_ID || id->vendor == hdev->vendor) &&
                (id->product == HID_ANY_ID || id->product == hdev->product);
  }
@@@ -1365,6 -1234,10 +1365,6 @@@ int hid_connect(struct hid_device *hdev
        if ((connect_mask & HID_CONNECT_HIDINPUT) && !hidinput_connect(hdev,
                                connect_mask & HID_CONNECT_HIDINPUT_FORCE))
                hdev->claimed |= HID_CLAIMED_INPUT;
 -      if (hdev->quirks & HID_QUIRK_MULTITOUCH) {
 -              /* this device should be handled by hid-multitouch, skip it */
 -              return -ENODEV;
 -      }
  
        if ((connect_mask & HID_CONNECT_HIDDEV) && hdev->hiddev_connect &&
                        !hdev->hiddev_connect(hdev,
@@@ -1441,10 -1314,13 +1441,10 @@@ 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_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_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
        { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_RP_649) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_ACTIONSTAR, USB_DEVICE_ID_ACTIONSTAR_1011) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_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_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO) },
        { 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) },
 -      { 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_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) },
        { 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_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS2) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_CHUNGHWAT, USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_PRODIKEYS_PCMIDI) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_CVTOUCH, USB_DEVICE_ID_CVTOUCH_SCREEN) },
        { 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_DRAGONRISE, 0x0011) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_480D) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_480E) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_720C) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7224) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_725E) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_726B) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_72A1) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7302) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2515) },
        { 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_BLUETOOTH_DEVICE(USB_VENDOR_ID_FRUCTEL, USB_DEVICE_ID_GAMETEL_MT_MODE) },
        { 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_GOODTOUCH, USB_DEVICE_ID_GOODTOUCH_000f) },
        { 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_HANVON_ALT, USB_DEVICE_ID_HANVON_ALT_MULTITOUCH) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_IDEACOM, USB_DEVICE_ID_IDEACOM_IDC6650) },
        { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK, USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_ILITEK, USB_DEVICE_ID_ILITEK_MULTITOUCH) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_IRTOUCHSYSTEMS, USB_DEVICE_ID_IRTOUCH_INFRARED_USB) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
        { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_LG, USB_DEVICE_ID_LG_MULTITOUCH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_LUMIO, USB_DEVICE_ID_CRYSTALTOUCH) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_LUMIO, USB_DEVICE_ID_CRYSTALTOUCH_DUAL) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD_BOOTLOADER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500) },
        { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_PANASONIC, USB_DEVICE_ID_PANABOARD_UBT780) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_PANASONIC, USB_DEVICE_ID_PANABOARD_UBT880) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_PCI) },
        { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2) },
        { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_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_ARVO) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_STANTUM, USB_DEVICE_ID_MTP) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM, USB_DEVICE_ID_MTP_STM) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_SITRONIX, USB_DEVICE_ID_MTP_SITRONIX) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
        { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
        { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
        { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE) },
        { 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_TOUCH_INTL, USB_DEVICE_ID_TOUCH_INTL_MULTI_TOUCH) },
        { 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) },
        { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U) },
        { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_UNITEC, USB_DEVICE_ID_UNITEC_USB_TOUCH_0709) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_UNITEC, USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SUPER_JOY_BOX_3) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_PID_0038) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) },
        { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_XAT, USB_DEVICE_ID_XAT_CSR) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_XIROKU, USB_DEVICE_ID_XIROKU_SPX) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_XIROKU, USB_DEVICE_ID_XIROKU_MPX) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_XIROKU, USB_DEVICE_ID_XIROKU_CSR) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_XIROKU, USB_DEVICE_ID_XIROKU_SPX1) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_XIROKU, USB_DEVICE_ID_XIROKU_MPX1) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_XIROKU, USB_DEVICE_ID_XIROKU_CSR1) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_XIROKU, USB_DEVICE_ID_XIROKU_SPX2) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_XIROKU, USB_DEVICE_ID_XIROKU_MPX2) },
 -      { HID_USB_DEVICE(USB_VENDOR_ID_XIROKU, USB_DEVICE_ID_XIROKU_CSR2) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET) },
        { HID_USB_DEVICE(USB_VENDOR_ID_X_TENSIONS, USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },
@@@ -1703,7 -1634,6 +1706,7 @@@ static ssize_t store_new_id(struct devi
                return -ENOMEM;
  
        dynid->id.bus = bus;
 +      dynid->id.group = HID_GROUP_ANY;
        dynid->id.vendor = vendor;
        dynid->id.product = product;
        dynid->id.driver_data = driver_data;
@@@ -1752,7 -1682,18 +1755,7 @@@ static int hid_bus_match(struct device 
        struct hid_driver *hdrv = container_of(drv, struct hid_driver, driver);
        struct hid_device *hdev = container_of(dev, struct hid_device, dev);
  
 -      if ((hdev->quirks & HID_QUIRK_MULTITOUCH) &&
 -              !strncmp(hdrv->name, "hid-multitouch", 14))
 -              return 1;
 -
 -      if (!hid_match_device(hdev, hdrv))
 -              return 0;
 -
 -      /* generic wants all that don't have specialized driver */
 -      if (!strncmp(hdrv->name, "generic-", 8) && !hid_ignore_special_drivers)
 -              return !hid_match_id(hdev, hid_have_special_driver);
 -
 -      return 1;
 +      return hid_match_device(hdev, hdrv) != NULL;
  }
  
  static int hid_device_probe(struct device *dev)
        if (!hdev->driver) {
                id = hid_match_device(hdev, hdrv);
                if (id == NULL) {
 -                      if (!((hdev->quirks & HID_QUIRK_MULTITOUCH) &&
 -                              !strncmp(hdrv->name, "hid-multitouch", 14))) {
 -                              ret = -ENODEV;
 -                              goto unlock;
 -                      }
 +                      ret = -ENODEV;
 +                      goto unlock;
                }
  
                hdev->driver = hdrv;
                if (hdrv->probe) {
                        ret = hdrv->probe(hdev, id);
                } else { /* default probe */
 -                      ret = hid_parse(hdev);
 +                      ret = hid_open_report(hdev);
                        if (!ret)
                                ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
                }
 -              if (ret)
 +              if (ret) {
 +                      hid_close_report(hdev);
                        hdev->driver = NULL;
 +              }
        }
  unlock:
        up(&hdev->driver_lock);
@@@ -1805,7 -1747,6 +1808,7 @@@ static int hid_device_remove(struct dev
                        hdrv->remove(hdev);
                else /* default remove */
                        hid_hw_stop(hdev);
 +              hid_close_report(hdev);
                hdev->driver = NULL;
        }
  
        return 0;
  }
  
 +static ssize_t modalias_show(struct device *dev, struct device_attribute *a,
 +                           char *buf)
 +{
 +      struct hid_device *hdev = container_of(dev, struct hid_device, dev);
 +      int len;
 +
 +      len = snprintf(buf, PAGE_SIZE, "hid:b%04Xg%04Xv%08Xp%08X\n",
 +                     hdev->bus, hdev->group, hdev->vendor, hdev->product);
 +
 +      return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
 +}
 +
 +static struct device_attribute hid_dev_attrs[] = {
 +      __ATTR_RO(modalias),
 +      __ATTR_NULL,
 +};
 +
  static int hid_uevent(struct device *dev, struct kobj_uevent_env *env)
  {
        struct hid_device *hdev = container_of(dev, struct hid_device, dev);
        if (add_uevent_var(env, "HID_UNIQ=%s", hdev->uniq))
                return -ENOMEM;
  
 -      if (add_uevent_var(env, "MODALIAS=hid:b%04Xv%08Xp%08X",
 -                      hdev->bus, hdev->vendor, hdev->product))
 +      if (add_uevent_var(env, "MODALIAS=hid:b%04Xg%04Xv%08Xp%08X",
 +                         hdev->bus, hdev->group, hdev->vendor, hdev->product))
                return -ENOMEM;
  
        return 0;
  
  static struct bus_type hid_bus_type = {
        .name           = "hid",
 +      .dev_attrs      = hid_dev_attrs,
        .match          = hid_bus_match,
        .probe          = hid_device_probe,
        .remove         = hid_device_remove,
@@@ -1880,7 -1803,6 +1883,7 @@@ static const struct hid_device_id hid_i
        { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM)},
        { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_LCM2)},
        { HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) },
 +      { HID_USB_DEVICE(USB_VENDOR_ID_AXENTIA, USB_DEVICE_ID_AXENTIA_FM_RADIO) },
        { HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MCT) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HYBRID) },
        { HID_USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_HEATCONTROL) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_BEATPAD) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS) },
        { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1) },
@@@ -2089,6 -2012,9 +2093,9 @@@ static const struct hid_device_id hid_m
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_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) },
        { }
@@@ -2156,26 -2082,6 +2163,26 @@@ int hid_add_device(struct hid_device *h
              && (hid_ignore(hdev) || (hdev->quirks & HID_QUIRK_IGNORE)))
                return -ENODEV;
  
 +      /*
 +       * Read the device report descriptor once and use as template
 +       * for the driver-specific modifications.
 +       */
 +      ret = hdev->ll_driver->parse(hdev);
 +      if (ret)
 +              return ret;
 +      if (!hdev->dev_rdesc)
 +              return -ENODEV;
 +
 +      /*
 +       * Scan generic devices for group information
 +       */
 +      if (hid_ignore_special_drivers ||
 +          !hid_match_id(hdev, hid_have_special_driver)) {
 +              ret = hid_scan_report(hdev);
 +              if (ret)
 +                      hid_warn(hdev, "bad device descriptor (%d)\n", ret);
 +      }
 +
        /* XXX hack, any other cleaner solution after the driver core
         * is converted to allow more than 20 bytes as the device name? */
        dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus,
@@@ -2204,6 -2110,7 +2211,6 @@@ EXPORT_SYMBOL_GPL(hid_add_device)
  struct hid_device *hid_allocate_device(void)
  {
        struct hid_device *hdev;
 -      unsigned int i;
        int ret = -ENOMEM;
  
        hdev = kzalloc(sizeof(*hdev), GFP_KERNEL);
        hdev->dev.release = hid_device_release;
        hdev->dev.bus = &hid_bus_type;
  
 -      hdev->collection = kcalloc(HID_DEFAULT_NUM_COLLECTIONS,
 -                      sizeof(struct hid_collection), GFP_KERNEL);
 -      if (hdev->collection == NULL)
 -              goto err;
 -      hdev->collection_size = HID_DEFAULT_NUM_COLLECTIONS;
 -
 -      for (i = 0; i < HID_REPORT_TYPES; i++)
 -              INIT_LIST_HEAD(&hdev->report_enum[i].report_list);
 +      hid_close_report(hdev);
  
        init_waitqueue_head(&hdev->debug_wait);
        INIT_LIST_HEAD(&hdev->debug_list);
        sema_init(&hdev->driver_lock, 1);
  
        return hdev;
 -err:
 -      put_device(&hdev->dev);
 -      return ERR_PTR(ret);
  }
  EXPORT_SYMBOL_GPL(hid_allocate_device);
  
@@@ -2231,9 -2148,6 +2238,9 @@@ static void hid_remove_device(struct hi
                hid_debug_unregister(hdev);
                hdev->status &= ~HID_STAT_ADDED;
        }
 +      kfree(hdev->dev_rdesc);
 +      hdev->dev_rdesc = NULL;
 +      hdev->dev_rsize = 0;
  }
  
  /**
diff --combined drivers/hid/hid-ids.h
index d1cdd2d284095ea7d140f93822ab3de7a0694b98,dfd40981c86aeb92df6aa548b9aadb81cc8e4358..875ff451842b96f05cdeda4d6899b9d1ee18179c
  #define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI  0x024c
  #define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO   0x024d
  #define USB_DEVICE_ID_APPLE_WELLSPRING6_JIS   0x024e
+ #define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI  0x0262
+ #define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO   0x0263
+ #define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS   0x0264
  #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_ATMEL_MULTITOUCH        0x211c
  #define USB_DEVICE_ID_ATMEL_MXT_DIGITIZER     0x2118
  
 +#define USB_VENDOR_ID_AUREAL          0x0755
 +#define USB_DEVICE_ID_AUREAL_W01RN    0x2626
 +
  #define USB_VENDOR_ID_AVERMEDIA               0x07ca
  #define USB_DEVICE_ID_AVER_FM_MR800   0xb800
  
 +#define USB_VENDOR_ID_AXENTIA         0x12cf
 +#define USB_DEVICE_ID_AXENTIA_FM_RADIO        0x7111
 +
 +#define USB_VENDOR_ID_BAANTO          0x2453
 +#define USB_DEVICE_ID_BAANTO_MT_190W2 0x0100
 +
  #define USB_VENDOR_ID_BELKIN          0x050d
  #define USB_DEVICE_ID_FLIP_KVM                0x3201
  
  #define USB_DEVICE_ID_CRYSTALTOUCH    0x0006
  #define USB_DEVICE_ID_CRYSTALTOUCH_DUAL       0x0007
  
+ #define USB_VENDOR_ID_MADCATZ         0x0738
+ #define USB_DEVICE_ID_MADCATZ_BEATPAD 0x4540
  #define USB_VENDOR_ID_MCC             0x09db
  #define USB_DEVICE_ID_MCC_PMD1024LS   0x0076
  #define USB_DEVICE_ID_MCC_PMD1208LS   0x007a
  #define USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U  0x0004
  #define USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U  0x0005
  #define USB_DEVICE_ID_UCLOGIC_TABLET_WP1062   0x0064
 +#define USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850 0x0522
  
  #define USB_VENDOR_ID_UNITEC  0x227d
  #define USB_DEVICE_ID_UNITEC_USB_TOUCH_0709   0x0709
  #define USB_DEVICE_ID_WALTOP_PID_0038                 0x0038
  #define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH   0x0501
  #define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH   0x0500
 +#define USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET       0x0502
  
  #define USB_VENDOR_ID_WISEGROUP               0x0925
  #define USB_DEVICE_ID_SMARTJOY_PLUS   0x0005
index ee16fb67b7ae235bd9469bc50b9b0f588b99a2e4,42f7b257feb034df6b760042332d54703e992a17..83811e45d6339b013cc4f9cc16b90c5c66ba8af8
@@@ -142,6 -142,7 +142,7 @@@ static const struct xpad_device 
        { 0x0c12, 0x880a, "Pelican Eclipse PL-2023", 0, XTYPE_XBOX },
        { 0x0c12, 0x8810, "Zeroplus Xbox Controller", 0, XTYPE_XBOX },
        { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", 0, XTYPE_XBOX },
+       { 0x0d2f, 0x0002, "Andamiro Pump It Up pad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
        { 0x0e4c, 0x1097, "Radica Gamester Controller", 0, XTYPE_XBOX },
        { 0x0e4c, 0x2390, "Radica Games Jtech Controller", 0, XTYPE_XBOX },
        { 0x0e6f, 0x0003, "Logic3 Freebird wireless Controller", 0, XTYPE_XBOX },
        { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
        { 0x0f0d, 0x0016, "Hori Real Arcade Pro.EX", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
        { 0x0f0d, 0x000d, "Hori Fighting Stick EX2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
+       { 0x1689, 0xfd00, "Razer Onza Tournament Edition", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
        { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },
        { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN }
  };
@@@ -238,12 -240,14 +240,14 @@@ static struct usb_device_id xpad_table 
        XPAD_XBOX360_VENDOR(0x045e),            /* Microsoft X-Box 360 controllers */
        XPAD_XBOX360_VENDOR(0x046d),            /* Logitech X-Box 360 style controllers */
        XPAD_XBOX360_VENDOR(0x0738),            /* Mad Catz X-Box 360 controllers */
+       { USB_DEVICE(0x0738, 0x4540) },         /* Mad Catz Beat Pad */
        XPAD_XBOX360_VENDOR(0x0e6f),            /* 0x0e6f X-Box 360 controllers */
        XPAD_XBOX360_VENDOR(0x12ab),            /* X-Box 360 dance pads */
        XPAD_XBOX360_VENDOR(0x1430),            /* RedOctane X-Box 360 controllers */
        XPAD_XBOX360_VENDOR(0x146b),            /* BigBen Interactive Controllers */
        XPAD_XBOX360_VENDOR(0x1bad),            /* Harminix Rock Band Guitar and Drums */
-       XPAD_XBOX360_VENDOR(0x0f0d),            /* Hori Controllers */
+       XPAD_XBOX360_VENDOR(0x0f0d),            /* Hori Controllers */
+       XPAD_XBOX360_VENDOR(0x1689),            /* Razer Onza */
        { }
  };
  
@@@ -252,7 -256,6 +256,7 @@@ MODULE_DEVICE_TABLE (usb, xpad_table)
  struct usb_xpad {
        struct input_dev *dev;          /* input device interface */
        struct usb_device *udev;        /* usb device */
 +      struct usb_interface *intf;     /* usb interface */
  
        int pad_present;
  
@@@ -458,7 -461,6 +462,7 @@@ static void xpad360w_process_packet(str
  static void xpad_irq_in(struct urb *urb)
  {
        struct usb_xpad *xpad = urb->context;
 +      struct device *dev = &xpad->intf->dev;
        int retval, status;
  
        status = urb->status;
        case -ENOENT:
        case -ESHUTDOWN:
                /* this urb is terminated, clean up */
 -              dbg("%s - urb shutting down with status: %d",
 +              dev_dbg(dev, "%s - urb shutting down with status: %d\n",
                        __func__, status);
                return;
        default:
 -              dbg("%s - nonzero urb status received: %d",
 +              dev_dbg(dev, "%s - nonzero urb status received: %d\n",
                        __func__, status);
                goto exit;
        }
  exit:
        retval = usb_submit_urb(urb, GFP_ATOMIC);
        if (retval)
 -              err ("%s - usb_submit_urb failed with result %d",
 -                   __func__, retval);
 +              dev_err(dev, "%s - usb_submit_urb failed with result %d\n",
 +                      __func__, retval);
  }
  
  static void xpad_bulk_out(struct urb *urb)
  {
 +      struct usb_xpad *xpad = urb->context;
 +      struct device *dev = &xpad->intf->dev;
 +
        switch (urb->status) {
        case 0:
                /* success */
        case -ENOENT:
        case -ESHUTDOWN:
                /* this urb is terminated, clean up */
 -              dbg("%s - urb shutting down with status: %d", __func__, urb->status);
 +              dev_dbg(dev, "%s - urb shutting down with status: %d\n",
 +                      __func__, urb->status);
                break;
        default:
 -              dbg("%s - nonzero urb status received: %d", __func__, urb->status);
 +              dev_dbg(dev, "%s - nonzero urb status received: %d\n",
 +                      __func__, urb->status);
        }
  }
  
  #if defined(CONFIG_JOYSTICK_XPAD_FF) || defined(CONFIG_JOYSTICK_XPAD_LEDS)
  static void xpad_irq_out(struct urb *urb)
  {
 +      struct usb_xpad *xpad = urb->context;
 +      struct device *dev = &xpad->intf->dev;
        int retval, status;
  
        status = urb->status;
        case -ENOENT:
        case -ESHUTDOWN:
                /* this urb is terminated, clean up */
 -              dbg("%s - urb shutting down with status: %d", __func__, status);
 +              dev_dbg(dev, "%s - urb shutting down with status: %d\n",
 +                      __func__, status);
                return;
  
        default:
 -              dbg("%s - nonzero urb status received: %d", __func__, status);
 +              dev_dbg(dev, "%s - nonzero urb status received: %d\n",
 +                      __func__, status);
                goto exit;
        }
  
  exit:
        retval = usb_submit_urb(urb, GFP_ATOMIC);
        if (retval)
 -              err("%s - usb_submit_urb failed with result %d",
 -                  __func__, retval);
 +              dev_err(dev, "%s - usb_submit_urb failed with result %d\n",
 +                      __func__, retval);
  }
  
  static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad)
@@@ -665,8 -658,7 +669,8 @@@ static int xpad_play_effect(struct inpu
                        return usb_submit_urb(xpad->irq_out, GFP_ATOMIC);
  
                default:
 -                      dbg("%s - rumble command sent to unsupported xpad type: %d",
 +                      dev_dbg(&xpad->dev->dev,
 +                              "%s - rumble command sent to unsupported xpad type: %d\n",
                                __func__, xpad->xtype);
                        return -1;
                }
@@@ -856,7 -848,6 +860,7 @@@ static int xpad_probe(struct usb_interf
        }
  
        xpad->udev = udev;
 +      xpad->intf = intf;
        xpad->mapping = xpad_device[i].mapping;
        xpad->xtype = xpad_device[i].xtype;
  
index 2cf681d98c0d2d6433a6f8d11c502935d40c202a,e410b98c2271dcd4d406a042000f8374eb3ee9af..d528c23e194f6efcbe7efbe8651d218aa6ef7965
  #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI 0x0252
  #define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO  0x0253
  #define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS  0x0254
+ /* MacbookPro10,1 (unibody, June 2012) */
+ #define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI  0x0262
+ #define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO   0x0263
+ #define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS   0x0264
  
  #define BCM5974_DEVICE(prod) {                                        \
        .match_flags = (USB_DEVICE_ID_MATCH_DEVICE |            \
@@@ -128,6 -132,10 +132,10 @@@ static const struct usb_device_id bcm59
        BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI),
        BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO),
        BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS),
+       /* MacbookPro10,1 */
+       BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI),
+       BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ISO),
+       BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_JIS),
        /* Terminating entry */
        {}
  };
@@@ -354,6 -362,18 +362,18 @@@ static const struct bcm5974_config bcm5
                { DIM_X, DIM_X / SN_COORD, -4620, 5140 },
                { DIM_Y, DIM_Y / SN_COORD, -150, 6600 }
        },
+       {
+               USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI,
+               USB_DEVICE_ID_APPLE_WELLSPRING7_ISO,
+               USB_DEVICE_ID_APPLE_WELLSPRING7_JIS,
+               HAS_INTEGRATED_BUTTON,
+               0x84, sizeof(struct bt_data),
+               0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
+               { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 },
+               { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
+               { DIM_X, DIM_X / SN_COORD, -4750, 5280 },
+               { DIM_Y, DIM_Y / SN_COORD, -150, 6730 }
+       },
        {}
  };
  
@@@ -584,7 -604,7 +604,7 @@@ static int bcm5974_wellspring_mode(stru
        int retval = 0, size;
  
        if (!data) {
 -              err("bcm5974: out of memory");
 +              dev_err(&dev->intf->dev, "out of memory\n");
                retval = -ENOMEM;
                goto out;
        }
                        BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000);
  
        if (size != 8) {
 -              err("bcm5974: could not read from device");
 +              dev_err(&dev->intf->dev, "could not read from device\n");
                retval = -EIO;
                goto out;
        }
                        BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000);
  
        if (size != 8) {
 -              err("bcm5974: could not write to device");
 +              dev_err(&dev->intf->dev, "could not write to device\n");
                retval = -EIO;
                goto out;
        }
  static void bcm5974_irq_button(struct urb *urb)
  {
        struct bcm5974 *dev = urb->context;
 +      struct usb_interface *intf = dev->intf;
        int error;
  
        switch (urb->status) {
        case -ECONNRESET:
        case -ENOENT:
        case -ESHUTDOWN:
 -              dbg("bcm5974: button urb shutting down: %d", urb->status);
 +              dev_dbg(&intf->dev, "button urb shutting down: %d\n",
 +                      urb->status);
                return;
        default:
 -              dbg("bcm5974: button urb status: %d", urb->status);
 +              dev_dbg(&intf->dev, "button urb status: %d\n", urb->status);
                goto exit;
        }
  
  exit:
        error = usb_submit_urb(dev->bt_urb, GFP_ATOMIC);
        if (error)
 -              err("bcm5974: button urb failed: %d", error);
 +              dev_err(&intf->dev, "button urb failed: %d\n", error);
  }
  
  static void bcm5974_irq_trackpad(struct urb *urb)
  {
        struct bcm5974 *dev = urb->context;
 +      struct usb_interface *intf = dev->intf;
        int error;
  
        switch (urb->status) {
        case -ECONNRESET:
        case -ENOENT:
        case -ESHUTDOWN:
 -              dbg("bcm5974: trackpad urb shutting down: %d", urb->status);
 +              dev_dbg(&intf->dev, "trackpad urb shutting down: %d\n",
 +                      urb->status);
                return;
        default:
 -              dbg("bcm5974: trackpad urb status: %d", urb->status);
 +              dev_dbg(&intf->dev, "trackpad urb status: %d\n", urb->status);
                goto exit;
        }
  
  exit:
        error = usb_submit_urb(dev->tp_urb, GFP_ATOMIC);
        if (error)
 -              err("bcm5974: trackpad urb failed: %d", error);
 +              dev_err(&intf->dev, "trackpad urb failed: %d\n", error);
  }
  
  /*
@@@ -837,7 -853,7 +857,7 @@@ static int bcm5974_probe(struct usb_int
        dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL);
        input_dev = input_allocate_device();
        if (!dev || !input_dev) {
 -              err("bcm5974: out of memory");
 +              dev_err(&iface->dev, "out of memory\n");
                goto err_free_devs;
        }