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

Commit 60d2c252 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull HID fixes from Jiri Kosina:
 "The most important one is a purification of Kconfig for CONFIG_HID;
  the inclusion of HID groups and autoloading didn't leave the Kconfig
  in a really consistent state.  Henrik's patch fixes that.  In addition
  to that, there are two small fixes for logitech and magicmouse
  drivers."

* 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: Fix the generic Kconfig options
  HID: magicmouse: Correct report range of major / minor axes
  HID: logitech: don't use stack based dj_report structures
parents aace99e5 1f41a6a9
Loading
Loading
Loading
Loading
+20 −23
Original line number Original line Diff line number Diff line
#
#
# HID driver configuration
# HID driver configuration
#
#
menuconfig HID_SUPPORT
menu "HID support"
	bool "HID Devices"
     depends on INPUT
     depends on INPUT
	default y
	---help---
	  Say Y here to get to see options for various computer-human interface
	  device drivers. This option alone does not add any kernel code.

	  If you say N, all options in this submenu will be skipped and disabled.

if HID_SUPPORT


config HID
config HID
	tristate "Generic HID support"
	tristate "HID bus support"
	depends on INPUT
	depends on INPUT
	default y
	default y
	---help---
	---help---
@@ -23,14 +14,17 @@ config HID
	  most commonly used to refer to the USB-HID specification, but other
	  most commonly used to refer to the USB-HID specification, but other
	  devices (such as, but not strictly limited to, Bluetooth) are
	  devices (such as, but not strictly limited to, Bluetooth) are
	  designed using HID specification (this involves certain keyboards,
	  designed using HID specification (this involves certain keyboards,
	  mice, tablets, etc). This option compiles into kernel the generic
	  mice, tablets, etc). This option adds the HID bus to the kernel,
	  HID layer code (parser, usages, etc.), which can then be used by
	  together with generic HID layer code. The HID devices are added and
	  transport-specific HID implementation (like USB or Bluetooth).
	  removed from the HID bus by the transport-layer drivers, such as
	  usbhid (USB_HID) and hidp (BT_HIDP).


	  For docs and specs, see http://www.usb.org/developers/hidpage/
	  For docs and specs, see http://www.usb.org/developers/hidpage/


	  If unsure, say Y.
	  If unsure, say Y.


if HID

config HID_BATTERY_STRENGTH
config HID_BATTERY_STRENGTH
	bool "Battery level reporting for HID devices"
	bool "Battery level reporting for HID devices"
	depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY
	depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY
@@ -59,23 +53,22 @@ config HIDRAW


	If unsure, say Y.
	If unsure, say Y.


source "drivers/hid/usbhid/Kconfig"

menu "Special HID drivers"
	depends on HID

config HID_GENERIC
config HID_GENERIC
	tristate "Generic HID driver"
	tristate "Generic HID driver"
	depends on HID
	depends on HID
	default y
	default HID
	---help---
	---help---
	Support for generic HID devices.
	Support for generic devices on the HID bus. This includes most
	keyboards and mice, joysticks, tablets and digitizers.


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


	If unsure, say Y.
	If unsure, say Y.


menu "Special HID drivers"
	depends on HID

config HID_A4TECH
config HID_A4TECH
	tristate "A4 tech mice" if EXPERT
	tristate "A4 tech mice" if EXPERT
	depends on USB_HID
	depends on USB_HID
@@ -662,4 +655,8 @@ config HID_ZYDACRON


endmenu
endmenu


endif # HID_SUPPORT
endif # HID

source "drivers/hid/usbhid/Kconfig"

endmenu
+24 −14
Original line number Original line Diff line number Diff line
@@ -436,27 +436,37 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,


