Commit a3cbe10e authored by Jiri Kosina's avatar Jiri Kosina

Merge branch 'upstream' into for-linus

Conflicts:
	drivers/hid/usbhid/hid-quirks.c
parents fa2bd301 86e6b77e
...@@ -307,7 +307,6 @@ config HID_LOGITECH ...@@ -307,7 +307,6 @@ config HID_LOGITECH
config HID_LOGITECH_DJ config HID_LOGITECH_DJ
tristate "Logitech Unifying receivers full support" tristate "Logitech Unifying receivers full support"
depends on HID_LOGITECH depends on HID_LOGITECH
default m
---help--- ---help---
Say Y if you want support for Logitech Unifying receivers and devices. Say Y if you want support for Logitech Unifying receivers and devices.
Unifying receivers are capable of pairing up to 6 Logitech compliant Unifying receivers are capable of pairing up to 6 Logitech compliant
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
*/ */
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com> * Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com>
*/ */
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
*/ */
#include <linux/device.h> #include <linux/device.h>
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
*/ */
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
*/ */
......
...@@ -126,7 +126,7 @@ static int open_collection(struct hid_parser *parser, unsigned type) ...@@ -126,7 +126,7 @@ static int open_collection(struct hid_parser *parser, unsigned type)
if (parser->collection_stack_ptr == HID_COLLECTION_STACK_SIZE) { if (parser->collection_stack_ptr == HID_COLLECTION_STACK_SIZE) {
hid_err(parser->device, "collection stack overflow\n"); hid_err(parser->device, "collection stack overflow\n");
return -1; return -EINVAL;
} }
if (parser->device->maxcollection == parser->device->collection_size) { if (parser->device->maxcollection == parser->device->collection_size) {
...@@ -134,7 +134,7 @@ static int open_collection(struct hid_parser *parser, unsigned type) ...@@ -134,7 +134,7 @@ static int open_collection(struct hid_parser *parser, unsigned type)
parser->device->collection_size * 2, GFP_KERNEL); parser->device->collection_size * 2, GFP_KERNEL);
if (collection == NULL) { if (collection == NULL) {
hid_err(parser->device, "failed to reallocate collection array\n"); hid_err(parser->device, "failed to reallocate collection array\n");
return -1; return -ENOMEM;
} }
memcpy(collection, parser->device->collection, memcpy(collection, parser->device->collection,
sizeof(struct hid_collection) * sizeof(struct hid_collection) *
...@@ -170,7 +170,7 @@ static int close_collection(struct hid_parser *parser) ...@@ -170,7 +170,7 @@ static int close_collection(struct hid_parser *parser)
{ {
if (!parser->collection_stack_ptr) { if (!parser->collection_stack_ptr) {
hid_err(parser->device, "collection stack underflow\n"); hid_err(parser->device, "collection stack underflow\n");
return -1; return -EINVAL;
} }
parser->collection_stack_ptr--; parser->collection_stack_ptr--;
return 0; return 0;
...@@ -374,7 +374,7 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) ...@@ -374,7 +374,7 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item)
case HID_GLOBAL_ITEM_TAG_REPORT_SIZE: case HID_GLOBAL_ITEM_TAG_REPORT_SIZE:
parser->global.report_size = item_udata(item); parser->global.report_size = item_udata(item);
if (parser->global.report_size > 96) { if (parser->global.report_size > 128) {
hid_err(parser->device, "invalid report_size %d\n", hid_err(parser->device, "invalid report_size %d\n",
parser->global.report_size); parser->global.report_size);
return -1; return -1;
...@@ -757,6 +757,7 @@ int hid_open_report(struct hid_device *device) ...@@ -757,6 +757,7 @@ int hid_open_report(struct hid_device *device)
struct hid_item item; struct hid_item item;
unsigned int size; unsigned int size;
__u8 *start; __u8 *start;
__u8 *buf;
__u8 *end; __u8 *end;
int ret; int ret;
static int (*dispatch_type[])(struct hid_parser *parser, static int (*dispatch_type[])(struct hid_parser *parser,
...@@ -775,12 +776,21 @@ int hid_open_report(struct hid_device *device) ...@@ -775,12 +776,21 @@ int hid_open_report(struct hid_device *device)
return -ENODEV; return -ENODEV;
size = device->dev_rsize; size = device->dev_rsize;
buf = kmemdup(start, size, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
if (device->driver->report_fixup) if (device->driver->report_fixup)
start = device->driver->report_fixup(device, start, &size); start = device->driver->report_fixup(device, buf, &size);
else
start = buf;
device->rdesc = kmemdup(start, size, GFP_KERNEL); start = kmemdup(start, size, GFP_KERNEL);
if (device->rdesc == NULL) kfree(buf);
if (start == NULL)
return -ENOMEM; return -ENOMEM;
device->rdesc = start;
device->rsize = size; device->rsize = size;
parser = vzalloc(sizeof(struct hid_parser)); parser = vzalloc(sizeof(struct hid_parser));
...@@ -1448,7 +1458,14 @@ void hid_disconnect(struct hid_device *hdev) ...@@ -1448,7 +1458,14 @@ void hid_disconnect(struct hid_device *hdev)
} }
EXPORT_SYMBOL_GPL(hid_disconnect); EXPORT_SYMBOL_GPL(hid_disconnect);
/* a list of devices for which there is a specialized driver on HID bus */ /*
* A list of devices for which there is a specialized driver on HID bus.
*
* Please note that for multitouch devices (driven by hid-multitouch driver),
* there is a proper autodetection and autoloading in place (based on presence
* of HID_DG_CONTACTID), so those devices don't need to be added to this list,
* as we are doing the right thing in hid_scan_usage().
*/
static const struct hid_device_id hid_have_special_driver[] = { static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) }, { 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_X5_005D) },
...@@ -1628,6 +1645,7 @@ static const struct hid_device_id hid_have_special_driver[] = { ...@@ -1628,6 +1645,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) }, { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
{ HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) }, { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
#if IS_ENABLED(CONFIG_HID_ROCCAT)
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONE) }, { 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_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) }, { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) },
...@@ -1636,6 +1654,7 @@ static const struct hid_device_id hid_have_special_driver[] = { ...@@ -1636,6 +1654,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) }, { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) }, { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_SAVU) }, { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_SAVU) },
#endif
{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) }, { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, { 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_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
*/ */
......
...@@ -911,15 +911,21 @@ static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f) ...@@ -911,15 +911,21 @@ static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f)
} }
static int hid_debug_rdesc_show(struct seq_file *f, void *p) static int hid_debug_rdesc_show(struct seq_file *f, void *p)
{ {
struct hid_device *hdev = f->private; struct hid_device *hdev = f->private;
const __u8 *rdesc = hdev->rdesc;
unsigned rsize = hdev->rsize;
int i; int i;
if (!rdesc) {
rdesc = hdev->dev_rdesc;
rsize = hdev->dev_rsize;
}
/* dump HID report descriptor */ /* dump HID report descriptor */
for (i = 0; i < hdev->rsize; i++) for (i = 0; i < rsize; i++)
seq_printf(f, "%02x ", hdev->rdesc[i]); seq_printf(f, "%02x ", rdesc[i]);
seq_printf(f, "\n\n"); seq_printf(f, "\n\n");
/* dump parsed data and input mappings */ /* dump parsed data and input mappings */
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
*/ */
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* Copyright (c) 1999 Andreas Gal * Copyright (c) 1999 Andreas Gal
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
* Copyright (c) 2006-2008 Jiri Kosina * Copyright (c) 2006-2008 Jiri Kosina
*/ */
......
...@@ -100,8 +100,7 @@ static void holtekff_send(struct holtekff_device *holtekff, ...@@ -100,8 +100,7 @@ static void holtekff_send(struct holtekff_device *holtekff,
holtekff->field->value[i] = data[i]; holtekff->field->value[i] = data[i];
} }
dbg_hid("sending %02x %02x %02x %02x %02x %02x %02x\n", data[0], dbg_hid("sending %*ph\n", 7, data);
data[1], data[2], data[3], data[4], data[5], data[6]);
usbhid_submit_report(hid, holtekff->field->report, USB_DIR_OUT); usbhid_submit_report(hid, holtekff->field->report, USB_DIR_OUT);
} }
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
*/ */
/* /*
...@@ -299,6 +298,9 @@ ...@@ -299,6 +298,9 @@
#define USB_VENDOR_ID_EZKEY 0x0518 #define USB_VENDOR_ID_EZKEY 0x0518
#define USB_DEVICE_ID_BTC_8193 0x0002 #define USB_DEVICE_ID_BTC_8193 0x0002
#define USB_VENDOR_ID_FREESCALE 0x15A2
#define USB_DEVICE_ID_FREESCALE_MX28 0x004F
#define USB_VENDOR_ID_FRUCTEL 0x25B6 #define USB_VENDOR_ID_FRUCTEL 0x25B6
#define USB_DEVICE_ID_GAMETEL_MT_MODE 0x0002 #define USB_DEVICE_ID_GAMETEL_MT_MODE 0x0002
...@@ -656,7 +658,6 @@ ...@@ -656,7 +658,6 @@
#define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH 0x3000 #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH 0x3000
#define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001 0x3001 #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001 0x3001
#define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008 0x3008 #define USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008 0x3008
#define USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN 0x3001
#define USB_VENDOR_ID_ROCCAT 0x1e7d #define USB_VENDOR_ID_ROCCAT 0x1e7d
#define USB_DEVICE_ID_ROCCAT_ARVO 0x30d4 #define USB_DEVICE_ID_ROCCAT_ARVO 0x30d4
......
...@@ -24,7 +24,7 @@ static int ts_input_mapping(struct hid_device *hdev, struct hid_input *hi, ...@@ -24,7 +24,7 @@ static int ts_input_mapping(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage, struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max) unsigned long **bit, int *max)
{ {
if ((usage->hid & HID_USAGE_PAGE) != 0x0ffbc0000) if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR)
return 0; return 0;
switch (usage->hid & HID_USAGE) { switch (usage->hid & HID_USAGE) {
......
...@@ -56,9 +56,8 @@ static int tpkbd_input_mapping(struct hid_device *hdev, ...@@ -56,9 +56,8 @@ static int tpkbd_input_mapping(struct hid_device *hdev,
static int tpkbd_features_set(struct hid_device *hdev) static int tpkbd_features_set(struct hid_device *hdev)
{ {
struct hid_report *report; struct hid_report *report;
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[4]; report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[4];
report->field[0]->value[0] = data_pointer->press_to_select ? 0x01 : 0x02; report->field[0]->value[0] = data_pointer->press_to_select ? 0x01 : 0x02;
...@@ -77,14 +76,8 @@ static ssize_t pointer_press_to_select_show(struct device *dev, ...@@ -77,14 +76,8 @@ static ssize_t pointer_press_to_select_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
hdev = container_of(dev, struct hid_device, dev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->press_to_select); return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->press_to_select);
} }
...@@ -94,16 +87,10 @@ static ssize_t pointer_press_to_select_store(struct device *dev, ...@@ -94,16 +87,10 @@ static ssize_t pointer_press_to_select_store(struct device *dev,
const char *buf, const char *buf,
size_t count) size_t count)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
int value; int value;
hdev = container_of(dev, struct hid_device, dev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
if (kstrtoint(buf, 10, &value)) if (kstrtoint(buf, 10, &value))
return -EINVAL; return -EINVAL;
if (value < 0 || value > 1) if (value < 0 || value > 1)
...@@ -119,14 +106,8 @@ static ssize_t pointer_dragging_show(struct device *dev, ...@@ -119,14 +106,8 @@ static ssize_t pointer_dragging_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
hdev = container_of(dev, struct hid_device, dev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->dragging); return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->dragging);
} }
...@@ -136,16 +117,10 @@ static ssize_t pointer_dragging_store(struct device *dev, ...@@ -136,16 +117,10 @@ static ssize_t pointer_dragging_store(struct device *dev,
const char *buf, const char *buf,
size_t count) size_t count)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
int value; int value;
hdev = container_of(dev, struct hid_device, dev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
if (kstrtoint(buf, 10, &value)) if (kstrtoint(buf, 10, &value))
return -EINVAL; return -EINVAL;
if (value < 0 || value > 1) if (value < 0 || value > 1)
...@@ -161,14 +136,8 @@ static ssize_t pointer_release_to_select_show(struct device *dev, ...@@ -161,14 +136,8 @@ static ssize_t pointer_release_to_select_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
hdev = container_of(dev, struct hid_device, dev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->release_to_select); return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->release_to_select);
} }
...@@ -178,16 +147,10 @@ static ssize_t pointer_release_to_select_store(struct device *dev, ...@@ -178,16 +147,10 @@ static ssize_t pointer_release_to_select_store(struct device *dev,
const char *buf, const char *buf,
size_t count) size_t count)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
int value; int value;
hdev = container_of(dev, struct hid_device, dev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
if (kstrtoint(buf, 10, &value)) if (kstrtoint(buf, 10, &value))
return -EINVAL; return -EINVAL;
if (value < 0 || value > 1) if (value < 0 || value > 1)
...@@ -203,14 +166,8 @@ static ssize_t pointer_select_right_show(struct device *dev, ...@@ -203,14 +166,8 @@ static ssize_t pointer_select_right_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
hdev = container_of(dev, struct hid_device, dev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->select_right); return snprintf(buf, PAGE_SIZE, "%u\n", data_pointer->select_right);
} }
...@@ -220,16 +177,10 @@ static ssize_t pointer_select_right_store(struct device *dev, ...@@ -220,16 +177,10 @@ static ssize_t pointer_select_right_store(struct device *dev,
const char *buf, const char *buf,
size_t count) size_t count)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
int value; int value;
hdev = container_of(dev, struct hid_device, dev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
if (kstrtoint(buf, 10, &value)) if (kstrtoint(buf, 10, &value))
return -EINVAL; return -EINVAL;
if (value < 0 || value > 1) if (value < 0 || value > 1)
...@@ -245,14 +196,8 @@ static ssize_t pointer_sensitivity_show(struct device *dev, ...@@ -245,14 +196,8 @@ static ssize_t pointer_sensitivity_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
hdev = container_of(dev, struct hid_device, dev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
return snprintf(buf, PAGE_SIZE, "%u\n", return snprintf(buf, PAGE_SIZE, "%u\n",
data_pointer->sensitivity); data_pointer->sensitivity);
...@@ -263,16 +208,10 @@ static ssize_t pointer_sensitivity_store(struct device *dev, ...@@ -263,16 +208,10 @@ static ssize_t pointer_sensitivity_store(struct device *dev,
const char *buf, const char *buf,
size_t count) size_t count)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
int value; int value;
hdev = container_of(dev, struct hid_device, dev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
if (kstrtoint(buf, 10, &value) || value < 1 || value > 255) if (kstrtoint(buf, 10, &value) || value < 1 || value > 255)
return -EINVAL; return -EINVAL;
...@@ -286,14 +225,10 @@ static ssize_t pointer_press_speed_show(struct device *dev, ...@@ -286,14 +225,10 @@ static ssize_t pointer_press_speed_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
hdev = container_of(dev, struct hid_device, dev); data_pointer = hid_get_drvdata(hdev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
return snprintf(buf, PAGE_SIZE, "%u\n", return snprintf(buf, PAGE_SIZE, "%u\n",
data_pointer->press_speed); data_pointer->press_speed);
...@@ -304,16 +239,10 @@ static ssize_t pointer_press_speed_store(struct device *dev, ...@@ -304,16 +239,10 @@ static ssize_t pointer_press_speed_store(struct device *dev,
const char *buf, const char *buf,
size_t count) size_t count)
{ {
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
int value; int value;
hdev = container_of(dev, struct hid_device, dev);
if (hdev == NULL)
return -ENODEV;
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
if (kstrtoint(buf, 10, &value) || value < 1 || value > 255) if (kstrtoint(buf, 10, &value) || value < 1 || value > 255)
return -EINVAL; return -EINVAL;
...@@ -370,15 +299,11 @@ static const struct attribute_group tpkbd_attr_group_pointer = { ...@@ -370,15 +299,11 @@ static const struct attribute_group tpkbd_attr_group_pointer = {
static enum led_brightness tpkbd_led_brightness_get( static enum led_brightness tpkbd_led_brightness_get(
struct led_classdev *led_cdev) struct led_classdev *led_cdev)
{ {
struct device *dev; struct device *dev = led_cdev->dev->parent;
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
int led_nr = 0; int led_nr = 0;
dev = led_cdev->dev->parent;
hdev = container_of(dev, struct hid_device, dev);
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
if (led_cdev == &data_pointer->led_micmute) if (led_cdev == &data_pointer->led_micmute)
led_nr = 1; led_nr = 1;
...@@ -390,16 +315,12 @@ static enum led_brightness tpkbd_led_brightness_get( ...@@ -390,16 +315,12 @@ static enum led_brightness tpkbd_led_brightness_get(
static void tpkbd_led_brightness_set(struct led_classdev *led_cdev, static void tpkbd_led_brightness_set(struct led_classdev *led_cdev,
enum led_brightness value) enum led_brightness value)
{ {
struct device *dev; struct device *dev = led_cdev->dev->parent;
struct hid_device *hdev; struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
struct hid_report *report; struct hid_report *report;
struct tpkbd_data_pointer *data_pointer;
int led_nr = 0; int led_nr = 0;
dev = led_cdev->dev->parent;
hdev = container_of(dev, struct hid_device, dev);
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
if (led_cdev == &data_pointer->led_micmute) if (led_cdev == &data_pointer->led_micmute)
led_nr = 1; led_nr = 1;
...@@ -508,13 +429,11 @@ static int tpkbd_probe(struct hid_device *hdev, ...@@ -508,13 +429,11 @@ static int tpkbd_probe(struct hid_device *hdev,
static void tpkbd_remove_tp(struct hid_device *hdev) static void tpkbd_remove_tp(struct hid_device *hdev)
{ {
struct tpkbd_data_pointer *data_pointer; struct tpkbd_data_pointer *data_pointer = hid_get_drvdata(hdev);
sysfs_remove_group(&hdev->dev.kobj, sysfs_remove_group(&hdev->dev.kobj,
&tpkbd_attr_group_pointer); &tpkbd_attr_group_pointer);
data_pointer = (struct tpkbd_data_pointer *) hid_get_drvdata(hdev);
led_classdev_unregister(&data_pointer->led_micmute); led_classdev_unregister(&data_pointer->led_micmute);
led_classdev_unregister(&data_pointer->led_mute); led_classdev_unregister(&data_pointer->led_mute);
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
* Copyright (c) 2010 Hendrik Iben * Copyright (c) 2010 Hendrik Iben
*/ */
...@@ -109,7 +108,7 @@ static __u8 dfp_rdesc_fixed[] = { ...@@ -109,7 +108,7 @@ static __u8 dfp_rdesc_fixed[] = {
static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize) unsigned int *rsize)
{ {
struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hdev); struct lg_drv_data *drv_data = hid_get_drvdata(hdev);
if ((drv_data->quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 && if ((drv_data->quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 &&
rdesc[84] == 0x8c && rdesc[85] == 0x02) { rdesc[84] == 0x8c && rdesc[85] == 0x02) {
...@@ -278,7 +277,7 @@ static int lg_input_mapping(struct hid_device *hdev, struct hid_input *hi, ...@@ -278,7 +277,7 @@ static int lg_input_mapping(struct hid_device *hdev, struct hid_input *hi,
0, 0, 0, 0, 0,183,184,185,186,187, 0, 0, 0, 0, 0,183,184,185,186,187,
188,189,190,191,192,193,194, 0, 0, 0 188,189,190,191,192,193,194, 0, 0, 0
}; };
struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hdev); struct lg_drv_data *drv_data = hid_get_drvdata(hdev);
unsigned int hid = usage->hid; unsigned int hid = usage->hid;
if (hdev->product == USB_DEVICE_ID_LOGITECH_RECEIVER && if (hdev->product == USB_DEVICE_ID_LOGITECH_RECEIVER &&
...@@ -319,7 +318,7 @@ static int lg_input_mapped(struct hid_device *hdev, struct hid_input *hi, ...@@ -319,7 +318,7 @@ static int lg_input_mapped(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage, struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max) unsigned long **bit, int *max)
{ {
struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hdev); struct lg_drv_data *drv_data = hid_get_drvdata(hdev);
if ((drv_data->quirks & LG_BAD_RELATIVE_KEYS) && usage->type == EV_KEY && if ((drv_data->quirks & LG_BAD_RELATIVE_KEYS) && usage->type == EV_KEY &&
(field->flags & HID_MAIN_ITEM_RELATIVE)) (field->flags & HID_MAIN_ITEM_RELATIVE))
...@@ -335,7 +334,7 @@ static int lg_input_mapped(struct hid_device *hdev, struct hid_input *hi, ...@@ -335,7 +334,7 @@ static int lg_input_mapped(struct hid_device *hdev, struct hid_input *hi,
static int lg_event(struct hid_device *hdev, struct hid_field *field, static int lg_event(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value) struct hid_usage *usage, __s32 value)
{ {
struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hdev); struct lg_drv_data *drv_data = hid_get_drvdata(hdev);
if ((drv_data->quirks & LG_INVERT_HWHEEL) && usage->code == REL_HWHEEL) { if ((drv_data->quirks & LG_INVERT_HWHEEL) && usage->code == REL_HWHEEL) {
input_event(field->hidinput->input, usage->type, usage->code, input_event(field->hidinput->input, usage->type, usage->code,
...@@ -419,7 +418,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -419,7 +418,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
static void lg_remove(struct hid_device *hdev) static void lg_remove(struct hid_device *hdev)
{ {
struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hdev); struct lg_drv_data *drv_data = hid_get_drvdata(hdev);
if (drv_data->quirks & LG_FF4) if (drv_data->quirks & LG_FF4)
lg4ff_deinit(hdev); lg4ff_deinit(hdev);
......
...@@ -423,7 +423,7 @@ static void lg4ff_led_set_brightness(struct led_classdev *led_cdev, ...@@ -423,7 +423,7 @@ static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,
{ {
struct device *dev = led_cdev->dev->parent; struct device *dev = led_cdev->dev->parent;
struct hid_device *hid = container_of(dev, struct hid_device, dev); struct hid_device *hid = container_of(dev, struct hid_device, dev);
struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hid); struct lg_drv_data *drv_data = hid_get_drvdata(hid);
struct lg4ff_device_entry *entry; struct lg4ff_device_entry *entry;
int i, state = 0; int i, state = 0;
...@@ -458,7 +458,7 @@ static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cde ...@@ -458,7 +458,7 @@ static enum led_brightness lg4ff_led_get_brightness(struct led_classdev *led_cde
{ {
struct device *dev = led_cdev->dev->parent; struct device *dev = led_cdev->dev->parent;
struct hid_device *hid = container_of(dev, struct hid_device, dev); struct hid_device *hid = container_of(dev, struct hid_device, dev);
struct lg_drv_data *drv_data = (struct lg_drv_data *)hid_get_drvdata(hid); struct lg_drv_data *drv_data = hid_get_drvdata(hid);
struct lg4ff_device_entry *entry; struct lg4ff_device_entry *entry;
int i, value = 0; int i, value = 0;
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
*/ */
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
*/ */
......
...@@ -882,10 +882,10 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -882,10 +882,10 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
nd->activate_slack = activate_slack; nd->activate_slack = activate_slack;
nd->act_state = activate_slack; nd->act_state = activate_slack;
nd->deactivate_slack = -deactivate_slack; nd->deactivate_slack = -deactivate_slack;
nd->sensor_logical_width = 0; nd->sensor_logical_width = 1;
nd->sensor_logical_height = 0; nd->sensor_logical_height = 1;
nd->sensor_physical_width = 0; nd->sensor_physical_width = 1;
nd->sensor_physical_height = 0; nd->sensor_physical_height = 1;
hid_set_drvdata(hdev, nd); hid_set_drvdata(hdev, nd);
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
*/ */
......
...@@ -64,29 +64,6 @@ static int px_raw_event(struct hid_device *hid, struct hid_report *report, ...@@ -64,29 +64,6 @@ static int px_raw_event(struct hid_device *hid, struct hid_report *report,
return 0; return 0;
} }
static int px_probe(struct hid_device *hid, const struct hid_device_id *id)
{
int ret;
ret = hid_parse(hid);
if (ret) {
hid_err(hid, "parse failed\n");
goto fail;
}
ret = hid_hw_start(hid, HID_CONNECT_DEFAULT);
if (ret)
hid_err(hid, "hw start failed\n");
fail:
return ret;
}
static void px_remove(struct hid_device *hid)
{
hid_hw_stop(hid);
}
static const struct hid_device_id px_devices[] = { static const struct hid_device_id px_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) }, { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
{ } { }
...@@ -97,8 +74,6 @@ static struct hid_driver px_driver = { ...@@ -97,8 +74,6 @@ static struct hid_driver px_driver = {
.name = "primax", .name = "primax",
.id_table = px_devices, .id_table = px_devices,
.raw_event = px_raw_event, .raw_event = px_raw_event,
.probe = px_probe,
.remove = px_remove,
}; };
static int __init px_init(void) static int __init px_init(void)
......
...@@ -105,7 +105,7 @@ static ssize_t show_channel(struct device *dev, ...@@ -105,7 +105,7 @@ static ssize_t show_channel(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct hid_device *hdev = container_of(dev, struct hid_device, dev); struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); struct pk_device *pk = hid_get_drvdata(hdev);
dbg_hid("pcmidi sysfs read channel=%u\n", pk->pm->midi_channel); dbg_hid("pcmidi sysfs read channel=%u\n", pk->pm->midi_channel);
...@@ -118,7 +118,7 @@ static ssize_t store_channel(struct device *dev, ...@@ -118,7 +118,7 @@ static ssize_t store_channel(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
struct hid_device *hdev = container_of(dev, struct hid_device, dev); struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); struct pk_device *pk = hid_get_drvdata(hdev);
unsigned channel = 0; unsigned channel = 0;
...@@ -142,7 +142,7 @@ static ssize_t show_sustain(struct device *dev, ...@@ -142,7 +142,7 @@ static ssize_t show_sustain(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct hid_device *hdev = container_of(dev, struct hid_device, dev); struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); struct pk_device *pk = hid_get_drvdata(hdev);
dbg_hid("pcmidi sysfs read sustain=%u\n", pk->pm->midi_sustain); dbg_hid("pcmidi sysfs read sustain=%u\n", pk->pm->midi_sustain);
...@@ -155,7 +155,7 @@ static ssize_t store_sustain(struct device *dev, ...@@ -155,7 +155,7 @@ static ssize_t store_sustain(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
struct hid_device *hdev = container_of(dev, struct hid_device, dev); struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); struct pk_device *pk = hid_get_drvdata(hdev);
unsigned sustain = 0; unsigned sustain = 0;
...@@ -181,7 +181,7 @@ static ssize_t show_octave(struct device *dev, ...@@ -181,7 +181,7 @@ static ssize_t show_octave(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct hid_device *hdev = container_of(dev, struct hid_device, dev); struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); struct pk_device *pk = hid_get_drvdata(hdev);
dbg_hid("pcmidi sysfs read octave=%d\n", pk->pm->midi_octave); dbg_hid("pcmidi sysfs read octave=%d\n", pk->pm->midi_octave);
...@@ -194,7 +194,7 @@ static ssize_t store_octave(struct device *dev, ...@@ -194,7 +194,7 @@ static ssize_t store_octave(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
struct hid_device *hdev = container_of(dev, struct hid_device, dev); struct hid_device *hdev = container_of(dev, struct hid_device, dev);
struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); struct pk_device *pk = hid_get_drvdata(hdev);
int octave = 0; int octave = 0;
...@@ -759,7 +759,7 @@ static int pk_input_mapping(struct hid_device *hdev, struct hid_input *hi, ...@@ -759,7 +759,7 @@ static int pk_input_mapping(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage, struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max) unsigned long **bit, int *max)
{ {
struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); struct pk_device *pk = hid_get_drvdata(hdev);
struct pcmidi_snd *pm; struct pcmidi_snd *pm;
pm = pk->pm; pm = pk->pm;
...@@ -777,7 +777,7 @@ static int pk_input_mapping(struct hid_device *hdev, struct hid_input *hi, ...@@ -777,7 +777,7 @@ static int pk_input_mapping(struct hid_device *hdev, struct hid_input *hi,
static int pk_raw_event(struct hid_device *hdev, struct hid_report *report, static int pk_raw_event(struct hid_device *hdev, struct hid_report *report,
u8 *data, int size) u8 *data, int size)
{ {
struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); struct pk_device *pk = hid_get_drvdata(hdev);
int ret = 0; int ret = 0;
if (1 == pk->pm->ifnum) { if (1 == pk->pm->ifnum) {
...@@ -858,7 +858,7 @@ static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -858,7 +858,7 @@ static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id)
static void pk_remove(struct hid_device *hdev) static void pk_remove(struct hid_device *hdev)
{ {
struct pk_device *pk = (struct pk_device *)hid_get_drvdata(hdev); struct pk_device *pk = hid_get_drvdata(hdev);
struct pcmidi_snd *pm; struct pcmidi_snd *pm;
pm = pk->pm; pm = pk->pm;
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
* Copyright (c) 2010 Don Prince <dhprince.devel@yahoo.co.uk> * Copyright (c) 2010 Don Prince <dhprince.devel@yahoo.co.uk>
* *
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* Copyright (c) 1999 Andreas Gal * Copyright (c) 1999 Andreas Gal
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
* Copyright (c) 2006-2008 Jiri Kosina * Copyright (c) 2006-2008 Jiri Kosina
*/ */
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby * Copyright (c) 2008 Jiri Slaby
*/ */
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
* Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
* Copyright (c) 2006-2007 Jiri Kosina * Copyright (c) 2006-2007 Jiri Kosina
* Copyright (c) 2007 Paul Walmsley
* Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com> * Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com>
* Copyright (c) 2006 Andrew Zabolotny <zap@homelink.ru> * Copyright (c) 2006 Andrew Zabolotny <zap@homelink.ru>
* Copyright (c) 2009 Bastien Nocera <hadess@hadess.net> * Copyright (c) 2009 Bastien Nocera <hadess@hadess.net>
......
...@@ -638,28 +638,6 @@ static __u8 sirius_battery_free_tablet_rdesc_fixed[] = { ...@@ -638,28 +638,6 @@ static __u8 sirius_battery_free_tablet_rdesc_fixed[] = {
0xC0 /* End Collection */ 0xC0 /* End Collection */
}; };
static int waltop_probe(struct hid_device *hdev,
const struct hid_device_id *id)
{
int ret;
ret = hid_parse(hdev);
if (ret) {
hid_err(hdev, "parse failed\n");
goto err;
}
ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
if (ret) {
hid_err(hdev, "hw start failed\n");
goto err;
}
return 0;
err:
return ret;
}
static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc, static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize) unsigned int *rsize)
{ {
...@@ -776,11 +754,6 @@ static int waltop_raw_event(struct hid_device *hdev, struct hid_report *report, ...@@ -776,11 +754,6 @@ static int waltop_raw_event(struct hid_device *hdev, struct hid_report *report,
return 0; return 0;
} }
static void waltop_remove(struct hid_device *hdev)
{
hid_hw_stop(hdev);
}
static const struct hid_device_id waltop_devices[] = { static const struct hid_device_id waltop_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) }, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },
...@@ -803,10 +776,8 @@ MODULE_DEVICE_TABLE(hid, waltop_devices); ...@@ -803,10 +776,8 @@ MODULE_DEVICE_TABLE(hid, waltop_devices);
static struct hid_driver waltop_driver = { static struct hid_driver waltop_driver = {
.name = "waltop", .name = "waltop",
.id_table = waltop_devices, .id_table = waltop_devices,
.probe = waltop_probe,
.report_fixup = waltop_report_fixup, .report_fixup = waltop_report_fixup,
.raw_event = waltop_raw_event, .raw_event = waltop_raw_event,
.remove = waltop_remove,
}; };
static int __init waltop_init(void) static int __init waltop_init(void)
......
...@@ -522,21 +522,28 @@ int __init hidraw_init(void) ...@@ -522,21 +522,28 @@ int __init hidraw_init(void)
if (result < 0) { if (result < 0) {
pr_warn("can't get major number\n"); pr_warn("can't get major number\n");
result = 0;
goto out; goto out;
} }
hidraw_class = class_create(THIS_MODULE, "hidraw"); hidraw_class = class_create(THIS_MODULE, "hidraw");
if (IS_ERR(hidraw_class)) { if (IS_ERR(hidraw_class)) {
result = PTR_ERR(hidraw_class); result = PTR_ERR(hidraw_class);
unregister_chrdev(hidraw_major, "hidraw"); goto error_cdev;
goto out;
} }
cdev_init(&hidraw_cdev, &hidraw_ops); cdev_init(&hidraw_cdev, &hidraw_ops);
cdev_add(&hidraw_cdev, dev_id, HIDRAW_MAX_DEVICES); result = cdev_add(&hidraw_cdev, dev_id, HIDRAW_MAX_DEVICES);
if (result < 0)
goto error_class;
out: out:
return result; return result;
error_class:
class_destroy(hidraw_class);
error_cdev:
unregister_chrdev_region(dev_id, HIDRAW_MAX_DEVICES);
goto out;
} }
void hidraw_exit(void) void hidraw_exit(void)
......
...@@ -1415,20 +1415,20 @@ static int hid_post_reset(struct usb_interface *intf) ...@@ -1415,20 +1415,20 @@ static int hid_post_reset(struct usb_interface *intf)
* configuration descriptors passed, we already know that * configuration descriptors passed, we already know that
* the size of the HID report descriptor has not changed. * the size of the HID report descriptor has not changed.
*/ */
rdesc = kmalloc(hid->rsize, GFP_KERNEL); rdesc = kmalloc(hid->dev_rsize, GFP_KERNEL);
if (!rdesc) { if (!rdesc) {
dbg_hid("couldn't allocate rdesc memory (post_reset)\n"); dbg_hid("couldn't allocate rdesc memory (post_reset)\n");
return 1; return 1;
} }
status = hid_get_class_descriptor(dev, status = hid_get_class_descriptor(dev,
interface->desc.bInterfaceNumber, interface->desc.bInterfaceNumber,
HID_DT_REPORT, rdesc, hid->rsize); HID_DT_REPORT, rdesc, hid->dev_rsize);
if (status < 0) { if (status < 0) {
dbg_hid("reading report descriptor failed (post_reset)\n"); dbg_hid("reading report descriptor failed (post_reset)\n");
kfree(rdesc); kfree(rdesc);
return 1; return 1;
} }
status = memcmp(rdesc, hid->rdesc, hid->rsize); status = memcmp(rdesc, hid->dev_rdesc, hid->dev_rsize);
kfree(rdesc); kfree(rdesc);
if (status != 0) { if (status != 0) {
dbg_hid("report descriptor changed\n"); dbg_hid("report descriptor changed\n");
......
...@@ -70,12 +70,13 @@ static const struct hid_blacklist { ...@@ -70,12 +70,13 @@ static const struct hid_blacklist {
{ USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET }, { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS, HID_QUIRK_NOGET }, { USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NOGET }, { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008, HID_QUIRK_NOGET }, { USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB, HID_QUIRK_NOGET }, { USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment