Commit fef018d8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'hid-for-linus-2024010801' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid

Pull HID updates from Jiri Kosina:

 - assorted functional fixes for hid-steam ported from SteamOS betas
   (Vicki Pfau)

 - fix for custom sensor-hub sensors (hinge angle sensor and LISS
   sensors) not working (Yauhen Kharuzhy)

 - functional fix for handling Confidence in Wacom driver (Jason
   Gerecke)

 - support for Ilitek ili2901 touchscreen (Zhengqiao Xia)

 - power management fix for Wacom userspace battery exporting
   (Tatsunosuke Tobita)

 - rework of wait-for-reset in order to reduce the need for
   I2C_HID_QUIRK_NO_IRQ_AFTER_RESET qurk; the success rate is now 50%
   better, but there are still further improvements to be made (Hans de
   Goede)

 - greatly improved coverage of Tablets in hid-selftests (Benjamin
   Tissoires)

 - support for Nintendo NSO controllers -- SNES, Genesis and N64 (Ryan
   McClelland)

 - support for controlling mcp2200 GPIOs (Johannes Roith)

 - power management improvement for EHL OOB wakeup in intel-ish
   (Kai-Heng Feng)

 - other assorted device-specific fixes and code cleanups

* tag 'hid-for-linus-2024010801' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (53 commits)
  HID: amd_sfh: Add a new interface for exporting ALS data
  HID: amd_sfh: Add a new interface for exporting HPD data
  HID: amd_sfh: rename float_to_int() to amd_sfh_float_to_int()
  HID: i2c-hid: elan: Add ili2901 timing
  dt-bindings: HID: i2c-hid: elan: Introduce Ilitek ili2901
  HID: bpf: make bus_type const in struct hid_bpf_ops
  HID: make ishtp_cl_bus_type const
  HID: make hid_bus_type const
  HID: hid-steam: Add gamepad-only mode switched to by holding options
  HID: hid-steam: Better handling of serial number length
  HID: hid-steam: Update list of identifiers from SDL
  HID: hid-steam: Make client_opened a counter
  HID: hid-steam: Clean up locking
  HID: hid-steam: Disable watchdog instead of using a heartbeat
  HID: hid-steam: Avoid overwriting smoothing parameter
  HID: magicmouse: fix kerneldoc for struct magicmouse_sc
  HID: sensor-hub: Enable hid core report processing for all devices
  HID: wacom: Add additional tests of confidence behavior
  HID: wacom: Correct behavior when processing some confidence == false touches
  HID: nintendo: add support for nso controllers
  ...
parents d97a7842 0b43615a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -18,8 +18,9 @@ allOf:

properties:
  compatible:
    items:
      - const: elan,ekth6915
    enum:
      - elan,ekth6915
      - ilitek,ili2901

  reg:
    const: 0x10
+16 −6
Original line number Diff line number Diff line
@@ -761,14 +761,15 @@ config HID_MULTITOUCH
	  module will be called hid-multitouch.

config HID_NINTENDO
	tristate "Nintendo Joy-Con and Pro Controller support"
	tristate "Nintendo Joy-Con, NSO, and Pro Controller support"
	depends on NEW_LEDS
	depends on LEDS_CLASS
	select POWER_SUPPLY
	help
	Adds support for the Nintendo Switch Joy-Cons and Pro Controller.
	Adds support for the Nintendo Switch Joy-Cons, NSO, Pro Controller.
	All controllers support bluetooth, and the Pro Controller also supports
	its USB mode.
	its USB mode. This also includes support for the Nintendo Switch Online
	Controllers which include the Genesis, SNES, and N64 controllers.

	To compile this driver as a module, choose M here: the
	module will be called hid-nintendo.
@@ -779,9 +780,9 @@ config NINTENDO_FF
	select INPUT_FF_MEMLESS
	help
	Say Y here if you have a Nintendo Switch controller and want to enable
	force feedback support for it. This works for both joy-cons and the pro
	controller. For the pro controller, both rumble motors can be controlled
	individually.
	force feedback support for it. This works for both joy-cons, the pro
	controller, and the NSO N64 controller. For the pro controller, both
	rumble motors can be controlled individually.

config HID_NTI
	tristate "NTI keyboard adapters"
@@ -1296,6 +1297,15 @@ config HID_ALPS
	Say Y here if you have a Alps touchpads over i2c-hid or usbhid
	and want support for its special functionalities.

config HID_MCP2200
	tristate "Microchip MCP2200 HID USB-to-GPIO bridge"
	depends on USB_HID && GPIOLIB
	help
	  Provides GPIO functionality over USB-HID through MCP2200 device.

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

config HID_MCP2221
	tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
	depends on USB_HID && I2C
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ obj-$(CONFIG_HID_LOGITECH_HIDPP) += hid-logitech-hidpp.o
obj-$(CONFIG_HID_MACALLY)	+= hid-macally.o
obj-$(CONFIG_HID_MAGICMOUSE)	+= hid-magicmouse.o
obj-$(CONFIG_HID_MALTRON)	+= hid-maltron.o
obj-$(CONFIG_HID_MCP2200)	+= hid-mcp2200.o
obj-$(CONFIG_HID_MCP2221)	+= hid-mcp2221.o
obj-$(CONFIG_HID_MAYFLASH)	+= hid-mf.o
obj-$(CONFIG_HID_MEGAWORLD_FF)	+= hid-megaworld.o
+6 −0
Original line number Diff line number Diff line
@@ -37,6 +37,11 @@ struct amd_mp2_sensor_info {
	dma_addr_t dma_address;
};

