Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56ccd186 authored by Jiri Kosina's avatar Jiri Kosina
Browse files

Merge branch 'upstream' into for-linus

Conflicts:
	drivers/hid/hid-core.c
parents b3d07e03 d1257081
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -104,6 +104,12 @@ config HID_APPLE
	Say Y here if you want support for keyboards of	Apple iBooks, PowerBooks,
	Say Y here if you want support for keyboards of	Apple iBooks, PowerBooks,
	MacBooks, MacBook Pros and Apple Aluminum.
	MacBooks, MacBook Pros and Apple Aluminum.


config HID_AUREAL
	tristate "Aureal"
	depends on USB_HID
	---help---
	Support for Aureal Cy se W-01RN Remote Controller and other Aureal derived remotes.

config HID_BELKIN
config HID_BELKIN
	tristate "Belkin Flip KVM and Wireless keyboard" if EXPERT
	tristate "Belkin Flip KVM and Wireless keyboard" if EXPERT
	depends on USB_HID
	depends on USB_HID
+1 −0
Original line number Original line Diff line number Diff line
@@ -38,6 +38,7 @@ endif
obj-$(CONFIG_HID_A4TECH)	+= hid-a4tech.o
obj-$(CONFIG_HID_A4TECH)	+= hid-a4tech.o
obj-$(CONFIG_HID_ACRUX)		+= hid-axff.o
obj-$(CONFIG_HID_ACRUX)		+= hid-axff.o
obj-$(CONFIG_HID_APPLE)		+= hid-apple.o
obj-$(CONFIG_HID_APPLE)		+= hid-apple.o
obj-$(CONFIG_HID_AUREAL)        += hid-aureal.o
obj-$(CONFIG_HID_BELKIN)	+= hid-belkin.o
obj-$(CONFIG_HID_BELKIN)	+= hid-belkin.o
obj-$(CONFIG_HID_CHERRY)	+= hid-cherry.o
obj-$(CONFIG_HID_CHERRY)	+= hid-cherry.o
obj-$(CONFIG_HID_CHICONY)	+= hid-chicony.o
obj-$(CONFIG_HID_CHICONY)	+= hid-chicony.o
+54 −0
Original line number Original line Diff line number Diff line
/*
 *  HID driver for Aureal Cy se W-01RN USB_V3.1 devices
 *
 *  Copyright (c) 2010 Franco Catrin <fcatrin@gmail.com>
 *  Copyright (c) 2010 Ben Cropley <bcropley@internode.on.net>
 *
 *  Based on HID sunplus driver by
 *  Copyright (c) 1999 Andreas Gal
 *  Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
 *  Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
 *  Copyright (c) 2006-2007 Jiri Kosina
 *  Copyright (c) 2007 Paul Walmsley
 *  Copyright (c) 2008 Jiri Slaby
 */
#include <linux/device.h>
#include <linux/hid.h>
#include <linux/module.h>

#include "hid-ids.h"

static __u8 *aureal_report_fixup(struct hid_device *hdev, __u8 *rdesc,
		unsigned int *rsize)
{
	if (*rsize >= 54 && rdesc[52] == 0x25 && rdesc[53] == 0x01) {
		dev_info(&hdev->dev, "fixing Aureal Cy se W-01RN USB_V3.1 report descriptor.\n");
		rdesc[53] = 0x65;
	} return rdesc;
}

static const struct hid_device_id aureal_devices[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) },
	{ }
};
MODULE_DEVICE_TABLE(hid, aureal_devices);

static struct hid_driver aureal_driver = {
	.name = "aureal",
	.id_table = aureal_devices,
	.report_fixup = aureal_report_fixup,
};

static int __init aureal_init(void)
{
	return hid_register_driver(&aureal_driver);
}

static void __exit aureal_exit(void)
{
	hid_unregister_driver(&aureal_driver);
}

module_init(aureal_init);
module_exit(aureal_exit);
MODULE_LICENSE("GPL");
+23 −8
Original line number Original line Diff line number Diff line
@@ -230,9 +230,16 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign
		return -1;
		return -1;
	}
	}


	if (parser->global.logical_maximum < parser->global.logical_minimum) {
	/* Handle both signed and unsigned cases properly */
		hid_err(parser->device, "logical range invalid %d %d\n",
	if ((parser->global.logical_minimum < 0 &&
				parser->global.logical_minimum, parser->global.logical_maximum);
		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;
		return -1;
	}
	}


@@ -1149,7 +1156,7 @@ static struct hid_report *hid_get_report(struct hid_report_enum *report_enum,
	return report;
	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)
		int interrupt)
{
{
	struct hid_report_enum *report_enum = hid->report_enum + type;
	struct hid_report_enum *report_enum = hid->report_enum + type;
@@ -1157,10 +1164,11 @@ void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
	unsigned int a;
	unsigned int a;
	int rsize, csize = size;
	int rsize, csize = size;
	u8 *cdata = data;
	u8 *cdata = data;
	int ret = 0;


	report = hid_get_report(report_enum, data);
	report = hid_get_report(report_enum, data);
	if (!report)
	if (!report)
		return;
		goto out;


	if (report_enum->numbered) {
	if (report_enum->numbered) {
		cdata++;
		cdata++;
@@ -1180,14 +1188,19 @@ void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,


	if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event)
	if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event)
		hid->hiddev_report_event(hid, report);
		hid->hiddev_report_event(hid, report);
	if (hid->claimed & HID_CLAIMED_HIDRAW)
	if (hid->claimed & HID_CLAIMED_HIDRAW) {
		hidraw_report_event(hid, data, size);
		ret = hidraw_report_event(hid, data, size);
		if (ret)
			goto out;
	}


	for (a = 0; a < report->maxfield; a++)
	for (a = 0; a < report->maxfield; a++)
		hid_input_field(hid, report->field[a], cdata, interrupt);
		hid_input_field(hid, report->field[a], cdata, interrupt);


	if (hid->claimed & HID_CLAIMED_INPUT)
	if (hid->claimed & HID_CLAIMED_INPUT)
		hidinput_report_event(hid, report);
		hidinput_report_event(hid, report);
out:
	return ret;
}
}
EXPORT_SYMBOL_GPL(hid_report_raw_event);
EXPORT_SYMBOL_GPL(hid_report_raw_event);


@@ -1264,7 +1277,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
		}
		}
	}
	}


	hid_report_raw_event(hid, type, data, size, interrupt);
	ret = hid_report_raw_event(hid, type, data, size, interrupt);


unlock:
unlock:
	up(&hid->driver_lock);
	up(&hid->driver_lock);
@@ -1496,6 +1509,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO) },
	{ 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_FOUNTAIN_TP_ONLY) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
	{ 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_BELKIN, USB_DEVICE_ID_FLIP_KVM) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_BAANTO, USB_DEVICE_ID_BAANTO_MT_190W2), },
	{ HID_USB_DEVICE(USB_VENDOR_ID_BAANTO, USB_DEVICE_ID_BAANTO_MT_190W2), },
	{ 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) },
@@ -1631,6 +1645,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
	{ 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_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_WP8060U) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) },
	{ 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_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_SUPER_JOY_BOX_3) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD) },
+4 −0
Original line number Original line Diff line number Diff line
@@ -154,6 +154,9 @@
#define USB_DEVICE_ID_ATMEL_MULTITOUCH	0x211c
#define USB_DEVICE_ID_ATMEL_MULTITOUCH	0x211c
#define USB_DEVICE_ID_ATMEL_MXT_DIGITIZER	0x2118
#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_VENDOR_ID_AVERMEDIA		0x07ca
#define USB_DEVICE_ID_AVER_FM_MR800	0xb800
#define USB_DEVICE_ID_AVER_FM_MR800	0xb800


@@ -729,6 +732,7 @@
#define USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U	0x0004
#define USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U	0x0004
#define USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U	0x0005
#define USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U	0x0005
#define USB_DEVICE_ID_UCLOGIC_TABLET_WP1062	0x0064
#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_VENDOR_ID_UNITEC	0x227d
#define USB_DEVICE_ID_UNITEC_USB_TOUCH_0709	0x0709
#define USB_DEVICE_ID_UNITEC_USB_TOUCH_0709	0x0709
Loading