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

Commit 3366dd9f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull HID updates from Jiri Kosina:
 - HID battery handling cleanup by David Herrmann
 - ELO 4000/4500 driver, which has been finally ported to be proper HID
   driver by Jiri Slaby
 - ps3remote driver functionality is now provided by generic sony
   driver, by Jiri Kosina
 - PS2/3 Buzz controllers support, by Colin Leitner
 - rework of wiimote driver including full extensions hotpluggin
   support, sub-device modularization and speaker support by David
   Herrmann

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (55 commits)
  HID: wacom: Intuos4 battery charging changes
  HID: i2c-hid: support sending HID output reports using the output register
  HID: kye: Add report fixup for Genius Gila Gaming mouse
  HID: wiimote: support Nintendo Wii U Pro Controller
  Input: make gamepad API keycodes more clear
  input: document gamepad API and add extra keycodes
  HID: explain out-of-range check better
  HID: fix false positive out of range values
  HID: wiimote: fix coccinelle warnings
  HID: roccat: check cdev_add return value
  HID: fold ps3remote driver into generic Sony driver
  HID: hyperv: convert alloc+memcpy to memdup
  HID: core: fix reporting of raw events
  HID: wiimote: discard invalid EXT data reports
  HID: wiimote: fix classic controller parsing
  HID: wiimote: init EXT/MP during device detection
  HID: wiimote: fix DRM debug-attr to correctly parse input
  HID: wiimote: add MP quirks
  HID: wiimote: remove old static extension support
  HID: wiimote: add "bboard_calib" attribute
  ...
parents 697a067f 21796b39
Loading
Loading
Loading
Loading
+38 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ Description: Make it possible to set/get current led state. Reading from it
What:		/sys/bus/hid/drivers/wiimote/<dev>/extension
Date:		August 2011
KernelVersion:	3.2
Contact:	David Herrmann <dh.herrmann@googlemail.com>
Contact:	David Herrmann <dh.herrmann@gmail.com>
Description:	This file contains the currently connected and initialized
		extensions. It can be one of: none, motionp, nunchuck, classic,
		motionp+nunchuck, motionp+classic
@@ -20,3 +20,40 @@ Description: This file contains the currently connected and initialized
		the official Nintendo Nunchuck extension and classic is the
		Nintendo Classic Controller extension. The motionp extension can
		be combined with the other two.
		Starting with kernel-version 3.11 Motion Plus hotplugging is
		supported and if detected, it's no longer reported as static
		extension. You will get uevent notifications for the motion-plus
		device then.

What:		/sys/bus/hid/drivers/wiimote/<dev>/devtype
Date:		May 2013
KernelVersion:	3.11
Contact:	David Herrmann <dh.herrmann@gmail.com>
Description:	While a device is initialized by the wiimote driver, we perform
		a device detection and signal a "change" uevent after it is
		done. This file shows the detected device type. "pending" means
		that the detection is still ongoing, "unknown" means, that the
		device couldn't be detected or loaded. "generic" means, that the
		device couldn't be detected but supports basic Wii Remote
		features and can be used.
		Other strings for each device-type are available and may be
		added if new device-specific detections are added.
		Currently supported are:
			gen10: First Wii Remote generation
			gen20: Second Wii Remote Plus generation (builtin MP)
			balanceboard: Wii Balance Board

What:		/sys/bus/hid/drivers/wiimote/<dev>/bboard_calib
Date:		May 2013
KernelVersion:	3.11
Contact:	David Herrmann <dh.herrmann@gmail.com>
Description:	This attribute is only provided if the device was detected as a
		balance board. It provides a single line with 3 calibration
		values for all 4 sensors. The values are separated by colons and
		are each 2 bytes long (encoded as 4 digit hexadecimal value).
		First, 0kg values for all 4 sensors are written, followed by the
		17kg values for all 4 sensors and last the 34kg values for all 4
		sensors.
		Calibration data is already applied by the kernel to all input
		values but may be used by user-space to perform other
		transformations.
