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

Commit 2ac04a15 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jikos/hid

* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jikos/hid:
  USB HID: handle multi-interface devices for Apple macbook pro properly
  HID: move away from DEBUG defines in favor of CONFIG_HID_DEBUG
  USB HID: fix bogus comment in hid_get_class_descriptor()
  USB HID: remove hid_find_field_by_usage()
  HID: API - fix leftovers of hidinput API in USB HID
  HID: hid debug from hid-debug.h to hid layer
  hid: force feedback driver for PantherLord USB/PS2 2in1 Adapter
  hid: quirk for multi-input devices with unneeded output reports
  hid: allow force feedback for multi-input devices
parents 0c7d3757 a417a21e
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -22,5 +22,19 @@ config HID


	  If unsure, say Y
	  If unsure, say Y


config HID_DEBUG
	bool "HID debugging support"
	depends on HID
	---help---
	This option lets the HID layer output diagnostics about its internal
	state, resolve HID usages, dump HID fields, etc. Individual HID drivers
	use this debugging facility to output information about individual HID
	devices, etc.

	This feature is useful for those who are either debugging the HID parser
	or any HID hardware device.

	If unsure, say N

endmenu
endmenu
+2 −9
Original line number Original line Diff line number Diff line
#
#
# Makefile for the HID driver
# Makefile for the HID driver
#
#

# Multipart objects.
hid-objs			:= hid-core.o hid-input.o
hid-objs			:= hid-core.o hid-input.o


# Optional parts of multipart objects.

obj-$(CONFIG_HID)		+= hid.o
obj-$(CONFIG_HID)		+= hid.o

hid-$(CONFIG_HID_DEBUG)		+= hid-debug.o
ifeq ($(CONFIG_INPUT_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
+3 −5
Original line number Original line Diff line number Diff line
@@ -28,11 +28,9 @@
#include <linux/input.h>
#include <linux/input.h>
#include <linux/wait.h>
#include <linux/wait.h>


#undef DEBUG
#undef DEBUG_DATA

#include <linux/hid.h>
#include <linux/hid.h>
#include <linux/hiddev.h>
#include <linux/hiddev.h>
#include <linux/hid-debug.h>


/*
/*
 * Version Information
 * Version Information
@@ -951,7 +949,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
		return -1;
		return -1;
	}
	}


#ifdef DEBUG_DATA
#ifdef CONFIG_HID_DEBUG
	printk(KERN_DEBUG __FILE__ ": report (size %u) (%snumbered)\n", size, report_enum->numbered ? "" : "un");
	printk(KERN_DEBUG __FILE__ ": report (size %u) (%snumbered)\n", size, report_enum->numbered ? "" : "un");
#endif
#endif


@@ -961,7 +959,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
		size--;
		size--;
	}
	}


#ifdef DEBUG_DATA
#ifdef CONFIG_HID_DEBUG
	{
	{
		int i;
		int i;
		printk(KERN_DEBUG __FILE__ ": report %d (size %u) = ", n, size);
		printk(KERN_DEBUG __FILE__ ": report %d (size %u) = ", n, size);
+764 −0

File added.

Preview size limit exceeded, changes collapsed.

+25 −10
Original line number Original line Diff line number Diff line
@@ -31,9 +31,8 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/kernel.h>


#undef DEBUG

#include <linux/hid.h>
#include <linux/hid.h>
#include <linux/hid-debug.h>


static int hid_pb_fnmode = 1;
static int hid_pb_fnmode = 1;
module_param_named(pb_fnmode, hid_pb_fnmode, int, 0644);
module_param_named(pb_fnmode, hid_pb_fnmode, int, 0644);
@@ -252,9 +251,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel


	field->hidinput = hidinput;
	field->hidinput = hidinput;


#ifdef DEBUG
#ifdef CONFIG_HID_DEBUG
	printk(KERN_DEBUG "Mapping: ");
	printk(KERN_DEBUG "Mapping: ");
	resolv_usage(usage->hid);
	hid_resolv_usage(usage->hid);
	printk(" ---> ");
	printk(" ---> ");
#endif
#endif


@@ -682,14 +681,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
			field->dpad = usage->code;
			field->dpad = usage->code;
	}
	}


#ifdef DEBUG
	hid_resolv_event(usage->type, usage->code);
	resolv_event(usage->type, usage->code);
#ifdef CONFIG_HID_DEBUG
	printk("\n");
	printk("\n");
#endif
#endif
	return;
	return;


ignore:
ignore:
#ifdef DEBUG
#ifdef CONFIG_HID_DEBUG
	printk("IGNORED\n");
	printk("IGNORED\n");
#endif
#endif
	return;
	return;
@@ -804,6 +803,18 @@ int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int
}
}
EXPORT_SYMBOL_GPL(hidinput_find_field);
EXPORT_SYMBOL_GPL(hidinput_find_field);


static int hidinput_open(struct input_dev *dev)
{
	struct hid_device *hid = dev->private;
	return hid->hid_open(hid);
}

static void hidinput_close(struct input_dev *dev)
{
	struct hid_device *hid = dev->private;
	hid->hid_close(hid);
}

/*
/*
 * Register the input device; print a message.
 * Register the input device; print a message.
 * Configure the input layer interface
 * Configure the input layer interface
@@ -816,6 +827,7 @@ int hidinput_connect(struct hid_device *hid)
	struct hid_input *hidinput = NULL;
	struct hid_input *hidinput = NULL;
	struct input_dev *input_dev;
	struct input_dev *input_dev;
	int i, j, k;
	int i, j, k;
	int max_report_type = HID_OUTPUT_REPORT;


	INIT_LIST_HEAD(&hid->inputs);
	INIT_LIST_HEAD(&hid->inputs);


@@ -828,7 +840,10 @@ int hidinput_connect(struct hid_device *hid)
	if (i == hid->maxcollection)
	if (i == hid->maxcollection)
		return -1;
		return -1;


	for (k = HID_INPUT_REPORT; k <= HID_OUTPUT_REPORT; k++)
	if (hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORTS)
		max_report_type = HID_INPUT_REPORT;

	for (k = HID_INPUT_REPORT; k <= max_report_type; k++)
		list_for_each_entry(report, &hid->report_enum[k].report_list, list) {
		list_for_each_entry(report, &hid->report_enum[k].report_list, list) {


			if (!report->maxfield)
			if (!report->maxfield)
@@ -846,8 +861,8 @@ int hidinput_connect(struct hid_device *hid)


				input_dev->private = hid;
				input_dev->private = hid;
				input_dev->event = hid->hidinput_input_event;
				input_dev->event = hid->hidinput_input_event;
				input_dev->open = hid->hidinput_open;
				input_dev->open = hidinput_open;
				input_dev->close = hid->hidinput_close;
				input_dev->close = hidinput_close;


				input_dev->name = hid->name;
				input_dev->name = hid->name;
				input_dev->phys = hid->phys;
				input_dev->phys = hid->phys;
Loading