struct sfh_dev_status {
	bool is_hpd_present;
	bool is_als_present;
};

struct amd_mp2_dev {
	struct pci_dev *pdev;
	struct amdtp_cl_data *cl_data;
@@ -47,6 +52,7 @@ struct amd_mp2_dev {
	struct amd_input_data in_data;
	/* mp2 active control status */
	u32 mp2_acs;
	struct sfh_dev_status dev_en;
};

struct amd_mp2_ops {
+15 −13
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ static void get_common_inputs(struct common_input_property *common, int report_i
	common->event_type = HID_USAGE_SENSOR_EVENT_DATA_UPDATED_ENUM;
}

static int float_to_int(u32 flt32_val)
int amd_sfh_float_to_int(u32 flt32_val)
{
	int fraction, shift, mantissa, sign, exp, zeropre;

@@ -201,9 +201,9 @@ static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id,
			     OFFSET_SENSOR_DATA_DEFAULT;
		memcpy_fromio(&accel_data, sensoraddr, sizeof(struct sfh_accel_data));
		get_common_inputs(&acc_input.common_property, report_id);
		acc_input.in_accel_x_value = float_to_int(accel_data.acceldata.x) / 100;
		acc_input.in_accel_y_value = float_to_int(accel_data.acceldata.y) / 100;
		acc_input.in_accel_z_value = float_to_int(accel_data.acceldata.z) / 100;
		acc_input.in_accel_x_value = amd_sfh_float_to_int(accel_data.acceldata.x) / 100;
		acc_input.in_accel_y_value = amd_sfh_float_to_int(accel_data.acceldata.y) / 100;
		acc_input.in_accel_z_value = amd_sfh_float_to_int(accel_data.acceldata.z) / 100;
		memcpy(input_report, &acc_input, sizeof(acc_input));
		report_size = sizeof(acc_input);
		break;
@@ -212,9 +212,9 @@ static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id,
			     OFFSET_SENSOR_DATA_DEFAULT;
		memcpy_fromio(&gyro_data, sensoraddr, sizeof(struct sfh_gyro_data));
		get_common_inputs(&gyro_input.common_property, report_id);
		gyro_input.in_angel_x_value = float_to_int(gyro_data.gyrodata.x) / 1000;
		gyro_input.in_angel_y_value = float_to_int(gyro_data.gyrodata.y) / 1000;
		gyro_input.in_angel_z_value = float_to_int(gyro_data.gyrodata.z) / 1000;
		gyro_input.in_angel_x_value = amd_sfh_float_to_int(gyro_data.gyrodata.x) / 1000;
		gyro_input.in_angel_y_value = amd_sfh_float_to_int(gyro_data.gyrodata.y) / 1000;
		gyro_input.in_angel_z_value = amd_sfh_float_to_int(gyro_data.gyrodata.z) / 1000;
		memcpy(input_report, &gyro_input, sizeof(gyro_input));
		report_size = sizeof(gyro_input);
		break;
@@ -223,9 +223,9 @@ static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id,
			     OFFSET_SENSOR_DATA_DEFAULT;
		memcpy_fromio(&mag_data, sensoraddr, sizeof(struct sfh_mag_data));
		get_common_inputs(&magno_input.common_property, report_id);
		magno_input.in_magno_x = float_to_int(mag_data.magdata.x) / 100;
		magno_input.in_magno_y = float_to_int(mag_data.magdata.y) / 100;
		magno_input.in_magno_z = float_to_int(mag_data.magdata.z) / 100;
		magno_input.in_magno_x = amd_sfh_float_to_int(mag_data.magdata.x) / 100;
		magno_input.in_magno_y = amd_sfh_float_to_int(mag_data.magdata.y) / 100;
		magno_input.in_magno_z = amd_sfh_float_to_int(mag_data.magdata.z) / 100;
		magno_input.in_magno_accuracy = mag_data.accuracy / 100;
		memcpy(input_report, &magno_input, sizeof(magno_input));
		report_size = sizeof(magno_input);
@@ -235,13 +235,15 @@ static u8 get_input_rep(u8 current_index, int sensor_idx, int report_id,
			     OFFSET_SENSOR_DATA_DEFAULT;
		memcpy_fromio(&als_data, sensoraddr, sizeof(struct sfh_als_data));
		get_common_inputs(&als_input.common_property, report_id);
		als_input.illuminance_value = float_to_int(als_data.lux);
		als_input.illuminance_value = amd_sfh_float_to_int(als_data.lux);

		memcpy_fromio(&binfo, mp2->vsbase, sizeof(struct sfh_base_info));
		if (binfo.sbase.s_prop[ALS_IDX].sf.feat & 0x2) {
			als_input.light_color_temp = als_data.light_color_temp;
			als_input.chromaticity_x_value = float_to_int(als_data.chromaticity_x);
			als_input.chromaticity_y_value = float_to_int(als_data.chromaticity_y);
			als_input.chromaticity_x_value =
				amd_sfh_float_to_int(als_data.chromaticity_x);
			als_input.chromaticity_y_value =
				amd_sfh_float_to_int(als_data.chromaticity_y);
		}

		report_size = sizeof(als_input);
Loading