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

Commit e413b210 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (55 commits)
  HID: build drivers for all quirky devices by default
  HID: add missing blacklist entry for Apple ATV ircontrol
  HID: add support for Bright ABNT2 brazilian device
  HID: Don't let Avermedia Radio FM800 be handled by usb hid drivers
  HID: fix numlock led on Dell device 0x413c/0x2105
  HID: remove warn() macro from usb hid drivers
  HID: remove info() macro from usb HID drivers
  HID: add appletv IR receiver quirk
  HID: fix a lockup regression when using force feedback on a PID device
  HID: hiddev.h: Fix example code.
  HID: hiddev.h: Fix mixed space and tabs in example code.
  HID: convert to dev_* prints
  HID: remove hid-ff
  HID: move zeroplus FF processing
  HID: move thrustmaster FF processing
  HID: move pantherlord FF processing
  HID: fix incorrent length condition in hidraw_write()
  HID: fix tty<->hid deadlock
  HID: ignore iBuddy devices
  HID: report descriptor fix for remaining MacBook JIS keyboards
  ...
parents acd15a83 9be7bbd5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -287,6 +287,13 @@ Who: Glauber Costa <gcosta@redhat.com>

---------------------------

What:	remove HID compat support
When:	2.6.29
Why:	needed only as a temporary solution until distros fix themselves up
Who:	Jiri Slaby <jirislaby@gmail.com>

---------------------------

What:	/sys/o2cb symlink
When:	January 2010
Why:	/sys/fs/o2cb is the proper location for this information - /sys/o2cb
+221 −0
Original line number Diff line number Diff line
@@ -17,6 +17,25 @@ config HID
	tristate "Generic HID support"
	depends on INPUT
	default y
        select HID_A4TECH if !EMBEDDED
        select HID_APPLE if !EMBEDDED
        select HID_BELKIN if !EMBEDDED
        select HID_BRIGHT if !EMBEDDED
        select HID_CHERRY if !EMBEDDED
        select HID_CHICONY if !EMBEDDED
        select HID_CYPRESS if !EMBEDDED
        select HID_DELL if !EMBEDDED
        select HID_EZKEY if !EMBEDDED
        select HID_GYRATION if !EMBEDDED
        select HID_LOGITECH if !EMBEDDED
        select HID_MICROSOFT if !EMBEDDED
        select HID_MONTEREY if !EMBEDDED
        select HID_PANTHERLORD if !EMBEDDED
        select HID_PETALYNX if !EMBEDDED
        select HID_SAMSUNG if !EMBEDDED
        select HID_SONY if !EMBEDDED
        select HID_SUNPLUS if !EMBEDDED

	---help---
	  A human interface device (HID) is a type of computer device that
	  interacts directly with and takes input from humans. The term "HID"
@@ -67,4 +86,206 @@ config HIDRAW

source "drivers/hid/usbhid/Kconfig"

menu "Special HID drivers"
	depends on HID

config HID_COMPAT
	bool "Load all HID drivers on hid core load"
	default y
	---help---
	Compatible option for older userspace. If you have system without udev
	support of module loading through aliases and also old
	module-init-tools which can't handle hid bus, choose Y here. Otherwise
	say N. If you say N and your userspace is old enough, the only
	functionality you lose is modules autoloading.

	If unsure, say Y.

config HID_A4TECH
	tristate "A4 tech"
	default m
	depends on USB_HID
	---help---
	Support for A4 tech X5 and WOP-35 / Trust 450L mice.

config HID_APPLE
	tristate "Apple"
	default m
	depends on (USB_HID || BT_HIDP)
	---help---
	Support for some Apple devices which less or more break
	HID specification.

	Say Y here if you want support for the special keys (Fn, Numlock) on
	Apple iBooks, PowerBooks, MacBooks, MacBook Pros and aluminum USB
	keyboards.

	If unsure, say M.

config HID_BELKIN
	tristate "Belkin"
	default m
	depends on USB_HID
	---help---
	Support for Belkin Flip KVM and Wireless keyboard.

config HID_BRIGHT
	tristate "Bright"
	default m
	depends on USB_HID
	---help---
	Support for Bright ABNT-2 keyboard.

config HID_CHERRY
	tristate "Cherry"
	default m
	depends on USB_HID
	---help---
	Support for Cherry Cymotion.

config HID_CHICONY
	tristate "Chicony"
	default m
	depends on USB_HID
	---help---
	Support for Chicony Tactical pad.

config HID_CYPRESS
	tristate "Cypress"
	default m
	depends on USB_HID
	---help---
	Support for Cypress mouse and barcodes.

config HID_DELL
	tristate "Dell"
	default m
	depends on USB_HID
	---help---
	Support for Dell W7658.

config HID_EZKEY
	tristate "Ezkey"
	default m
	depends on USB_HID
	---help---
	Support for Ezkey mouse and barcodes.