+41 −22
Original line number Diff line number Diff line
@@ -217,6 +217,13 @@ config HID_ELECOM
	---help---
	Support for the ELECOM BM084 (bluetooth mouse).

config HID_ELO
	tristate "ELO USB 4000/4500 touchscreen"
	depends on USB_HID
	---help---
	Support for the ELO USB 4000/4500 touchscreens. Note that this is for
	different devices than those handled by CONFIG_TOUCHSCREEN_USB_ELO.

config HID_EZKEY
	tristate "Ezkey BTC 8193 keyboard" if EXPERT
	depends on HID
@@ -231,6 +238,9 @@ config HID_HOLTEK
	Support for Holtek based devices:
	  - Holtek On Line Grip based game controller
	  - Trust GXT 18 Gaming Keyboard
	  - Sharkoon Drakonia / Perixx MX-2000 gaming mice
	  - Tracer Sniper TRM-503 / NOVA Gaming Slider X200 /
	    Zalman ZM-GM1

config HOLTEK_FF
	bool "Holtek On Line Grip force feedback support"
@@ -240,6 +250,12 @@ config HOLTEK_FF
	  Say Y here if you have a Holtek On Line Grip based game controller
	  and want to have force feedback support for it.

config HID_HUION
	tristate "Huion tablets"
	depends on USB_HID
	---help---
	Support for Huion 580 tablet.

config HID_KEYTOUCH
	tristate "Keytouch HID devices"
	depends on HID
@@ -561,15 +577,6 @@ config HID_PRIMAX
	Support for Primax devices that are not fully compliant with the
	HID standard.

config HID_PS3REMOTE
	tristate "Sony PS3 BD Remote Control"
	depends on HID
	---help---
	Support for the Sony PS3 Blue-ray Disk Remote Control and Logitech
	Harmony Adapter for PS3, which connect over Bluetooth.

	Support for the 6-axis controllers is provided by HID_SONY.

config HID_ROCCAT
	tristate "Roccat device support"
	depends on USB_HID
@@ -594,12 +601,17 @@ config HID_SAMSUNG
	Support for Samsung InfraRed remote control or keyboards.

config HID_SONY
	tristate "Sony PS3 controller"
	tristate "Sony PS2/3 accessories"
	depends on USB_HID
	depends on NEW_LEDS
	depends on LEDS_CLASS
	---help---
	Support for Sony PS3 6-axis controllers.
	Support for

	Support for the Sony PS3 BD Remote is provided by HID_PS3REMOTE.
	  * Sony PS3 6-axis controllers
	  * Buzz controllers
	  * Sony PS3 Blue-ray Disk Remote Control (Bluetooth)
	  * Logitech Harmony adapter for Sony Playstation 3 (Bluetooth)

config HID_SPEEDLINK
	tristate "Speedlink VAD Cezanne mouse support"
@@ -707,22 +719,29 @@ config HID_WACOM
	Support for Wacom Graphire Bluetooth and Intuos4 WL tablets.

config HID_WIIMOTE
	tristate "Nintendo Wii Remote support"
	tristate "Nintendo Wii / Wii U peripherals"
	depends on HID
	depends on LEDS_CLASS
	select POWER_SUPPLY
	select INPUT_FF_MEMLESS
	---help---
	Support for the Nintendo Wii Remote bluetooth device.
	Support for Nintendo Wii and Wii U Bluetooth peripherals. Supported
	devices are the Wii Remote and its extension devices, but also devices
	based on the Wii Remote like the Wii U Pro Controller or the
	Wii Balance Board.

config HID_WIIMOTE_EXT
	bool "Nintendo Wii Remote Extension support"
	depends on HID_WIIMOTE
	default HID_WIIMOTE
	---help---
	Support for extension controllers of the Nintendo Wii Remote. Say yes
	here if you want to use the Nintendo Motion+, Nunchuck or Classic
	extension controllers with your Wii Remote.
	Support for all official Nintendo extensions is available, however, 3rd
	party extensions might not be supported. Please report these devices to:
	  http://github.com/dvdhrm/xwiimote/issues

	Other Nintendo Wii U peripherals that are IEEE 802.11 based (including
	the Wii U Gamepad) might be supported in the future. But currently
	support is limited to Bluetooth based devices.

	If unsure, say N.

	To compile this driver as a module, choose M here: the
	module will be called hid-wiimote.

config HID_ZEROPLUS
	tristate "Zeroplus based game controller support"
+4 −5
Original line number Diff line number Diff line
@@ -28,10 +28,7 @@ ifdef CONFIG_LOGIWHEELS_FF
	hid-logitech-y	+= hid-lg4ff.o
endif

hid-wiimote-y		:= hid-wiimote-core.o
ifdef CONFIG_HID_WIIMOTE_EXT
	hid-wiimote-y	+= hid-wiimote-ext.o
endif
hid-wiimote-y		:= hid-wiimote-core.o hid-wiimote-modules.o
ifdef CONFIG_DEBUG_FS
	hid-wiimote-y	+= hid-wiimote-debug.o
endif
@@ -48,10 +45,13 @@ obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
obj-$(CONFIG_HID_DRAGONRISE)	+= hid-dr.o
obj-$(CONFIG_HID_EMS_FF)	+= hid-emsff.o
obj-$(CONFIG_HID_ELECOM)	+= hid-elecom.o
obj-$(CONFIG_HID_ELO)		+= hid-elo.o
obj-$(CONFIG_HID_EZKEY)		+= hid-ezkey.o
obj-$(CONFIG_HID_GYRATION)	+= hid-gyration.o
obj-$(CONFIG_HID_HOLTEK)	+= hid-holtek-kbd.o
obj-$(CONFIG_HID_HOLTEK)	+= hid-holtek-mouse.o
obj-$(CONFIG_HID_HOLTEK)	+= hid-holtekff.o
obj-$(CONFIG_HID_HUION)		+= hid-huion.o
obj-$(CONFIG_HID_HYPERV_MOUSE)	+= hid-hyperv.o
obj-$(CONFIG_HID_ICADE)		+= hid-icade.o
obj-$(CONFIG_HID_KENSINGTON)	+= hid-kensington.o
@@ -92,7 +92,6 @@ hid-picolcd-y += hid-picolcd_debugfs.o
endif

obj-$(CONFIG_HID_PRIMAX)	+= hid-primax.o
obj-$(CONFIG_HID_PS3REMOTE)	+= hid-ps3remote.o
obj-$(CONFIG_HID_ROCCAT)	+= hid-roccat.o hid-roccat-common.o \
	hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \
	hid-roccat-koneplus.o hid-roccat-konepure.o hid-roccat-kovaplus.o \
+11 −1
Original line number Diff line number Diff line
@@ -1293,7 +1293,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i

	if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) {
		ret = hdrv->raw_event(hid, report, data, size);
		if (ret != 0) {
		if (ret < 0) {
			ret = ret < 0 ? ret : 0;
			goto unlock;
		}
@@ -1573,6 +1573,8 @@ static const struct hid_device_id hid_have_special_driver[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0011) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0009) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0030) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
@@ -1584,10 +1586,14 @@ static const struct hid_device_id hid_have_special_driver[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK, USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_580) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
	{ 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_GENIUS_GILA_GAMING_MOUSE) },
	{ 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_I405X) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
@@ -1680,6 +1686,8 @@ static const struct hid_device_id hid_have_special_driver[] = {
	{ 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_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_BUZZ_CONTROLLER) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_BDREMOTE) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) },
@@ -2042,6 +2050,8 @@ static const struct hid_device_id hid_ignore_list[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1007) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_JABRA, USB_DEVICE_ID_JABRA_SPEAK_410) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_JABRA, USB_DEVICE_ID_JABRA_SPEAK_510) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_KWORLD, USB_DEVICE_ID_KWORLD_RADIO_FM700) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_GPEN_560) },

drivers/hid/hid-elo.c

0 → 100644
+273 −0
Original line number Diff line number Diff line
/*
 * HID driver for ELO usb touchscreen 4000/4500
 *
 * Copyright (c) 2013 Jiri Slaby
 *
 * Data parsing taken from elousb driver by Vojtech Pavlik.
 *
 * This driver is licensed under the terms of GPLv2.
 */

