mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
Merge b026277a84 ("Merge branch 'for-5.16/core' into for-linus") into android-mainline
Steps on the way to 5.16-rc1 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ia5460bbe34d9cdf7f59ff6b38c1dd72b24fee6a3
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* AMD SFH Client Layer
|
||||
* Copyright 2020 Advanced Micro Devices, Inc.
|
||||
* Copyright 2020-2021 Advanced Micro Devices, Inc.
|
||||
* Authors: Nehal Bakulchandra Shah <Nehal-Bakulchandra.Shah@amd.com>
|
||||
* Sandeep Singh <Sandeep.singh@amd.com>
|
||||
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
|
||||
*/
|
||||
|
||||
#include <linux/dma-mapping.h>
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
/*
|
||||
* AMD MP2 Sensors transport driver
|
||||
*
|
||||
* Copyright 2020-2021 Advanced Micro Devices, Inc.
|
||||
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
|
||||
* Sandeep Singh <sandeep.singh@amd.com>
|
||||
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
|
||||
*/
|
||||
#include <linux/hid.h>
|
||||
#include <linux/wait.h>
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
/*
|
||||
* AMD MP2 Sensors transport driver
|
||||
*
|
||||
* Copyright 2020-2021 Advanced Micro Devices, Inc.
|
||||
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
|
||||
* Sandeep Singh <sandeep.singh@amd.com>
|
||||
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
|
||||
*/
|
||||
|
||||
#ifndef AMDSFH_HID_H
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* AMD MP2 PCIe communication driver
|
||||
* Copyright 2020 Advanced Micro Devices, Inc.
|
||||
* Copyright 2020-2021 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
|
||||
* Sandeep Singh <Sandeep.singh@amd.com>
|
||||
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
|
||||
*/
|
||||
|
||||
#include <linux/bitops.h>
|
||||
@@ -234,7 +235,7 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
|
||||
return -ENOMEM;
|
||||
|
||||
privdata->pdev = pdev;
|
||||
pci_set_drvdata(pdev, privdata);
|
||||
dev_set_drvdata(&pdev->dev, privdata);
|
||||
rc = pcim_enable_device(pdev);
|
||||
if (rc)
|
||||
return rc;
|
||||
@@ -245,10 +246,13 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
|
||||
|
||||
privdata->mmio = pcim_iomap_table(pdev)[2];
|
||||
pci_set_master(pdev);
|
||||
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
|
||||
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
|
||||
if (rc) {
|
||||
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
|
||||
return rc;
|
||||
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
|
||||
if (rc) {
|
||||
dev_err(&pdev->dev, "failed to set DMA mask\n");
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
privdata->cl_data = devm_kzalloc(&pdev->dev, sizeof(struct amdtp_cl_data), GFP_KERNEL);
|
||||
@@ -266,8 +270,7 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
|
||||
|
||||
static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev);
|
||||
struct amd_mp2_dev *mp2 = dev_get_drvdata(dev);
|
||||
struct amdtp_cl_data *cl_data = mp2->cl_data;
|
||||
struct amd_mp2_sensor_info info;
|
||||
int i, status;
|
||||
@@ -292,8 +295,7 @@ static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
|
||||
|
||||
static int __maybe_unused amd_mp2_pci_suspend(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev);
|
||||
struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev);
|
||||
struct amd_mp2_dev *mp2 = dev_get_drvdata(dev);
|
||||
struct amdtp_cl_data *cl_data = mp2->cl_data;
|
||||
int i, status;
|
||||
|
||||
@@ -334,3 +336,4 @@ MODULE_DESCRIPTION(DRIVER_DESC);
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
MODULE_AUTHOR("Shyam Sundar S K <Shyam-sundar.S-k@amd.com>");
|
||||
MODULE_AUTHOR("Sandeep Singh <Sandeep.singh@amd.com>");
|
||||
MODULE_AUTHOR("Basavaraj Natikar <Basavaraj.Natikar@amd.com>");
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
* AMD MP2 PCIe communication driver
|
||||
* Copyright 2020 Advanced Micro Devices, Inc.
|
||||
* Copyright 2020-2021 Advanced Micro Devices, Inc.
|
||||
* Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
|
||||
* Sandeep Singh <Sandeep.singh@amd.com>
|
||||
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
|
||||
*/
|
||||
|
||||
#ifndef PCIE_MP2_AMD_H
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
/*
|
||||
* AMD SFH Report Descriptor generator
|
||||
* Copyright 2020 Advanced Micro Devices, Inc.
|
||||
* Copyright 2020-2021 Advanced Micro Devices, Inc.
|
||||
* Authors: Nehal Bakulchandra Shah <Nehal-Bakulchandra.Shah@amd.com>
|
||||
* Sandeep Singh <sandeep.singh@amd.com>
|
||||
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
* HID report descriptors, structures and routines
|
||||
* Copyright 2020 Advanced Micro Devices, Inc.
|
||||
* Copyright 2020-2021 Advanced Micro Devices, Inc.
|
||||
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
|
||||
* Sandeep Singh <Sandeep.singh@amd.com>
|
||||
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
|
||||
*/
|
||||
|
||||
#ifndef AMD_SFH_HID_DESCRIPTOR_H
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
/*
|
||||
* HID descriptor stuructures
|
||||
* Copyright 2020 Advanced Micro Devices, Inc.
|
||||
* Copyright 2020-2021 Advanced Micro Devices, Inc.
|
||||
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
|
||||
* Sandeep Singh <Sandeep.singh@amd.com>
|
||||
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
|
||||
*/
|
||||
|
||||
#ifndef AMD_SFH_HID_REPORT_DESCRIPTOR_H
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
#define APPLE_RDESC_JIS 0x0001
|
||||
#define APPLE_IGNORE_MOUSE 0x0002
|
||||
#define APPLE_HAS_FN 0x0004
|
||||
#define APPLE_HIDDEV 0x0008
|
||||
/* 0x0010 reserved, was: APPLE_ISO_KEYBOARD */
|
||||
/* 0x0008 reserved, was: APPLE_HIDDEV */
|
||||
#define APPLE_ISO_TILDE_QUIRK 0x0010
|
||||
#define APPLE_MIGHTYMOUSE 0x0020
|
||||
#define APPLE_INVERT_HWHEEL 0x0040
|
||||
#define APPLE_IGNORE_HIDINPUT 0x0080
|
||||
/* 0x0080 reserved, was: APPLE_IGNORE_HIDINPUT */
|
||||
#define APPLE_NUMLOCK_EMULATION 0x0100
|
||||
|
||||
#define APPLE_FLAG_FKEY 0x01
|
||||
@@ -40,10 +40,10 @@ module_param(fnmode, uint, 0644);
|
||||
MODULE_PARM_DESC(fnmode, "Mode of fn key on Apple keyboards (0 = disabled, "
|
||||
"[1] = fkeyslast, 2 = fkeysfirst)");
|
||||
|
||||
static unsigned int iso_layout = 1;
|
||||
module_param(iso_layout, uint, 0644);
|
||||
MODULE_PARM_DESC(iso_layout, "Enable/Disable hardcoded ISO-layout of the keyboard. "
|
||||
"(0 = disabled, [1] = enabled)");
|
||||
static int iso_layout = -1;
|
||||
module_param(iso_layout, int, 0644);
|
||||
MODULE_PARM_DESC(iso_layout, "Swap the backtick/tilde and greater-than/less-than keys. "
|
||||
"([-1] = auto, 0 = disabled, 1 = enabled)");
|
||||
|
||||
static unsigned int swap_opt_cmd;
|
||||
module_param(swap_opt_cmd, uint, 0644);
|
||||
@@ -277,14 +277,13 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
|
||||
}
|
||||
}
|
||||
|
||||
if (iso_layout) {
|
||||
if (hid->country == HID_COUNTRY_INTERNATIONAL_ISO) {
|
||||
trans = apple_find_translation(apple_iso_keyboard, usage->code);
|
||||
if (trans) {
|
||||
input_event_with_scancode(input, usage->type,
|
||||
trans->to, usage->hid, value);
|
||||
return 1;
|
||||
}
|
||||
if (iso_layout > 0 || (iso_layout < 0 && (asc->quirks & APPLE_ISO_TILDE_QUIRK) &&
|
||||
hid->country == HID_COUNTRY_INTERNATIONAL_ISO)) {
|
||||
trans = apple_find_translation(apple_iso_keyboard, usage->code);
|
||||
if (trans) {
|
||||
input_event_with_scancode(input, usage->type,
|
||||
trans->to, usage->hid, value);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,7 +439,6 @@ static int apple_probe(struct hid_device *hdev,
|
||||
{
|
||||
unsigned long quirks = id->driver_data;
|
||||
struct apple_sc *asc;
|
||||
unsigned int connect_mask = HID_CONNECT_DEFAULT;
|
||||
int ret;
|
||||
|
||||
asc = devm_kzalloc(&hdev->dev, sizeof(*asc), GFP_KERNEL);
|
||||
@@ -459,12 +457,7 @@ static int apple_probe(struct hid_device *hdev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (quirks & APPLE_HIDDEV)
|
||||
connect_mask |= HID_CONNECT_HIDDEV_FORCE;
|
||||
if (quirks & APPLE_IGNORE_HIDINPUT)
|
||||
connect_mask &= ~HID_CONNECT_HIDINPUT;
|
||||
|
||||
ret = hid_hw_start(hdev, connect_mask);
|
||||
ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
|
||||
if (ret) {
|
||||
hid_err(hdev, "hw start failed\n");
|
||||
return ret;
|
||||
@@ -533,9 +526,11 @@ static const struct hid_device_id apple_devices[] = {
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN |
|
||||
APPLE_ISO_TILDE_QUIRK },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN |
|
||||
APPLE_ISO_TILDE_QUIRK },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
|
||||
USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
@@ -544,14 +539,14 @@ static const struct hid_device_id apple_devices[] = {
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI),
|
||||
.driver_data = APPLE_HAS_FN },
|
||||
{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI),
|
||||
.driver_data = APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_ANSI),
|
||||
.driver_data = APPLE_HAS_FN },
|
||||
{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_ANSI),
|
||||
.driver_data = APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2015),
|
||||
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
|
||||
{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2015),
|
||||
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2015),
|
||||
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
|
||||
{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2015),
|
||||
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI),
|
||||
.driver_data = APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO),
|
||||
@@ -633,13 +628,18 @@ static const struct hid_device_id apple_devices[] = {
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN |
|
||||
APPLE_ISO_TILDE_QUIRK },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
|
||||
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
|
||||
{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
|
||||
.driver_data = APPLE_HAS_FN | APPLE_ISO_TILDE_QUIRK },
|
||||
|
||||
{ }
|
||||
};
|
||||
|
||||
@@ -854,7 +854,7 @@ static int asus_input_mapping(struct hid_device *hdev,
|
||||
switch (usage->hid & HID_USAGE) {
|
||||
case 0x10: asus_map_key_clear(KEY_BRIGHTNESSDOWN); break;
|
||||
case 0x20: asus_map_key_clear(KEY_BRIGHTNESSUP); break;
|
||||
case 0x35: asus_map_key_clear(KEY_DISPLAY_OFF); break;
|
||||
case 0x35: asus_map_key_clear(KEY_SCREENLOCK); break;
|
||||
case 0x6c: asus_map_key_clear(KEY_SLEEP); break;
|
||||
case 0x7c: asus_map_key_clear(KEY_MICMUTE); break;
|
||||
case 0x82: asus_map_key_clear(KEY_CAMERA); break;
|
||||
|
||||
@@ -179,10 +179,9 @@ static int cougar_bind_shared_data(struct hid_device *hdev,
|
||||
|
||||
cougar->shared = shared;
|
||||
|
||||
error = devm_add_action(&hdev->dev, cougar_remove_shared_data, cougar);
|
||||
error = devm_add_action_or_reset(&hdev->dev, cougar_remove_shared_data, cougar);
|
||||
if (error) {
|
||||
mutex_unlock(&cougar_udev_list_lock);
|
||||
cougar_remove_shared_data(cougar);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -160,6 +160,7 @@ static const struct hid_usage_entry hid_usage_table[] = {
|
||||
{0, 0x59, "ButtonType"},
|
||||
{0, 0x5A, "SecondaryBarrelSwitch"},
|
||||
{0, 0x5B, "TransducerSerialNumber"},
|
||||
{0, 0x6e, "TransducerSerialNumber2"},
|
||||
{ 15, 0, "PhysicalInterfaceDevice" },
|
||||
{0, 0x00, "Undefined"},
|
||||
{0, 0x01, "Physical_Interface_Device"},
|
||||
@@ -486,8 +487,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) {
|
||||
|
||||
if (!f) {
|
||||
len = strlen(buf);
|
||||
snprintf(buf+len, max(0, HID_DEBUG_BUFSIZE - len), ".");
|
||||
len++;
|
||||
len += scnprintf(buf + len, HID_DEBUG_BUFSIZE - len, ".");
|
||||
}
|
||||
else {
|
||||
seq_printf(f, ".");
|
||||
@@ -498,7 +498,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) {
|
||||
if (p->usage == (usage & 0xffff)) {
|
||||
if (!f)
|
||||
snprintf(buf + len,
|
||||
max(0,HID_DEBUG_BUFSIZE - len - 1),
|
||||
HID_DEBUG_BUFSIZE - len,
|
||||
"%s", p->description);
|
||||
else
|
||||
seq_printf(f,
|
||||
@@ -509,8 +509,8 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) {
|
||||
break;
|
||||
}
|
||||
if (!f)
|
||||
snprintf(buf + len, max(0, HID_DEBUG_BUFSIZE - len - 1),
|
||||
"%04x", usage & 0xffff);
|
||||
snprintf(buf + len, HID_DEBUG_BUFSIZE - len, "%04x",
|
||||
usage & 0xffff);
|
||||
else
|
||||
seq_printf(f, "%04x", usage & 0xffff);
|
||||
return buf;
|
||||
|
||||
@@ -159,8 +159,8 @@
|
||||
#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI 0x0255
|
||||
#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO 0x0256
|
||||
#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_JIS 0x0257
|
||||
#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI 0x0267
|
||||
#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_ANSI 0x026c
|
||||
#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2015 0x0267
|
||||
#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2015 0x026c
|
||||
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI 0x0290
|
||||
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO 0x0291
|
||||
#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS 0x0292
|
||||
@@ -174,6 +174,7 @@
|
||||
#define USB_DEVICE_ID_APPLE_IRCONTROL3 0x8241
|
||||
#define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242
|
||||
#define USB_DEVICE_ID_APPLE_IRCONTROL5 0x8243
|
||||
#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 0x029c
|
||||
|
||||
#define USB_VENDOR_ID_ASUS 0x0486
|
||||
#define USB_DEVICE_ID_ASUS_T91MT 0x0185
|
||||
@@ -1279,6 +1280,9 @@
|
||||
#define USB_DEVICE_ID_WEIDA_8752 0xC300
|
||||
#define USB_DEVICE_ID_WEIDA_8755 0xC301
|
||||
|
||||
#define USB_VENDOR_ID_WINBOND 0x0416
|
||||
#define USB_DEVICE_ID_TSTP_MTOUCH 0xc168
|
||||
|
||||
#define USB_VENDOR_ID_WISEGROUP 0x0925
|
||||
#define USB_DEVICE_ID_SMARTJOY_PLUS 0x0005
|
||||
#define USB_DEVICE_ID_SUPER_JOY_BOX_3 0x8888
|
||||
|
||||
@@ -871,6 +871,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
|
||||
break;
|
||||
|
||||
case 0x5b: /* TransducerSerialNumber */
|
||||
case 0x6e: /* TransducerSerialNumber2 */
|
||||
usage->type = EV_MSC;
|
||||
usage->code = MSC_SERIAL;
|
||||
bit = input->mscbit;
|
||||
|
||||
@@ -193,6 +193,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
|
||||
/* reserved 0x0014 */
|
||||
#define MT_CLS_WIN_8_FORCE_MULTI_INPUT 0x0015
|
||||
#define MT_CLS_WIN_8_DISABLE_WAKEUP 0x0016
|
||||
#define MT_CLS_WIN_8_NO_STICKY_FINGERS 0x0017
|
||||
|
||||
/* vendor specific classes */
|
||||
#define MT_CLS_3M 0x0101
|
||||
@@ -294,6 +295,13 @@ static const struct mt_class mt_classes[] = {
|
||||
MT_QUIRK_WIN8_PTP_BUTTONS |
|
||||
MT_QUIRK_DISABLE_WAKEUP,
|
||||
.export_all_inputs = true },
|
||||
{ .name = MT_CLS_WIN_8_NO_STICKY_FINGERS,
|
||||
.quirks = MT_QUIRK_ALWAYS_VALID |
|
||||
MT_QUIRK_IGNORE_DUPLICATES |
|
||||
MT_QUIRK_HOVERING |
|
||||
MT_QUIRK_CONTACT_CNT_ACCURATE |
|
||||
MT_QUIRK_WIN8_PTP_BUTTONS,
|
||||
.export_all_inputs = true },
|
||||
|
||||
/*
|
||||
* vendor specific classes
|
||||
@@ -2120,6 +2128,11 @@ static const struct hid_device_id mt_devices[] = {
|
||||
MT_USB_DEVICE(USB_VENDOR_ID_VTL,
|
||||
USB_DEVICE_ID_VTL_MULTITOUCH_FF3F) },
|
||||
|
||||
/* Winbond Electronics Corp. */
|
||||
{ .driver_data = MT_CLS_WIN_8_NO_STICKY_FINGERS,
|
||||
HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH_WIN_8,
|
||||
USB_VENDOR_ID_WINBOND, USB_DEVICE_ID_TSTP_MTOUCH) },
|
||||
|
||||
/* Wistron panels */
|
||||
{ .driver_data = MT_CLS_NSMU,
|
||||
MT_USB_DEVICE(USB_VENDOR_ID_WISTRON,
|
||||
|
||||
@@ -299,9 +299,10 @@ static const struct hid_device_id hid_have_special_driver[] = {
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI) },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO) },
|
||||
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_JIS) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2015) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021) },
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_HID_APPLEIR)
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) },
|
||||
|
||||
@@ -132,7 +132,7 @@ static int u2fzero_recv(struct u2fzero_device *dev,
|
||||
|
||||
ret = (wait_for_completion_timeout(
|
||||
&ctx.done, msecs_to_jiffies(USB_CTRL_SET_TIMEOUT)));
|
||||
if (ret < 0) {
|
||||
if (ret == 0) {
|
||||
usb_kill_urb(dev->urb);
|
||||
hid_err(hdev, "urb submission timed out");
|
||||
} else {
|
||||
@@ -191,6 +191,8 @@ static int u2fzero_rng_read(struct hwrng *rng, void *data,
|
||||
struct u2f_hid_msg resp;
|
||||
int ret;
|
||||
size_t actual_length;
|
||||
/* valid packets must have a correct header */
|
||||
int min_length = offsetof(struct u2f_hid_msg, init.data);
|
||||
|
||||
if (!dev->present) {
|
||||
hid_dbg(dev->hdev, "device not present");
|
||||
@@ -200,12 +202,12 @@ static int u2fzero_rng_read(struct hwrng *rng, void *data,
|
||||
ret = u2fzero_recv(dev, &req, &resp);
|
||||
|
||||
/* ignore errors or packets without data */
|
||||
if (ret < offsetof(struct u2f_hid_msg, init.data))
|
||||
if (ret < min_length)
|
||||
return 0;
|
||||
|
||||
/* only take the minimum amount of data it is safe to take */
|
||||
actual_length = min3((size_t)ret - offsetof(struct u2f_hid_msg,
|
||||
init.data), U2F_HID_MSG_LEN(resp), max);
|
||||
actual_length = min3((size_t)ret - min_length,
|
||||
U2F_HID_MSG_LEN(resp), max);
|
||||
|
||||
memcpy(data, resp.init.data, actual_length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user