static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)
static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)
{
{
	struct dj_report dj_report;
	struct dj_report *dj_report;
	int retval;


	memset(&dj_report, 0, sizeof(dj_report));
	dj_report = kzalloc(sizeof(dj_report), GFP_KERNEL);
	dj_report.report_id = REPORT_ID_DJ_SHORT;
	if (!dj_report)
	dj_report.device_index = 0xFF;
		return -ENOMEM;
	dj_report.report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES;
	dj_report->report_id = REPORT_ID_DJ_SHORT;
	return logi_dj_recv_send_report(djrcv_dev, &dj_report);
	dj_report->device_index = 0xFF;
	dj_report->report_type = REPORT_TYPE_CMD_GET_PAIRED_DEVICES;
	retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
	kfree(dj_report);
	return retval;
}
}


static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
					  unsigned timeout)
					  unsigned timeout)
{
{
	struct dj_report dj_report;
	struct dj_report *dj_report;
	int retval;


	memset(&dj_report, 0, sizeof(dj_report));
	dj_report = kzalloc(sizeof(dj_report), GFP_KERNEL);
	dj_report.report_id = REPORT_ID_DJ_SHORT;
	if (!dj_report)
	dj_report.device_index = 0xFF;
		return -ENOMEM;
	dj_report.report_type = REPORT_TYPE_CMD_SWITCH;
	dj_report->report_id = REPORT_ID_DJ_SHORT;
	dj_report.report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F;
	dj_report->device_index = 0xFF;
	dj_report.report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] = (u8)timeout;
	dj_report->report_type = REPORT_TYPE_CMD_SWITCH;
	return logi_dj_recv_send_report(djrcv_dev, &dj_report);
	dj_report->report_params[CMD_SWITCH_PARAM_DEVBITFIELD] = 0x3F;
	dj_report->report_params[CMD_SWITCH_PARAM_TIMEOUT_SECONDS] = (u8)timeout;
	retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
	kfree(dj_report);
	return retval;
}
}




+4 −2
Original line number Original line Diff line number Diff line
@@ -426,8 +426,10 @@ static void magicmouse_setup_input(struct input_dev *input, struct hid_device *h
		__set_bit(EV_ABS, input->evbit);
		__set_bit(EV_ABS, input->evbit);


		input_set_abs_params(input, ABS_MT_TRACKING_ID, 0, 15, 0, 0);
		input_set_abs_params(input, ABS_MT_TRACKING_ID, 0, 15, 0, 0);
		input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 255, 4, 0);
		input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 255 << 2,
		input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 255, 4, 0);
				     4, 0);
		input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 255 << 2,
				     4, 0);
		input_set_abs_params(input, ABS_MT_ORIENTATION, -31, 32, 1, 0);
		input_set_abs_params(input, ABS_MT_ORIENTATION, -31, 32, 1, 0);


		/* Note: Touch Y position from the device is inverted relative
		/* Note: Touch Y position from the device is inverted relative
+4 −4
Original line number Original line Diff line number Diff line
comment "USB Input Devices"
menu "USB HID support"
	depends on USB
	depends on USB


config USB_HID
config USB_HID
	tristate "USB Human Interface Device (full HID) support"
	tristate "USB HID transport layer"
	default y
	default y
	depends on USB && INPUT
	depends on USB && INPUT
	select HID
	select HID
	---help---
	---help---
	  Say Y here if you want full HID support to connect USB keyboards,
	  Say Y here if you want to connect USB keyboards,
	  mice, joysticks, graphic tablets, or any other HID based devices
	  mice, joysticks, graphic tablets, or any other HID based devices
	  to your computer via USB, as well as Uninterruptible Power Supply
	  to your computer via USB, as well as Uninterruptible Power Supply
	  (UPS) and monitor control devices.
	  (UPS) and monitor control devices.
@@ -81,4 +81,4 @@ config USB_MOUSE


endmenu
endmenu


endmenu
+1 −1
Original line number Original line Diff line number Diff line
config BT_HIDP
config BT_HIDP
	tristate "HIDP protocol support"
	tristate "HIDP protocol support"
	depends on BT && INPUT && HID_SUPPORT
	depends on BT && INPUT
	select HID
	select HID
	help
	help
	  HIDP (Human Interface Device Protocol) is a transport layer
	  HIDP (Human Interface Device Protocol) is a transport layer