Merge tag 'hid-for-linus-2025092201' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID fixes from Jiri Kosina: - work data memory corruption fix in amd_sfh (Basavaraj Natikar) - fix for regression in cp2112 where setting a GPIO value would always fail (Sébastien Szymanski) - fix for regression in hid-lenovo causing driver to fail on non-ACPI systems (Janne Grunau) - a couple device ID additions and tiny device-specific quirks * tag 'hid-for-linus-2025092201' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: amd_sfh: Add sync across amd sfh work functions HID: asus: add support for missing PX series fn keys HID: cp2112: fix setter callbacks return value HID: lenovo: Use KEY_PERFORMANCE instead of ACPI's platform_profile HID: intel-thc-hid: intel-quickspi: Add WCL Device IDs HID: intel-thc-hid: intel-quicki2c: Add WCL Device IDs
This commit is contained in:
@@ -597,8 +597,6 @@ config HID_LED
|
||||
|
||||
config HID_LENOVO
|
||||
tristate "Lenovo / Thinkpad devices"
|
||||
depends on ACPI
|
||||
select ACPI_PLATFORM_PROFILE
|
||||
select NEW_LEDS
|
||||
select LEDS_CLASS
|
||||
help
|
||||
|
||||
@@ -39,8 +39,12 @@ int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type)
|
||||
struct amdtp_hid_data *hid_data = hid->driver_data;
|
||||
struct amdtp_cl_data *cli_data = hid_data->cli_data;
|
||||
struct request_list *req_list = &cli_data->req_list;
|
||||
struct amd_input_data *in_data = cli_data->in_data;
|
||||
struct amd_mp2_dev *mp2;
|
||||
int i;
|
||||
|
||||
mp2 = container_of(in_data, struct amd_mp2_dev, in_data);
|
||||
guard(mutex)(&mp2->lock);
|
||||
for (i = 0; i < cli_data->num_hid_devices; i++) {
|
||||
if (cli_data->hid_sensor_hubs[i] == hid) {
|
||||
struct request_list *new = kzalloc(sizeof(*new), GFP_KERNEL);
|
||||
@@ -75,6 +79,8 @@ void amd_sfh_work(struct work_struct *work)
|
||||
u8 report_id, node_type;
|
||||
u8 report_size = 0;
|
||||
|
||||
mp2 = container_of(in_data, struct amd_mp2_dev, in_data);
|
||||
guard(mutex)(&mp2->lock);
|
||||
req_node = list_last_entry(&req_list->list, struct request_list, list);
|
||||
list_del(&req_node->list);
|
||||
current_index = req_node->current_index;
|
||||
@@ -83,7 +89,6 @@ void amd_sfh_work(struct work_struct *work)
|
||||
node_type = req_node->report_type;
|
||||
kfree(req_node);
|
||||
|
||||
mp2 = container_of(in_data, struct amd_mp2_dev, in_data);
|
||||
mp2_ops = mp2->mp2_ops;
|
||||
if (node_type == HID_FEATURE_REPORT) {
|
||||
report_size = mp2_ops->get_feat_rep(sensor_index, report_id,
|
||||
@@ -107,6 +112,8 @@ void amd_sfh_work(struct work_struct *work)
|
||||
cli_data->cur_hid_dev = current_index;
|
||||
cli_data->sensor_requested_cnt[current_index] = 0;
|
||||
amdtp_hid_wakeup(cli_data->hid_sensor_hubs[current_index]);
|
||||
if (!list_empty(&req_list->list))
|
||||
schedule_delayed_work(&cli_data->work, 0);
|
||||
}
|
||||
|
||||
void amd_sfh_work_buffer(struct work_struct *work)
|
||||
@@ -117,9 +124,10 @@ void amd_sfh_work_buffer(struct work_struct *work)
|
||||
u8 report_size;
|
||||
int i;
|
||||
|
||||
mp2 = container_of(in_data, struct amd_mp2_dev, in_data);
|
||||
guard(mutex)(&mp2->lock);
|
||||
for (i = 0; i < cli_data->num_hid_devices; i++) {
|
||||
if (cli_data->sensor_sts[i] == SENSOR_ENABLED) {
|
||||
mp2 = container_of(in_data, struct amd_mp2_dev, in_data);
|
||||
report_size = mp2->mp2_ops->get_in_rep(i, cli_data->sensor_idx[i],
|
||||
cli_data->report_id[i], in_data);
|
||||
hid_input_report(cli_data->hid_sensor_hubs[i], HID_INPUT_REPORT,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#ifndef AMD_SFH_COMMON_H
|
||||
#define AMD_SFH_COMMON_H
|
||||
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/pci.h>
|
||||
#include "amd_sfh_hid.h"
|
||||
|
||||
@@ -59,6 +60,8 @@ struct amd_mp2_dev {
|
||||
u32 mp2_acs;
|
||||
struct sfh_dev_status dev_en;
|
||||
struct work_struct work;
|
||||
/* mp2 to protect data */
|
||||
struct mutex lock;
|
||||
u8 init_done;
|
||||
u8 rver;
|
||||
};
|
||||
|
||||
@@ -466,6 +466,10 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
|
||||
if (!privdata->cl_data)
|
||||
return -ENOMEM;
|
||||
|
||||
rc = devm_mutex_init(&pdev->dev, &privdata->lock);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
privdata->sfh1_1_ops = (const struct amd_sfh1_1_ops *)id->driver_data;
|
||||
if (privdata->sfh1_1_ops) {
|
||||
if (boot_cpu_data.x86 >= 0x1A)
|
||||
|
||||
@@ -974,7 +974,10 @@ static int asus_input_mapping(struct hid_device *hdev,
|
||||
case 0xc4: asus_map_key_clear(KEY_KBDILLUMUP); break;
|
||||
case 0xc5: asus_map_key_clear(KEY_KBDILLUMDOWN); break;
|
||||
case 0xc7: asus_map_key_clear(KEY_KBDILLUMTOGGLE); break;
|
||||
case 0x4e: asus_map_key_clear(KEY_FN_ESC); break;
|
||||
case 0x7e: asus_map_key_clear(KEY_EMOJI_PICKER); break;
|
||||
|
||||
case 0x8b: asus_map_key_clear(KEY_PROG1); break; /* ProArt Creator Hub key */
|
||||
case 0x6b: asus_map_key_clear(KEY_F21); break; /* ASUS touchpad toggle */
|
||||
case 0x38: asus_map_key_clear(KEY_PROG1); break; /* ROG key */
|
||||
case 0xba: asus_map_key_clear(KEY_PROG2); break; /* Fn+C ASUS Splendid */
|
||||
|
||||
@@ -229,10 +229,12 @@ static int cp2112_gpio_set_unlocked(struct cp2112_device *dev,
|
||||
ret = hid_hw_raw_request(hdev, CP2112_GPIO_SET, buf,
|
||||
CP2112_GPIO_SET_LENGTH, HID_FEATURE_REPORT,
|
||||
HID_REQ_SET_REPORT);
|
||||
if (ret < 0)
|
||||
if (ret != CP2112_GPIO_SET_LENGTH) {
|
||||
hid_err(hdev, "error setting GPIO values: %d\n", ret);
|
||||
return ret < 0 ? ret : -EIO;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cp2112_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
@@ -309,9 +311,7 @@ static int cp2112_gpio_direction_output(struct gpio_chip *chip,
|
||||
* Set gpio value when output direction is already set,
|
||||
* as specified in AN495, Rev. 0.2, cpt. 4.4
|
||||
*/
|
||||
cp2112_gpio_set_unlocked(dev, offset, value);
|
||||
|
||||
return 0;
|
||||
return cp2112_gpio_set_unlocked(dev, offset, value);
|
||||
}
|
||||
|
||||
static int cp2112_hid_get(struct hid_device *hdev, unsigned char report_number,
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
#include <linux/leds.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#include <linux/platform_profile.h>
|
||||
|
||||
#include "hid-ids.h"
|
||||
|
||||
/* Userspace expects F20 for mic-mute KEY_MICMUTE does not work */
|
||||
@@ -734,7 +732,7 @@ static int lenovo_raw_event_TP_X12_tab(struct hid_device *hdev, u32 raw_data)
|
||||
report_key_event(input, KEY_RFKILL);
|
||||
return 1;
|
||||
}
|
||||
platform_profile_cycle();
|
||||
report_key_event(input, KEY_PERFORMANCE);
|
||||
return 1;
|
||||
case TP_X12_RAW_HOTKEY_FN_F10:
|
||||
/* TAB1 has PICKUP Phone and TAB2 use Snipping tool*/
|
||||
|
||||
@@ -997,6 +997,8 @@ static const struct pci_device_id quicki2c_pci_tbl[] = {
|
||||
{ PCI_DEVICE_DATA(INTEL, THC_PTL_H_DEVICE_ID_I2C_PORT2, &ptl_ddata) },
|
||||
{ PCI_DEVICE_DATA(INTEL, THC_PTL_U_DEVICE_ID_I2C_PORT1, &ptl_ddata) },
|
||||
{ PCI_DEVICE_DATA(INTEL, THC_PTL_U_DEVICE_ID_I2C_PORT2, &ptl_ddata) },
|
||||
{ PCI_DEVICE_DATA(INTEL, THC_WCL_DEVICE_ID_I2C_PORT1, &ptl_ddata) },
|
||||
{ PCI_DEVICE_DATA(INTEL, THC_WCL_DEVICE_ID_I2C_PORT2, &ptl_ddata) },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, quicki2c_pci_tbl);
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#define PCI_DEVICE_ID_INTEL_THC_PTL_H_DEVICE_ID_I2C_PORT2 0xE34A
|
||||
#define PCI_DEVICE_ID_INTEL_THC_PTL_U_DEVICE_ID_I2C_PORT1 0xE448
|
||||
#define PCI_DEVICE_ID_INTEL_THC_PTL_U_DEVICE_ID_I2C_PORT2 0xE44A
|
||||
#define PCI_DEVICE_ID_INTEL_THC_WCL_DEVICE_ID_I2C_PORT1 0x4D48
|
||||
#define PCI_DEVICE_ID_INTEL_THC_WCL_DEVICE_ID_I2C_PORT2 0x4D4A
|
||||
|
||||
/* Packet size value, the unit is 16 bytes */
|
||||
#define MAX_PACKET_SIZE_VALUE_LNL 256
|
||||
|
||||
@@ -976,6 +976,8 @@ static const struct pci_device_id quickspi_pci_tbl[] = {
|
||||
{PCI_DEVICE_DATA(INTEL, THC_PTL_H_DEVICE_ID_SPI_PORT2, &ptl), },
|
||||
{PCI_DEVICE_DATA(INTEL, THC_PTL_U_DEVICE_ID_SPI_PORT1, &ptl), },
|
||||
{PCI_DEVICE_DATA(INTEL, THC_PTL_U_DEVICE_ID_SPI_PORT2, &ptl), },
|
||||
{PCI_DEVICE_DATA(INTEL, THC_WCL_DEVICE_ID_SPI_PORT1, &ptl), },
|
||||
{PCI_DEVICE_DATA(INTEL, THC_WCL_DEVICE_ID_SPI_PORT2, &ptl), },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, quickspi_pci_tbl);
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#define PCI_DEVICE_ID_INTEL_THC_PTL_H_DEVICE_ID_SPI_PORT2 0xE34B
|
||||
#define PCI_DEVICE_ID_INTEL_THC_PTL_U_DEVICE_ID_SPI_PORT1 0xE449
|
||||
#define PCI_DEVICE_ID_INTEL_THC_PTL_U_DEVICE_ID_SPI_PORT2 0xE44B
|
||||
#define PCI_DEVICE_ID_INTEL_THC_WCL_DEVICE_ID_SPI_PORT1 0x4D49
|
||||
#define PCI_DEVICE_ID_INTEL_THC_WCL_DEVICE_ID_SPI_PORT2 0x4D4B
|
||||
|
||||
/* HIDSPI special ACPI parameters DSM methods */
|
||||
#define ACPI_QUICKSPI_REVISION_NUM 2
|
||||
|
||||
Reference in New Issue
Block a user