#include <linux/hid.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/workqueue.h>

#include "hid-ids.h"

#define ELO_PERIODIC_READ_INTERVAL	HZ
#define ELO_SMARTSET_CMD_TIMEOUT	2000 /* msec */

/* Elo SmartSet commands */
#define ELO_FLUSH_SMARTSET_RESPONSES	0x02 /* Flush all pending smartset responses */
#define ELO_SEND_SMARTSET_COMMAND	0x05 /* Send a smartset command */
#define ELO_GET_SMARTSET_RESPONSE	0x06 /* Get a smartset response */
#define ELO_DIAG			0x64 /* Diagnostics command */
#define ELO_SMARTSET_PACKET_SIZE	8

struct elo_priv {
	struct usb_device *usbdev;
	struct delayed_work work;
	unsigned char buffer[ELO_SMARTSET_PACKET_SIZE];
};

static struct workqueue_struct *wq;
static bool use_fw_quirk = true;
module_param(use_fw_quirk, bool, S_IRUGO);
MODULE_PARM_DESC(use_fw_quirk, "Do periodic pokes for broken M firmwares (default = true)");

static void elo_input_configured(struct hid_device *hdev,
		struct hid_input *hidinput)
{
	struct input_dev *input = hidinput->input;

	set_bit(BTN_TOUCH, input->keybit);
	set_bit(ABS_PRESSURE, input->absbit);
	input_set_abs_params(input, ABS_PRESSURE, 0, 256, 0, 0);
}

static void elo_process_data(struct input_dev *input, const u8 *data, int size)
{
	int press;

	input_report_abs(input, ABS_X, (data[3] << 8) | data[2]);
	input_report_abs(input, ABS_Y, (data[5] << 8) | data[4]);

	press = 0;
	if (data[1] & 0x80)
		press = (data[7] << 8) | data[6];
	input_report_abs(input, ABS_PRESSURE, press);

	if (data[1] & 0x03) {
		input_report_key(input, BTN_TOUCH, 1);
		input_sync(input);
	}

	if (data[1] & 0x04)
		input_report_key(input, BTN_TOUCH, 0);

	input_sync(input);
}

static int elo_raw_event(struct hid_device *hdev, struct hid_report *report,
	 u8 *data, int size)
{
	struct hid_input *hidinput;

	if (!(hdev->claimed & HID_CLAIMED_INPUT) || list_empty(&hdev->inputs))
		return 0;

	hidinput = list_first_entry(&hdev->inputs, struct hid_input, list);

	switch (report->id) {
	case 0:
		if (data[0] == 'T') {	/* Mandatory ELO packet marker */
			elo_process_data(hidinput->input, data, size);
			return 1;
		}
		break;
	default:	/* unknown report */
		/* Unknown report type; pass upstream */
		hid_info(hdev, "unknown report type %d\n", report->id);
		break;
	}

	return 0;
}

static int elo_smartset_send_get(struct usb_device *dev, u8 command,
		void *data)
{
	unsigned int pipe;
	u8 dir;

	if (command == ELO_SEND_SMARTSET_COMMAND) {
		pipe = usb_sndctrlpipe(dev, 0);
		dir = USB_DIR_OUT;
	} else if (command == ELO_GET_SMARTSET_RESPONSE) {
		pipe = usb_rcvctrlpipe(dev, 0);
		dir = USB_DIR_IN;
	} else
		return -EINVAL;

	return usb_control_msg(dev, pipe, command,
			dir | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
			0, 0, data, ELO_SMARTSET_PACKET_SIZE,
			ELO_SMARTSET_CMD_TIMEOUT);
}

static int elo_flush_smartset_responses(struct usb_device *dev)
{
	return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
			ELO_FLUSH_SMARTSET_RESPONSES,
			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
			0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
}

static void elo_work(struct work_struct *work)
{
	struct elo_priv *priv = container_of(work, struct elo_priv, work.work);
	struct usb_device *dev = priv->usbdev;
	unsigned char *buffer = priv->buffer;
	int ret;

	ret = elo_flush_smartset_responses(dev);
	if (ret < 0) {
		dev_err(&dev->dev, "initial FLUSH_SMARTSET_RESPONSES failed, error %d\n",
				ret);
		goto fail;
	}

	/* send Diagnostics command */
	*buffer = ELO_DIAG;
	ret = elo_smartset_send_get(dev, ELO_SEND_SMARTSET_COMMAND, buffer);
	if (ret < 0) {
		dev_err(&dev->dev, "send Diagnostics Command failed, error %d\n",
				ret);
		goto fail;
	}

	/* get the result */
	ret = elo_smartset_send_get(dev, ELO_GET_SMARTSET_RESPONSE, buffer);
	if (ret < 0) {
		dev_err(&dev->dev, "get Diagnostics Command response failed, error %d\n",
				ret);
		goto fail;
	}

	/* read the ack */
	if (*buffer != 'A') {
		ret = elo_smartset_send_get(dev, ELO_GET_SMARTSET_RESPONSE,
				buffer);
		if (ret < 0) {
			dev_err(&dev->dev, "get acknowledge response failed, error %d\n",
					ret);
			goto fail;
		}
	}

fail:
	ret = elo_flush_smartset_responses(dev);
	if (ret < 0)
		dev_err(&dev->dev, "final FLUSH_SMARTSET_RESPONSES failed, error %d\n",
				ret);
	queue_delayed_work(wq, &priv->work, ELO_PERIODIC_READ_INTERVAL);
}

/*
 * Not all Elo devices need the periodic HID descriptor reads.
 * Only firmware version M needs this.
 */
static bool elo_broken_firmware(struct usb_device *dev)
{
	return use_fw_quirk && le16_to_cpu(dev->descriptor.bcdDevice) == 0x10d;
}

static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)
{
	struct elo_priv *priv;
	int ret;

	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
	if (!priv)
		return -ENOMEM;

	INIT_DELAYED_WORK(&priv->work, elo_work);
	priv->usbdev = interface_to_usbdev(to_usb_interface(hdev->dev.parent));

	hid_set_drvdata(hdev, priv);

	ret = hid_parse(hdev);
	if (ret) {
		hid_err(hdev, "parse failed\n");
		goto err_free;
	}

	ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
	if (ret) {
		hid_err(hdev, "hw start failed\n");
		goto err_free;
	}

	if (elo_broken_firmware(priv->usbdev)) {
		hid_info(hdev, "broken firmware found, installing workaround\n");
		queue_delayed_work(wq, &priv->work, ELO_PERIODIC_READ_INTERVAL);
	}

	return 0;
err_free:
	kfree(priv);
	return ret;
}

static void elo_remove(struct hid_device *hdev)
{
	struct elo_priv *priv = hid_get_drvdata(hdev);

	hid_hw_stop(hdev);
	flush_workqueue(wq);
	kfree(priv);
}

static const struct hid_device_id elo_devices[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0009), },
	{ HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0030), },
	{ }
};
MODULE_DEVICE_TABLE(hid, elo_devices);

static struct hid_driver elo_driver = {
	.name = "elo",
	.id_table = elo_devices,
	.probe = elo_probe,
	.remove = elo_remove,
	.raw_event = elo_raw_event,
	.input_configured = elo_input_configured,
};

static int __init elo_driver_init(void)
{
	int ret;

	wq = create_singlethread_workqueue("elousb");
	if (!wq)
		return -ENOMEM;

	ret = hid_register_driver(&elo_driver);
	if (ret)
		destroy_workqueue(wq);

	return ret;
}
module_init(elo_driver_init);

static void __exit elo_driver_exit(void)
{
	hid_unregister_driver(&elo_driver);
	destroy_workqueue(wq);
}
module_exit(elo_driver_exit);

MODULE_AUTHOR("Jiri Slaby <jslaby@suse.cz>");
MODULE_LICENSE("GPL");
Loading