config HID_GYRATION
	tristate "Gyration"
	default m
	depends on USB_HID
	---help---
	Support for Gyration remote.

config HID_LOGITECH
	tristate "Logitech"
	default m
	depends on USB_HID
	---help---
	Support for some Logitech devices which breaks less or more
	HID specification.

config LOGITECH_FF
	bool "Logitech force feedback"
	depends on HID_LOGITECH
	select INPUT_FF_MEMLESS
	help
	  Say Y here if you have one of these devices:
	  - Logitech WingMan Cordless RumblePad
	  - Logitech WingMan Cordless RumblePad 2
	  - Logitech WingMan Force 3D
	  - Logitech Formula Force EX
	  - Logitech MOMO Force wheel

	  and if you want to enable force feedback for them.
	  Note: if you say N here, this device will still be supported, but without
	  force feedback.

config LOGIRUMBLEPAD2_FF
	bool "Logitech Rumblepad 2 force feedback"
	depends on HID_LOGITECH
	select INPUT_FF_MEMLESS
	help
	  Say Y here if you want to enable force feedback support for Logitech
	  Rumblepad 2 devices.

config HID_MICROSOFT
	tristate "Microsoft"
	default m
	depends on USB_HID
	---help---
	Support for some Microsoft devices which breaks less or more
	HID specification.

config HID_MONTEREY
	tristate "Monterey"
	default m
	depends on USB_HID
	---help---
	Support for Monterey Genius KB29E.

config HID_PANTHERLORD
	tristate "Pantherlord devices support"
	default m
	depends on USB_HID
	---help---
	Support for PantherLord/GreenAsia based device support.


config PANTHERLORD_FF
	bool "Pantherlord force feedback support"
	depends on HID_PANTHERLORD
	select INPUT_FF_MEMLESS
	help
	  Say Y here if you have a PantherLord/GreenAsia based game controller
	  or adapter and want to enable force feedback support for it.

config HID_PETALYNX
	tristate "Petalynx"
	default m
	depends on USB_HID
	---help---
	Support for Petalynx Maxter remote.

config HID_SAMSUNG
	tristate "Samsung"
	default m
	depends on USB_HID
	---help---
	Support for Samsung IR remote.

config HID_SONY
	tristate "Sony"
	default m
	depends on USB_HID
	---help---
	Support for Sony PS3 controller.

config HID_SUNPLUS
	tristate "Sunplus"
	default m
	depends on USB_HID
	---help---
	Support for Sunplus WDesktop input device.

config THRUSTMASTER_FF
	tristate "ThrustMaster devices support"
	default m
	depends on USB_HID
	select INPUT_FF_MEMLESS
	help
	  Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
	  a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel.

config ZEROPLUS_FF
	tristate "Zeroplus based game controller support"
	default m
	depends on USB_HID
	select INPUT_FF_MEMLESS
	help
	  Say Y here if you have a Zeroplus based game controller.

endmenu

endif # HID_SUPPORT
+34 −1
Original line number Diff line number Diff line
#
# Makefile for the HID driver
#
hid-objs			:= hid-core.o hid-input.o hid-input-quirks.o
hid-objs			:= hid-core.o hid-input.o

obj-$(CONFIG_HID)		+= hid.o

hid-$(CONFIG_HID_DEBUG)		+= hid-debug.o
hid-$(CONFIG_HIDRAW)		+= hidraw.o

ifdef CONFIG_HID_COMPAT
obj-m				+= hid-dummy.o
endif

hid-logitech-objs		:= hid-lg.o
ifdef CONFIG_LOGITECH_FF
	hid-logitech-objs	+= hid-lgff.o
endif
ifdef CONFIG_LOGIRUMBLEPAD2_FF
	hid-logitech-objs	+= hid-lg2ff.o
endif

obj-$(CONFIG_HID_A4TECH)	+= hid-a4tech.o
obj-$(CONFIG_HID_APPLE)		+= hid-apple.o
obj-$(CONFIG_HID_BELKIN)	+= hid-belkin.o
obj-$(CONFIG_HID_BRIGHT)	+= hid-bright.o
obj-$(CONFIG_HID_CHERRY)	+= hid-cherry.o
obj-$(CONFIG_HID_CHICONY)	+= hid-chicony.o
obj-$(CONFIG_HID_CYPRESS)	+= hid-cypress.o
obj-$(CONFIG_HID_DELL)		+= hid-dell.o
obj-$(CONFIG_HID_EZKEY)		+= hid-ezkey.o
obj-$(CONFIG_HID_GYRATION)	+= hid-gyration.o
obj-$(CONFIG_HID_LOGITECH)	+= hid-logitech.o
obj-$(CONFIG_HID_MICROSOFT)	+= hid-microsoft.o
obj-$(CONFIG_HID_MONTEREY)	+= hid-monterey.o
obj-$(CONFIG_HID_PANTHERLORD)	+= hid-pl.o
obj-$(CONFIG_HID_PETALYNX)	+= hid-petalynx.o
obj-$(CONFIG_HID_SAMSUNG)	+= hid-samsung.o
obj-$(CONFIG_HID_SONY)		+= hid-sony.o
obj-$(CONFIG_HID_SUNPLUS)	+= hid-sunplus.o
obj-$(CONFIG_THRUSTMASTER_FF)	+= hid-tmff.o
obj-$(CONFIG_ZEROPLUS_FF)	+= hid-zpff.o

