Commit 7d3879bd authored by Benjamin Tissoires's avatar Benjamin Tissoires

Merge branch 'for-5.1/upstream-fixes' into for-5.2/logitech

parents 1f87b0cd a50e8e2e
...@@ -150,6 +150,7 @@ config HID_ASUS ...@@ -150,6 +150,7 @@ config HID_ASUS
tristate "Asus" tristate "Asus"
depends on LEDS_CLASS depends on LEDS_CLASS
depends on ASUS_WMI || ASUS_WMI=n depends on ASUS_WMI || ASUS_WMI=n
select POWER_SUPPLY
---help--- ---help---
Support for Asus notebook built-in keyboard and touchpad via i2c, and Support for Asus notebook built-in keyboard and touchpad via i2c, and
the Asus Republic of Gamers laptop keyboard special keys. the Asus Republic of Gamers laptop keyboard special keys.
......
...@@ -1301,10 +1301,10 @@ static u32 __extract(u8 *report, unsigned offset, int n) ...@@ -1301,10 +1301,10 @@ static u32 __extract(u8 *report, unsigned offset, int n)
u32 hid_field_extract(const struct hid_device *hid, u8 *report, u32 hid_field_extract(const struct hid_device *hid, u8 *report,
unsigned offset, unsigned n) unsigned offset, unsigned n)
{ {
if (n > 32) { if (n > 256) {
hid_warn(hid, "hid_field_extract() called with n (%d) > 32! (%s)\n", hid_warn(hid, "hid_field_extract() called with n (%d) > 256! (%s)\n",
n, current->comm); n, current->comm);
n = 32; n = 256;
} }
return __extract(report, offset, n); return __extract(report, offset, n);
......
...@@ -1060,10 +1060,15 @@ static int hid_debug_rdesc_show(struct seq_file *f, void *p) ...@@ -1060,10 +1060,15 @@ static int hid_debug_rdesc_show(struct seq_file *f, void *p)
seq_printf(f, "\n\n"); seq_printf(f, "\n\n");
/* dump parsed data and input mappings */ /* dump parsed data and input mappings */
if (down_interruptible(&hdev->driver_input_lock))
return 0;
hid_dump_device(hdev, f); hid_dump_device(hdev, f);
seq_printf(f, "\n"); seq_printf(f, "\n");
hid_dump_input_mapping(hdev, f); hid_dump_input_mapping(hdev, f);
up(&hdev->driver_input_lock);
return 0; return 0;
} }
......
...@@ -998,6 +998,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel ...@@ -998,6 +998,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case 0x1b8: map_key_clear(KEY_VIDEO); break; case 0x1b8: map_key_clear(KEY_VIDEO); break;
case 0x1bc: map_key_clear(KEY_MESSENGER); break; case 0x1bc: map_key_clear(KEY_MESSENGER); break;
case 0x1bd: map_key_clear(KEY_INFO); break; case 0x1bd: map_key_clear(KEY_INFO); break;
case 0x1cb: map_key_clear(KEY_ASSISTANT); break;
case 0x201: map_key_clear(KEY_NEW); break; case 0x201: map_key_clear(KEY_NEW); break;
case 0x202: map_key_clear(KEY_OPEN); break; case 0x202: map_key_clear(KEY_OPEN); break;
case 0x203: map_key_clear(KEY_CLOSE); break; case 0x203: map_key_clear(KEY_CLOSE); break;
......
...@@ -2107,6 +2107,13 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index) ...@@ -2107,6 +2107,13 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
kfree(data); kfree(data);
return -ENOMEM; return -ENOMEM;
} }
data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue");
if (!data->wq) {
kfree(data->effect_ids);
kfree(data);
return -ENOMEM;
}
data->hidpp = hidpp; data->hidpp = hidpp;
data->feature_index = feature_index; data->feature_index = feature_index;
data->version = version; data->version = version;
...@@ -2151,7 +2158,6 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index) ...@@ -2151,7 +2158,6 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
/* ignore boost value at response.fap.params[2] */ /* ignore boost value at response.fap.params[2] */
/* init the hardware command queue */ /* init the hardware command queue */
data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue");
atomic_set(&data->workqueue_size, 0); atomic_set(&data->workqueue_size, 0);
/* initialize with zero autocenter to get wheel in usable state */ /* initialize with zero autocenter to get wheel in usable state */
...@@ -2604,8 +2610,9 @@ static int m560_raw_event(struct hid_device *hdev, u8 *data, int size) ...@@ -2604,8 +2610,9 @@ static int m560_raw_event(struct hid_device *hdev, u8 *data, int size)
input_report_rel(mydata->input, REL_Y, v); input_report_rel(mydata->input, REL_Y, v);
v = hid_snto32(data[6], 8); v = hid_snto32(data[6], 8);
hidpp_scroll_counter_handle_scroll( if (v != 0)
&hidpp->vertical_wheel_counter, v); hidpp_scroll_counter_handle_scroll(
&hidpp->vertical_wheel_counter, v);
input_sync(mydata->input); input_sync(mydata->input);
} }
......
...@@ -715,7 +715,6 @@ static const struct hid_device_id hid_ignore_list[] = { ...@@ -715,7 +715,6 @@ static const struct hid_device_id hid_ignore_list[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_DEALEXTREAME, USB_DEVICE_ID_DEALEXTREAME_RADIO_SI4701) }, { HID_USB_DEVICE(USB_VENDOR_ID_DEALEXTREAME, USB_DEVICE_ID_DEALEXTREAME_RADIO_SI4701) },
{ HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) }, { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) }, { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) },
{ HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, 0x0400) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) }, { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) }, { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC4UM) }, { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC4UM) },
...@@ -855,7 +854,7 @@ static const struct hid_device_id hid_ignore_list[] = { ...@@ -855,7 +854,7 @@ static const struct hid_device_id hid_ignore_list[] = {
{ } { }
}; };
/** /*
* hid_mouse_ignore_list - mouse devices which should not be handled by the hid layer * hid_mouse_ignore_list - mouse devices which should not be handled by the hid layer
* *
* There are composite devices for which we want to ignore only a certain * There are composite devices for which we want to ignore only a certain
...@@ -996,6 +995,10 @@ bool hid_ignore(struct hid_device *hdev) ...@@ -996,6 +995,10 @@ bool hid_ignore(struct hid_device *hdev)
if (hdev->product == 0x0401 && if (hdev->product == 0x0401 &&
strncmp(hdev->name, "ELAN0800", 8) != 0) strncmp(hdev->name, "ELAN0800", 8) != 0)
return true; return true;
/* Same with product id 0x0400 */
if (hdev->product == 0x0400 &&
strncmp(hdev->name, "QTEC0001", 8) != 0)
return true;
break; break;
} }
...@@ -1042,7 +1045,7 @@ static struct hid_device_id *hid_exists_dquirk(const struct hid_device *hdev) ...@@ -1042,7 +1045,7 @@ static struct hid_device_id *hid_exists_dquirk(const struct hid_device *hdev)
} }
if (bl_entry != NULL) if (bl_entry != NULL)
dbg_hid("Found dynamic quirk 0x%lx for HID device 0x%hx:0x%hx\n", dbg_hid("Found dynamic quirk 0x%lx for HID device 0x%04x:0x%04x\n",
bl_entry->driver_data, bl_entry->vendor, bl_entry->driver_data, bl_entry->vendor,
bl_entry->product); bl_entry->product);
...@@ -1209,7 +1212,7 @@ static unsigned long hid_gets_squirk(const struct hid_device *hdev) ...@@ -1209,7 +1212,7 @@ static unsigned long hid_gets_squirk(const struct hid_device *hdev)
quirks |= bl_entry->driver_data; quirks |= bl_entry->driver_data;
if (quirks) if (quirks)
dbg_hid("Found squirk 0x%lx for HID device 0x%hx:0x%hx\n", dbg_hid("Found squirk 0x%lx for HID device 0x%04x:0x%04x\n",
quirks, hdev->vendor, hdev->product); quirks, hdev->vendor, hdev->product);
return quirks; return quirks;
} }
......
...@@ -499,6 +499,7 @@ static void steam_battery_unregister(struct steam_device *steam) ...@@ -499,6 +499,7 @@ static void steam_battery_unregister(struct steam_device *steam)
static int steam_register(struct steam_device *steam) static int steam_register(struct steam_device *steam)
{ {
int ret; int ret;
bool client_opened;
/* /*
* This function can be called several times in a row with the * This function can be called several times in a row with the
...@@ -511,9 +512,11 @@ static int steam_register(struct steam_device *steam) ...@@ -511,9 +512,11 @@ static int steam_register(struct steam_device *steam)
* Unlikely, but getting the serial could fail, and it is not so * Unlikely, but getting the serial could fail, and it is not so
* important, so make up a serial number and go on. * important, so make up a serial number and go on.
*/ */
mutex_lock(&steam->mutex);
if (steam_get_serial(steam) < 0) if (steam_get_serial(steam) < 0)
strlcpy(steam->serial_no, "XXXXXXXXXX", strlcpy(steam->serial_no, "XXXXXXXXXX",
sizeof(steam->serial_no)); sizeof(steam->serial_no));
mutex_unlock(&steam->mutex);
hid_info(steam->hdev, "Steam Controller '%s' connected", hid_info(steam->hdev, "Steam Controller '%s' connected",
steam->serial_no); steam->serial_no);
...@@ -528,13 +531,15 @@ static int steam_register(struct steam_device *steam) ...@@ -528,13 +531,15 @@ static int steam_register(struct steam_device *steam)
} }
mutex_lock(&steam->mutex); mutex_lock(&steam->mutex);
if (!steam->client_opened) { client_opened = steam->client_opened;
if (!client_opened)
steam_set_lizard_mode(steam, lizard_mode); steam_set_lizard_mode(steam, lizard_mode);
mutex_unlock(&steam->mutex);
if (!client_opened)
ret = steam_input_register(steam); ret = steam_input_register(steam);
} else { else
ret = 0; ret = 0;
}
mutex_unlock(&steam->mutex);
return ret; return ret;
} }
...@@ -630,14 +635,21 @@ static void steam_client_ll_close(struct hid_device *hdev) ...@@ -630,14 +635,21 @@ static void steam_client_ll_close(struct hid_device *hdev)
{ {
struct steam_device *steam = hdev->driver_data; struct steam_device *steam = hdev->driver_data;
unsigned long flags;
bool connected;
spin_lock_irqsave(&steam->lock, flags);
connected = steam->connected;
spin_unlock_irqrestore(&steam->lock, flags);
mutex_lock(&steam->mutex); mutex_lock(&steam->mutex);
steam->client_opened = false; steam->client_opened = false;
if (connected)
steam_set_lizard_mode(steam, lizard_mode);
mutex_unlock(&steam->mutex); mutex_unlock(&steam->mutex);
if (steam->connected) { if (connected)
steam_set_lizard_mode(steam, lizard_mode);
steam_input_register(steam); steam_input_register(steam);
}
} }
static int steam_client_ll_raw_request(struct hid_device *hdev, static int steam_client_ll_raw_request(struct hid_device *hdev,
......
...@@ -735,10 +735,6 @@ static int uclogic_params_huion_init(struct uclogic_params *params, ...@@ -735,10 +735,6 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
goto cleanup; goto cleanup;
} }
rc = usb_string(udev, 201, ver_ptr, ver_len); rc = usb_string(udev, 201, ver_ptr, ver_len);
if (ver_ptr == NULL) {
rc = -ENOMEM;
goto cleanup;
}
if (rc == -EPIPE) { if (rc == -EPIPE) {
*ver_ptr = '\0'; *ver_ptr = '\0';
} else if (rc < 0) { } else if (rc < 0) {
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#define CNL_H_DEVICE_ID 0xA37C #define CNL_H_DEVICE_ID 0xA37C
#define ICL_MOBILE_DEVICE_ID 0x34FC #define ICL_MOBILE_DEVICE_ID 0x34FC
#define SPT_H_DEVICE_ID 0xA135 #define SPT_H_DEVICE_ID 0xA135
#define CML_LP_DEVICE_ID 0x02FC
#define REVISION_ID_CHT_A0 0x6 #define REVISION_ID_CHT_A0 0x6
#define REVISION_ID_CHT_Ax_SI 0x0 #define REVISION_ID_CHT_Ax_SI 0x0
......
...@@ -40,6 +40,7 @@ static const struct pci_device_id ish_pci_tbl[] = { ...@@ -40,6 +40,7 @@ static const struct pci_device_id ish_pci_tbl[] = {
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, CNL_H_DEVICE_ID)}, {PCI_DEVICE(PCI_VENDOR_ID_INTEL, CNL_H_DEVICE_ID)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, ICL_MOBILE_DEVICE_ID)}, {PCI_DEVICE(PCI_VENDOR_ID_INTEL, ICL_MOBILE_DEVICE_ID)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, SPT_H_DEVICE_ID)}, {PCI_DEVICE(PCI_VENDOR_ID_INTEL, SPT_H_DEVICE_ID)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, CML_LP_DEVICE_ID)},
{0, } {0, }
}; };
MODULE_DEVICE_TABLE(pci, ish_pci_tbl); MODULE_DEVICE_TABLE(pci, ish_pci_tbl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment