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

Commit fdea70d2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull HID updates from Jiri Kosina:

 - Valve Steam Controller support from Rodrigo Rivas Costa

 - Redragon Asura support from Robert Munteanu

 - improvement of duplicate usage handling in generic hid-input from
   Benjamin Tissoires

 - Win 8.1 precisioun touchpad spec implementation from Benjamin
   Tissoires

 - Support for "In Range" flag for Wacom Intuos/Bamboo devices from
   Jason Gerecke

 - other various assorted smaller fixes and improvements

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (27 commits)
  HID: rmi: use HID_QUIRK_NO_INPUT_SYNC
  HID: multitouch: fix calculation of last slot field in multi-touch reports
  HID: quirks: remove Delcom Visual Signal Indicator from hid_have_special_driver[]
  HID: steam: select CONFIG_POWER_SUPPLY
  HID: i2c-hid: remove i2c_hid_open_mut
  HID: wacom: Support "in range" for Intuos/Bamboo tablets where possible
  HID: core: fix hid_hw_open() comment
  HID: hid-plantronics: Re-resend Update to map button for PTT products
  HID: multitouch: fix types returned from mt_need_to_apply_feature()
  HID: i2c-hid: check if device is there before really probing
  HID: steam: add missing fields in client initialization
  HID: steam: add battery device.
  HID: add driver for Valve Steam Controller
  HID: alps: Fix some style in 't4_read_write_register()'
  HID: alps: Check errors returned by 't4_read_write_register()'
  HID: alps: Save a memory allocation in 't4_read_write_register()' when writing data
  HID: alps: Report an error if we receive invalid data in 't4_read_write_register()'
  HID: multitouch: implement precision touchpad latency and switches
  HID: multitouch: simplify the settings of the various features
  HID: multitouch: make use of HID_QUIRK_INPUT_PER_APP
  ...
parents 9eb86c75 06d8b906
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -575,6 +575,13 @@ config HID_MAYFLASH
	Say Y here if you have HJZ Mayflash PS3 game controller adapters
	and want to enable force feedback support.

config HID_REDRAGON
	tristate "Redragon keyboards"
	depends on HID
	default !EXPERT
	---help---
    Support for Redragon keyboards that need fix-ups to work properly.

config HID_MICROSOFT
	tristate "Microsoft non-fully HID-compliant devices"
	depends on HID
@@ -838,6 +845,15 @@ config HID_SPEEDLINK
	---help---
	Support for Speedlink Vicious and Divine Cezanne mouse.

config HID_STEAM
	tristate "Steam Controller support"
	depends on HID
	select POWER_SUPPLY
	---help---
	Say Y here if you have a Steam Controller if you want to use it
	without running the Steam Client. It supports both the wired and
	the wireless adaptor.

config HID_STEELSERIES
	tristate "Steelseries SRW-S1 steering wheel support"
	depends on HID
+2 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ hid-picolcd-$(CONFIG_DEBUG_FS) += hid-picolcd_debugfs.o

obj-$(CONFIG_HID_PLANTRONICS)	+= hid-plantronics.o
obj-$(CONFIG_HID_PRIMAX)	+= hid-primax.o
obj-$(CONFIG_HID_REDRAGON)	+= hid-redragon.o
obj-$(CONFIG_HID_RETRODE)	+= hid-retrode.o
obj-$(CONFIG_HID_ROCCAT)	+= hid-roccat.o hid-roccat-common.o \
	hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \
@@ -97,6 +98,7 @@ obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o
obj-$(CONFIG_HID_SMARTJOYPLUS)	+= hid-sjoy.o
obj-$(CONFIG_HID_SONY)		+= hid-sony.o
obj-$(CONFIG_HID_SPEEDLINK)	+= hid-speedlink.o
obj-$(CONFIG_HID_STEAM)		+= hid-steam.o
obj-$(CONFIG_HID_STEELSERIES)	+= hid-steelseries.o
obj-$(CONFIG_HID_SUNPLUS)	+= hid-sunplus.o
obj-$(CONFIG_HID_GREENASIA)	+= hid-gaff.o
+25 −5
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ static int t4_read_write_register(struct hid_device *hdev, u32 address,
	int ret;
	u16 check_sum;
	u8 *input;
	u8 *readbuf;
	u8 *readbuf = NULL;

	input = kzalloc(T4_FEATURE_REPORT_LEN, GFP_KERNEL);
	if (!input)
@@ -204,8 +204,8 @@ static int t4_read_write_register(struct hid_device *hdev, u32 address,
		goto exit;
	}

	readbuf = kzalloc(T4_FEATURE_REPORT_LEN, GFP_KERNEL);
	if (read_flag) {
		readbuf = kzalloc(T4_FEATURE_REPORT_LEN, GFP_KERNEL);
		if (!readbuf) {
			ret = -ENOMEM;
			goto exit;
@@ -219,6 +219,8 @@ static int t4_read_write_register(struct hid_device *hdev, u32 address,
			goto exit_readbuf;
		}

		ret = -EINVAL;

		if (*(u32 *)&readbuf[6] != address) {
			dev_err(&hdev->dev, "read register address error (%x,%x)\n",
				*(u32 *)&readbuf[6], address);
@@ -458,17 +460,35 @@ static int __maybe_unused alps_post_reset(struct hid_device *hdev)
	case T4:
		ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_1,
			NULL, T4_I2C_ABS, false);
		if (ret < 0) {
			dev_err(&hdev->dev, "failed T4_PRM_FEED_CONFIG_1 (%d)\n",
				ret);
			goto exit;
		}

		ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_4,
			NULL, T4_FEEDCFG4_ADVANCED_ABS_ENABLE, false);
		if (ret < 0) {
			dev_err(&hdev->dev, "failed T4_PRM_FEED_CONFIG_4 (%d)\n",
				ret);
			goto exit;
		}
		break;
	case U1:
		ret = u1_read_write_register(hdev,
			ADDRESS_U1_DEV_CTRL_1, NULL,
			U1_TP_ABS_MODE | U1_SP_ABS_MODE, false);
		if (ret < 0) {
			dev_err(&hdev->dev, "failed to change TP mode (%d)\n",
				ret);
			goto exit;
		}
		break;
	default:
		break;
	}

exit:
	return ret;
}

+14 −7
Original line number Diff line number Diff line
@@ -57,7 +57,9 @@ MODULE_PARM_DESC(ignore_special_drivers, "Ignore any special drivers and handle
 * Register a new report for a device.
 */

struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id)
struct hid_report *hid_register_report(struct hid_device *device,
				       unsigned int type, unsigned int id,
				       unsigned int application)
{
	struct hid_report_enum *report_enum = device->report_enum + type;
	struct hid_report *report;
@@ -78,6 +80,7 @@ struct hid_report *hid_register_report(struct hid_device *device, unsigned type,
	report->type = type;
	report->size = 0;
	report->device = device;
	report->application = application;
	report_enum->report_id_hash[id] = report;

	list_add_tail(&report->list, &report_enum->report_list);
@@ -221,11 +224,15 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign
{
	struct hid_report *report;
	struct hid_field *field;
	unsigned usages;
	unsigned offset;
	unsigned i;
	unsigned int usages;
	unsigned int offset;
	unsigned int i;
	unsigned int application;

	application = hid_lookup_collection(parser, HID_COLLECTION_APPLICATION);

	report = hid_register_report(parser->device, report_type, parser->global.report_id);
	report = hid_register_report(parser->device, report_type,
				     parser->global.report_id, application);
	if (!report) {
		hid_err(parser->device, "hid_register_report failed\n");
		return -1;
@@ -259,7 +266,7 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign

	field->physical = hid_lookup_collection(parser, HID_COLLECTION_PHYSICAL);
	field->logical = hid_lookup_collection(parser, HID_COLLECTION_LOGICAL);
	field->application = hid_lookup_collection(parser, HID_COLLECTION_APPLICATION);
	field->application = application;

	for (i = 0; i < usages; i++) {
		unsigned j = i;
@@ -1798,7 +1805,7 @@ EXPORT_SYMBOL_GPL(hid_hw_stop);
 *
 * Tell underlying HW to start delivering events from the device.
 * This function should be called sometime after successful call
 * to hid_hiw_start().
 * to hid_hw_start().
 */
int hid_hw_open(struct hid_device *hdev)
{
+15 −0
Original line number Diff line number Diff line
@@ -56,6 +56,20 @@ static bool hid_generic_match(struct hid_device *hdev,
	return true;
}

static int hid_generic_probe(struct hid_device *hdev,
			     const struct hid_device_id *id)
{
	int ret;

	hdev->quirks |= HID_QUIRK_INPUT_PER_APP;

	ret = hid_parse(hdev);
	if (ret)
		return ret;

	return hid_hw_start(hdev, HID_CONNECT_DEFAULT);
}

static const struct hid_device_id hid_table[] = {
	{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, HID_ANY_ID, HID_ANY_ID) },
	{ }
@@ -66,6 +80,7 @@ static struct hid_driver hid_generic = {
	.name = "hid-generic",
	.id_table = hid_table,
	.match = hid_generic_match,
	.probe = hid_generic_probe,
};
module_hid_driver(hid_generic);

Loading