From: Jiri Kosina <jkosina@suse.cz>
Date: Sun, 13 Sep 2009 18:09:41 +0000 (+0200)
Subject: Merge branches 'upstream', 'upstream-fixes' and 'debugfs' into for-linus
X-Git-Tag: firefly_0821_release~12967^2
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8123e8f7c89a07cb22279b15bf47cdee0205d4a1;p=firefly-linux-kernel-4.4.55.git

Merge branches 'upstream', 'upstream-fixes' and 'debugfs' into for-linus
---

8123e8f7c89a07cb22279b15bf47cdee0205d4a1
diff --cc drivers/hid/Kconfig
index aba8facecce8,7831a0318d3c,05950a783560..111afbe8de03
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@@@ -309,45 -301,45 -248,21 +294,45 @@@@ config HID_TOPSEE
   	---help---
   	Say Y if you have a TopSeed Cyberlink remote control.
   
  -config THRUSTMASTER_FF
  -	tristate "ThrustMaster devices support"
  +config HID_THRUSTMASTER
  +	tristate "ThrustMaster devices support" if EMBEDDED
   	depends on USB_HID
  -	select INPUT_FF_MEMLESS
  -	help
  +	default !EMBEDDED
  +	---help---
   	  Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
  -	  a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel.
  +	  a THRUSTMASTER Ferrari GT Rumble Wheel.
   
  -config ZEROPLUS_FF
  -	tristate "Zeroplus based game controller support"
  -	depends on USB_HID
  +config THRUSTMASTER_FF
  +	bool "ThrustMaster devices force feedback support"
  +	depends on HID_THRUSTMASTER
   	select INPUT_FF_MEMLESS
  -	help
  +	---help---
 - 	  Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
 - 	  a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel and
 - 	  want to enable force feedback support for it.
 ++	  Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or 3,
 ++	  a THRUSTMASTER Dual Trigger 3-in-1 or a THRUSTMASTER Ferrari GT
 ++	  Rumble Force or Force Feedback Wheel.
  +
  +config HID_WACOM
  +	tristate "Wacom Bluetooth devices support" if EMBEDDED
  +	depends on BT_HIDP
  +	default !EMBEDDED
  +	---help---
  +	Support for Wacom Graphire Bluetooth tablet.
  +
  +config HID_ZEROPLUS
  +	tristate "Zeroplus based game controller support" if EMBEDDED
  +	depends on USB_HID
  +	default !EMBEDDED
  +	---help---
   	  Say Y here if you have a Zeroplus based game controller.
   
  +config ZEROPLUS_FF
  +	bool "Zeroplus based game controller force feedback support"
  +	depends on HID_ZEROPLUS
  +	select INPUT_FF_MEMLESS
  +	---help---
  +	  Say Y here if you have a Zeroplus based game controller and want
  +	  to have force feedback support for it.
  +
   endmenu
   
   endif # HID_SUPPORT
diff --cc drivers/hid/Makefile
index 9b9271d6527a,db35151673b1,cf3687d1ed63..0de2dff5542c
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@@@ -34,15 -34,14 -37,12 +37,15 @@@@ obj-$(CONFIG_HID_NTRIG)		+= hid-ntrig.
   obj-$(CONFIG_HID_PANTHERLORD)	+= hid-pl.o
   obj-$(CONFIG_HID_PETALYNX)	+= hid-petalynx.o
   obj-$(CONFIG_HID_SAMSUNG)	+= hid-samsung.o
  +obj-$(CONFIG_HID_SMARTJOYPLUS)	+= hid-sjoy.o
   obj-$(CONFIG_HID_SONY)		+= hid-sony.o
   obj-$(CONFIG_HID_SUNPLUS)	+= hid-sunplus.o
  -obj-$(CONFIG_GREENASIA_FF)	+= hid-gaff.o
  -obj-$(CONFIG_THRUSTMASTER_FF)	+= hid-tmff.o
  +obj-$(CONFIG_HID_GREENASIA)	+= hid-gaff.o
  +obj-$(CONFIG_HID_THRUSTMASTER)	+= hid-tmff.o
   obj-$(CONFIG_HID_TOPSEED)	+= hid-topseed.o
  -obj-$(CONFIG_ZEROPLUS_FF)	+= hid-zpff.o
 ++obj-$(CONFIG_HID_TWINHAN)	+= hid-twinhan.o
  +obj-$(CONFIG_HID_ZEROPLUS)	+= hid-zpff.o
  +obj-$(CONFIG_HID_WACOM)		+= hid-wacom.o
   
   obj-$(CONFIG_USB_HID)		+= usbhid/
   obj-$(CONFIG_USB_MOUSE)		+= usbhid/
diff --cc drivers/hid/hid-core.c
index 48567d8fe358,047844df992a,86c2ff2429d8..342b7d36d7bb
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@@@ -1075,9 -1075,9 -1072,10 +1072,10 @@@@ EXPORT_SYMBOL_GPL(hid_report_raw_event)
    */
   int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int interrupt)
   {
  -	struct hid_report_enum *report_enum = hid->report_enum + type;
  -	struct hid_driver *hdrv = hid->driver;
  +	struct hid_report_enum *report_enum;
  +	struct hid_driver *hdrv;
   	struct hid_report *report;
++ 	char *buf;
   	unsigned int i;
   	int ret;
   
@@@@ -1091,18 -1091,18 -1087,38 +1089,38 @@@@
   		return -1;
   	}
   
-- 	dbg_hid("report (size %u) (%snumbered)\n", size, report_enum->numbered ? "" : "un");
++ 	buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE,
++ 			interrupt ? GFP_ATOMIC : GFP_KERNEL);
++ 
++ 	if (!buf) {
++ 		report = hid_get_report(report_enum, data);
++ 		goto nomem;
++ 	}
++ 
++ 	snprintf(buf, HID_DEBUG_BUFSIZE - 1,
++ 			"\nreport (size %u) (%snumbered)\n", size, report_enum->numbered ? "" : "un");
++ 	hid_debug_event(hid, buf);
   
   	report = hid_get_report(report_enum, data);
-- 	if (!report)
++ 	if (!report) {
++ 		kfree(buf);
   		return -1;
++ 	}
   
   	/* dump the report */
-- 	dbg_hid("report %d (size %u) = ", report->id, size);
-- 	for (i = 0; i < size; i++)
-- 		dbg_hid_line(" %02x", data[i]);
-- 	dbg_hid_line("\n");
++ 	snprintf(buf, HID_DEBUG_BUFSIZE - 1,
++ 			"report %d (size %u) = ", report->id, size);
++ 	hid_debug_event(hid, buf);
++ 	for (i = 0; i < size; i++) {
++ 		snprintf(buf, HID_DEBUG_BUFSIZE - 1,
++ 				" %02x", data[i]);
++ 		hid_debug_event(hid, buf);
++ 	}
++ 	hid_debug_event(hid, "\n");
 + 
++ 	kfree(buf);
+  
++ nomem:
   	if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) {
   		ret = hdrv->raw_event(hid, report, data, size);
   		if (ret != 0)
@@@@ -1317,9 -1314,8 -1330,6 +1335,9 @@@@ static const struct hid_device_id hid_b
   	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) },
   	{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },
   	{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
 ++	{ HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) },
  +	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) },
  +	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH) },
   	{ HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
   	{ HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },