Commit 0e382fa7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull HID updates from Jiri Kosina:

 - more bullet-proof handling of devres-managed resources in HID core
   (Dmitry Torokhov)

 - conversion of hid-wacom to use ktime_t (Jason Gerecke)

 - touch selftests for hid-wacom (Joshua Dickens)

 - support for nVidia Thunderstrike (SHIELD 2017) controller (Rahul
   Rameshbabu)

 - power management reset-during-suspend fix for goodix Chromebook
   devices (Fei Shao)

 - assorted device ID additions, device-specific quirks and code
   cleanups

* tag 'for-linus-2023062701' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (27 commits)
  HID: wacom: Use ktime_t rather than int when dealing with timestamps
  HID: hidraw: fix data race on device refcount
  HID: intel-ish-hid: ipc: Add Arrow Lake PCI device ID
  HID: logitech-hidpp: add HIDPP_QUIRK_DELAYED_INIT for the T651.
  HID: add quirk for 03f0:464a HP Elite Presenter Mouse
  HID: nvidia-shield: Support LED functionality for Thunderstrike
  HID: nvidia-shield: Add mappings for consumer HID USAGE buttons
  HID: nvidia-shield: Initial driver implementation with Thunderstrike support
  HID: apple: Option to swap only left side mod keys
  HID: uclogic: Modular KUnit tests should not depend on KUNIT=y
  HID: fix an error code in hid_check_device_match()
  HID: logitech-hidpp: Add USB and Bluetooth IDs for the Logitech G915 TKL Keyboard
  HID: i2c-hid: Switch i2c drivers back to use .probe()
  HID: i2c-hid: goodix: Add support for "goodix,no-reset-during-suspend" property
  dt-bindings: input: goodix: Add "goodix,no-reset-during-suspend" property
  HID: microsoft: Add rumble support to latest xbox controllers
  selftests: hid: Add touch tests for Wacom devices
  HID: ensure timely release of driver-allocated resources
  HID: split apart hid_device_probe to make logic more apparent
  HID: amd_sfh: Split sensor and HID initialization for SFH1.1
  ...
parents 675285ad b571809e
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -43,6 +43,15 @@ properties:
      itself as long as it allows the main board to make signals compatible
      itself as long as it allows the main board to make signals compatible
      with what the touchscreen is expecting for its IO rails.
      with what the touchscreen is expecting for its IO rails.


  goodix,no-reset-during-suspend:
    description:
      Set this to true to enforce the driver to not assert the reset GPIO
      during suspend.
      Due to potential touchscreen hardware flaw, back-powering could happen in
      suspend if the power supply is on and with active-low reset GPIO asserted.
      This property is used to avoid the back-powering issue.
    type: boolean

required:
required:
  - compatible
  - compatible
  - reg
  - reg
+6 −0
Original line number Original line Diff line number Diff line
@@ -9200,6 +9200,12 @@ L: linux-input@vger.kernel.org
S:	Maintained
S:	Maintained
F:	drivers/hid/hid-pxrc.c
F:	drivers/hid/hid-pxrc.c
HID NVIDIA SHIELD DRIVER
M:	Rahul Rameshbabu <rrameshbabu@nvidia.com>
L:	linux-input@vger.kernel.org
S:	Maintained
F:	drivers/hid/hid-nvidia-shield.c
HID PLAYSTATION DRIVER
HID PLAYSTATION DRIVER
M:	Roderick Colenbrander <roderick.colenbrander@sony.com>
M:	Roderick Colenbrander <roderick.colenbrander@sony.com>
L:	linux-input@vger.kernel.org
L:	linux-input@vger.kernel.org
+19 −1
Original line number Original line Diff line number Diff line
@@ -788,6 +788,24 @@ config HID_NTRIG
	help
	help
	Support for N-Trig touch screen.
	Support for N-Trig touch screen.


config HID_NVIDIA_SHIELD
	tristate "NVIDIA SHIELD devices"
	depends on USB_HID
	depends on BT_HIDP
	help
	  Support for NVIDIA SHIELD accessories.

	  Supported devices:
	  - Thunderstrike (NVIDIA SHIELD Controller 2017)

config NVIDIA_SHIELD_FF
	bool "NVIDIA SHIELD force feedback support"
	depends on HID_NVIDIA_SHIELD
	select INPUT_FF_MEMLESS
	help
	  Say Y here if you would like to enable force feedback support for
	  NVIDIA SHIELD accessories with haptics capabilities.

config HID_ORTEK
config HID_ORTEK
	tristate "Ortek PKB-1700/WKB-2000/Skycable wireless keyboard and mouse trackpad"
	tristate "Ortek PKB-1700/WKB-2000/Skycable wireless keyboard and mouse trackpad"
	help
	help
@@ -1285,7 +1303,7 @@ config HID_MCP2221


config HID_KUNIT_TEST
config HID_KUNIT_TEST
	tristate "KUnit tests for HID" if !KUNIT_ALL_TESTS
	tristate "KUnit tests for HID" if !KUNIT_ALL_TESTS
	depends on KUNIT=y
	depends on KUNIT
	depends on HID_BATTERY_STRENGTH
	depends on HID_BATTERY_STRENGTH
	depends on HID_UCLOGIC
	depends on HID_UCLOGIC
	default KUNIT_ALL_TESTS
	default KUNIT_ALL_TESTS
+1 −0
Original line number Original line Diff line number Diff line
@@ -87,6 +87,7 @@ obj-$(CONFIG_HID_MULTITOUCH) += hid-multitouch.o
obj-$(CONFIG_HID_NINTENDO)	+= hid-nintendo.o
obj-$(CONFIG_HID_NINTENDO)	+= hid-nintendo.o
obj-$(CONFIG_HID_NTI)			+= hid-nti.o
obj-$(CONFIG_HID_NTI)			+= hid-nti.o
obj-$(CONFIG_HID_NTRIG)		+= hid-ntrig.o
obj-$(CONFIG_HID_NTRIG)		+= hid-ntrig.o
obj-$(CONFIG_HID_NVIDIA_SHIELD)	+= hid-nvidia-shield.o
obj-$(CONFIG_HID_ORTEK)		+= hid-ortek.o
obj-$(CONFIG_HID_ORTEK)		+= hid-ortek.o
obj-$(CONFIG_HID_PRODIKEYS)	+= hid-prodikeys.o
obj-$(CONFIG_HID_PRODIKEYS)	+= hid-prodikeys.o
obj-$(CONFIG_HID_PANTHERLORD)	+= hid-pl.o
obj-$(CONFIG_HID_PANTHERLORD)	+= hid-pl.o
+14 −33
Original line number Original line Diff line number Diff line
@@ -215,7 +215,7 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
	struct device *dev;
	struct device *dev;
	u32 feature_report_size;
	u32 feature_report_size;
	u32 input_report_size;
	u32 input_report_size;
	int rc, i, status;
	int rc, i;
	u8 cl_idx;
	u8 cl_idx;


	req_list = &cl_data->req_list;
	req_list = &cl_data->req_list;
@@ -286,56 +286,37 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
		if (rc)
		if (rc)
			goto cleanup;
			goto cleanup;
		mp2_ops->start(privdata, info);
		mp2_ops->start(privdata, info);
		status = amd_sfh_wait_for_response
		cl_data->sensor_sts[i] = amd_sfh_wait_for_response
						(privdata, cl_data->sensor_idx[i], SENSOR_ENABLED);
						(privdata, cl_data->sensor_idx[i], SENSOR_ENABLED);
		if (status == SENSOR_ENABLED) {
	}

	for (i = 0; i < cl_data->num_hid_devices; i++) {
		cl_data->cur_hid_dev = i;
		if (cl_data->sensor_sts[i] == SENSOR_ENABLED) {
			cl_data->is_any_sensor_enabled = true;
			cl_data->is_any_sensor_enabled = true;
			cl_data->sensor_sts[i] = SENSOR_ENABLED;
			rc = amdtp_hid_probe(i, cl_data);
			rc = amdtp_hid_probe(cl_data->cur_hid_dev, cl_data);
			if (rc)
			if (rc) {
				mp2_ops->stop(privdata, cl_data->sensor_idx[i]);
				status = amd_sfh_wait_for_response
					(privdata, cl_data->sensor_idx[i], SENSOR_DISABLED);
				if (status != SENSOR_ENABLED)
					cl_data->sensor_sts[i] = SENSOR_DISABLED;
				dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n",
					cl_data->sensor_idx[i],
					get_sensor_name(cl_data->sensor_idx[i]),
					cl_data->sensor_sts[i]);
				goto cleanup;
				goto cleanup;
			}
		} else {
		} else {
			cl_data->sensor_sts[i] = SENSOR_DISABLED;
			cl_data->sensor_sts[i] = SENSOR_DISABLED;
			dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n",
				cl_data->sensor_idx[i],
				get_sensor_name(cl_data->sensor_idx[i]),
				cl_data->sensor_sts[i]);
		}
		}
		dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n",
		dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n",
			cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]),
			cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]),
			cl_data->sensor_sts[i]);
			cl_data->sensor_sts[i]);
	}
	}

	if (!cl_data->is_any_sensor_enabled ||
	if (!cl_data->is_any_sensor_enabled ||
	   (mp2_ops->discovery_status && mp2_ops->discovery_status(privdata) == 0)) {
	   (mp2_ops->discovery_status && mp2_ops->discovery_status(privdata) == 0)) {
		amd_sfh_hid_client_deinit(privdata);
		for (i = 0; i < cl_data->num_hid_devices; i++) {
			devm_kfree(dev, cl_data->feature_report[i]);
			devm_kfree(dev, in_data->input_report[i]);
			devm_kfree(dev, cl_data->report_descr[i]);
		}
		dev_warn(dev, "Failed to discover, sensors not enabled is %d\n", cl_data->is_any_sensor_enabled);
		dev_warn(dev, "Failed to discover, sensors not enabled is %d\n", cl_data->is_any_sensor_enabled);
		return -EOPNOTSUPP;
		rc = -EOPNOTSUPP;
		goto cleanup;
	}
	}
	schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));
	schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));
	return 0;
	return 0;


cleanup:
cleanup:
	amd_sfh_hid_client_deinit(privdata);
	for (i = 0; i < cl_data->num_hid_devices; i++) {
	for (i = 0; i < cl_data->num_hid_devices; i++) {
		if (in_data->sensor_virt_addr[i]) {
			dma_free_coherent(&privdata->pdev->dev, 8 * sizeof(int),
					  in_data->sensor_virt_addr[i],
					  cl_data->sensor_dma_addr[i]);
		}
		devm_kfree(dev, cl_data->feature_report[i]);
		devm_kfree(dev, cl_data->feature_report[i]);
		devm_kfree(dev, in_data->input_report[i]);
		devm_kfree(dev, in_data->input_report[i]);
		devm_kfree(dev, cl_data->report_descr[i]);
		devm_kfree(dev, cl_data->report_descr[i]);
Loading