obj-$(CONFIG_USB_HID)		+= usbhid/
obj-$(CONFIG_USB_MOUSE)		+= usbhid/
obj-$(CONFIG_USB_KBD)		+= usbhid/
+162 −0
Original line number Diff line number Diff line
/*
 *  HID driver for some a4tech "special" devices
 *
 *  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
 */

/*
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 */

#include <linux/device.h>
#include <linux/input.h>
#include <linux/hid.h>
#include <linux/module.h>

#include "hid-ids.h"

#define A4_2WHEEL_MOUSE_HACK_7	0x01
#define A4_2WHEEL_MOUSE_HACK_B8	0x02

struct a4tech_sc {
	unsigned long quirks;
	unsigned int hw_wheel;
	__s32 delayed_value;
};

static int a4_input_mapped(struct hid_device *hdev, struct hid_input *hi,
		struct hid_field *field, struct hid_usage *usage,
		unsigned long **bit, int *max)
{
	struct a4tech_sc *a4 = hid_get_drvdata(hdev);

	if (usage->type == EV_REL && usage->code == REL_WHEEL)
		set_bit(REL_HWHEEL, *bit);

	if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007)
		return -1;

	return 0;
}

static int a4_event(struct hid_device *hdev, struct hid_field *field,
		struct hid_usage *usage, __s32 value)
{
	struct a4tech_sc *a4 = hid_get_drvdata(hdev);
	struct input_dev *input;

	if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput ||
			!usage->type)
		return 0;

	input = field->hidinput->input;

	if (a4->quirks & A4_2WHEEL_MOUSE_HACK_B8) {
		if (usage->type == EV_REL && usage->code == REL_WHEEL) {
			a4->delayed_value = value;
			return 1;
		}

		if (usage->hid == 0x000100b8) {
			input_event(input, EV_REL, value ? REL_HWHEEL :
					REL_WHEEL, a4->delayed_value);
			return 1;
		}
	}

	if ((a4->quirks & A4_2WHEEL_MOUSE_HACK_7) && usage->hid == 0x00090007) {
		a4->hw_wheel = !!value;
		return 1;
	}

	if (usage->code == REL_WHEEL && a4->hw_wheel) {
		input_event(input, usage->type, REL_HWHEEL, value);
		return 1;
	}

	return 0;
}

static int a4_probe(struct hid_device *hdev, const struct hid_device_id *id)
{
	struct a4tech_sc *a4;
	int ret;

	a4 = kzalloc(sizeof(*a4), GFP_KERNEL);
	if (a4 == NULL) {
		dev_err(&hdev->dev, "can't alloc device descriptor\n");
		ret = -ENOMEM;
		goto err_free;
	}

	a4->quirks = id->driver_data;

	hid_set_drvdata(hdev, a4);

	ret = hid_parse(hdev);
	if (ret) {
		dev_err(&hdev->dev, "parse failed\n");
		goto err_free;
	}

	ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
	if (ret) {
		dev_err(&hdev->dev, "hw start failed\n");
		goto err_free;
	}

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

static void a4_remove(struct hid_device *hdev)
{
	struct a4tech_sc *a4 = hid_get_drvdata(hdev);

	hid_hw_stop(hdev);
	kfree(a4);
}

static const struct hid_device_id a4_devices[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU),
		.driver_data = A4_2WHEEL_MOUSE_HACK_7 },
	{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D),
		.driver_data = A4_2WHEEL_MOUSE_HACK_B8 },
	{ }
};
MODULE_DEVICE_TABLE(hid, a4_devices);

static struct hid_driver a4_driver = {
	.name = "a4tech",
	.id_table = a4_devices,
	.input_mapped = a4_input_mapped,
	.event = a4_event,
	.probe = a4_probe,
	.remove = a4_remove,
};

static int a4_init(void)
{
	return hid_register_driver(&a4_driver);
}

static void a4_exit(void)
{
	hid_unregister_driver(&a4_driver);
}

module_init(a4_init);
module_exit(a4_exit);
MODULE_LICENSE("GPL");

HID_COMPAT_LOAD_DRIVER(a4tech);
+484 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading