Skip to content

Commit 8723bc8

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID fixes from Jiri Kosina: - resume timing fix for intel-ish driver (Ye Xiang) - fix for using incorrect MMIO register in amd_sfh driver (Dylan MacKenzie) - Cintiq 24HDT / 27QHDT regression fix and touch processing fix for Wacom driver (Jason Gerecke) - device removal bugfix for ft260 driver (Michael Zaidman) - other small assorted fixes * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: ft260: fix device removal due to USB disconnect HID: wacom: Skip processing of touches with negative slot values HID: wacom: Re-enable touch by default for Cintiq 24HDT / 27QHDT HID: Kconfig: Fix spelling mistake "Uninterruptable" -> "Uninterruptible" HID: apple: Add support for Keychron K1 wireless keyboard HID: fix typo in Kconfig HID: ft260: fix format type warning in ft260_word_show() HID: amd_sfh: Use correct MMIO register for DMA address HID: asus: Remove check for same LED brightness on set HID: intel-ish-hid: use async resume function
2 parents ad6ec09 + db8d3a2 commit 8723bc8

File tree

11 files changed

+57
-33
lines changed

11 files changed

+57
-33
lines changed

drivers/hid/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ config HID_LOGITECH_HIDPP
576576
depends on HID_LOGITECH
577577
select POWER_SUPPLY
578578
help
579-
Support for Logitech devices relyingon the HID++ Logitech specification
579+
Support for Logitech devices relying on the HID++ Logitech specification
580580

581581
Say Y if you want support for Logitech devices relying on the HID++
582582
specification. Such devices are the various Logitech Touchpads (T650,

drivers/hid/amd-sfh-hid/amd_sfh_pcie.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static void amd_stop_sensor_v2(struct amd_mp2_dev *privdata, u16 sensor_idx)
5858
cmd_base.cmd_v2.sensor_id = sensor_idx;
5959
cmd_base.cmd_v2.length = 16;
6060

61-
writeq(0x0, privdata->mmio + AMD_C2P_MSG2);
61+
writeq(0x0, privdata->mmio + AMD_C2P_MSG1);
6262
writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0);
6363
}
6464

drivers/hid/hid-apple.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ static const struct hid_device_id apple_devices[] = {
501501
APPLE_RDESC_JIS },
502502
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI),
503503
.driver_data = APPLE_HAS_FN },
504+
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI),
505+
.driver_data = APPLE_HAS_FN },
504506
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO),
505507
.driver_data = APPLE_HAS_FN },
506508
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO),

drivers/hid/hid-asus.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,6 @@ static void asus_kbd_backlight_set(struct led_classdev *led_cdev,
485485
{
486486
struct asus_kbd_leds *led = container_of(led_cdev, struct asus_kbd_leds,
487487
cdev);
488-
if (led->brightness == brightness)
489-
return;
490-
491488
led->brightness = brightness;
492489
schedule_work(&led->work);
493490
}

drivers/hid/hid-ft260.c

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ static int ft260_is_interface_enabled(struct hid_device *hdev)
742742
int ret;
743743

744744
ret = ft260_get_system_config(hdev, &cfg);
745-
if (ret)
745+
if (ret < 0)
746746
return ret;
747747

748748
ft260_dbg("interface: 0x%02x\n", interface);
@@ -754,23 +754,16 @@ static int ft260_is_interface_enabled(struct hid_device *hdev)
754754
switch (cfg.chip_mode) {
755755
case FT260_MODE_ALL:
756756
case FT260_MODE_BOTH:
757-
if (interface == 1) {
757+
if (interface == 1)
758758
hid_info(hdev, "uart interface is not supported\n");
759-
return 0;
760-
}
761-
ret = 1;
759+
else
760+
ret = 1;
762761
break;
763762
case FT260_MODE_UART:
764-
if (interface == 0) {
765-
hid_info(hdev, "uart is unsupported on interface 0\n");
766-
ret = 0;
767-
}
763+
hid_info(hdev, "uart interface is not supported\n");
768764
break;
769765
case FT260_MODE_I2C:
770-
if (interface == 1) {
771-
hid_info(hdev, "i2c is unsupported on interface 1\n");
772-
ret = 0;
773-
}
766+
ret = 1;
774767
break;
775768
}
776769
return ret;
@@ -785,7 +778,7 @@ static int ft260_byte_show(struct hid_device *hdev, int id, u8 *cfg, int len,
785778
if (ret < 0)
786779
return ret;
787780

788-
return scnprintf(buf, PAGE_SIZE, "%hi\n", *field);
781+
return scnprintf(buf, PAGE_SIZE, "%d\n", *field);
789782
}
790783

791784
static int ft260_word_show(struct hid_device *hdev, int id, u8 *cfg, int len,
@@ -797,7 +790,7 @@ static int ft260_word_show(struct hid_device *hdev, int id, u8 *cfg, int len,
797790
if (ret < 0)
798791
return ret;
799792

800-
return scnprintf(buf, PAGE_SIZE, "%hi\n", le16_to_cpu(*field));
793+
return scnprintf(buf, PAGE_SIZE, "%d\n", le16_to_cpu(*field));
801794
}
802795

803796
#define FT260_ATTR_SHOW(name, reptype, id, type, func) \
@@ -1004,11 +997,9 @@ static int ft260_probe(struct hid_device *hdev, const struct hid_device_id *id)
1004997

1005998
static void ft260_remove(struct hid_device *hdev)
1006999
{
1007-
int ret;
10081000
struct ft260_device *dev = hid_get_drvdata(hdev);
10091001

1010-
ret = ft260_is_interface_enabled(hdev);
1011-
if (ret <= 0)
1002+
if (!dev)
10121003
return;
10131004

10141005
sysfs_remove_group(&hdev->dev.kobj, &ft260_attr_group);

drivers/hid/intel-ish-hid/ishtp-hid-client.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,17 @@ static void hid_ishtp_cl_reset_handler(struct work_struct *work)
784784
}
785785
}
786786

787+
static void hid_ishtp_cl_resume_handler(struct work_struct *work)
788+
{
789+
struct ishtp_cl_data *client_data = container_of(work, struct ishtp_cl_data, resume_work);
790+
struct ishtp_cl *hid_ishtp_cl = client_data->hid_ishtp_cl;
791+
792+
if (ishtp_wait_resume(ishtp_get_ishtp_device(hid_ishtp_cl))) {
793+
client_data->suspended = false;
794+
wake_up_interruptible(&client_data->ishtp_resume_wait);
795+
}
796+
}
797+
787798
ishtp_print_log ishtp_hid_print_trace;
788799

789800
/**
@@ -822,6 +833,8 @@ static int hid_ishtp_cl_probe(struct ishtp_cl_device *cl_device)
822833
init_waitqueue_head(&client_data->ishtp_resume_wait);
823834

824835
INIT_WORK(&client_data->work, hid_ishtp_cl_reset_handler);
836+
INIT_WORK(&client_data->resume_work, hid_ishtp_cl_resume_handler);
837+
825838

826839
ishtp_hid_print_trace = ishtp_trace_callback(cl_device);
827840

@@ -921,7 +934,7 @@ static int hid_ishtp_cl_resume(struct device *device)
921934

922935
hid_ishtp_trace(client_data, "%s hid_ishtp_cl %p\n", __func__,
923936
hid_ishtp_cl);
924-
client_data->suspended = false;
937+
schedule_work(&client_data->resume_work);
925938
return 0;
926939
}
927940

drivers/hid/intel-ish-hid/ishtp-hid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ struct ishtp_cl_data {
135135
int multi_packet_cnt;
136136

137137
struct work_struct work;
138+
struct work_struct resume_work;
138139
struct ishtp_cl_device *cl_device;
139140
};
140141

drivers/hid/intel-ish-hid/ishtp/bus.c

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,6 @@ static int ishtp_cl_device_resume(struct device *dev)
314314
if (!device)
315315
return 0;
316316

317-
/*
318-
* When ISH needs hard reset, it is done asynchrnously, hence bus
319-
* resume will be called before full ISH resume
320-
*/
321-
if (device->ishtp_dev->resume_flag)
322-
return 0;
323-
324317
driver = to_ishtp_cl_driver(dev->driver);
325318
if (driver && driver->driver.pm) {
326319
if (driver->driver.pm->resume)
@@ -849,6 +842,28 @@ struct device *ishtp_device(struct ishtp_cl_device *device)
849842
}
850843
EXPORT_SYMBOL(ishtp_device);
851844

845+
/**
846+
* ishtp_wait_resume() - Wait for IPC resume
847+
*
848+
* Wait for IPC resume
849+
*
850+
* Return: resume complete or not
851+
*/
852+
bool ishtp_wait_resume(struct ishtp_device *dev)
853+
{
854+
/* 50ms to get resume response */
855+
#define WAIT_FOR_RESUME_ACK_MS 50
856+
857+
/* Waiting to get resume response */
858+
if (dev->resume_flag)
859+
wait_event_interruptible_timeout(dev->resume_wait,
860+
!dev->resume_flag,
861+
msecs_to_jiffies(WAIT_FOR_RESUME_ACK_MS));
862+
863+
return (!dev->resume_flag);
864+
}
865+
EXPORT_SYMBOL_GPL(ishtp_wait_resume);
866+
852867
/**
853868
* ishtp_get_pci_device() - Return PCI device dev pointer
854869
* This interface is used to return PCI device pointer

drivers/hid/usbhid/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ config USB_HIDDEV
3838
help
3939
Say Y here if you want to support HID devices (from the USB
4040
specification standpoint) that aren't strictly user interface
41-
devices, like monitor controls and Uninterruptable Power Supplies.
41+
devices, like monitor controls and Uninterruptible Power Supplies.
4242

4343
This module supports these devices separately using a separate
4444
event interface on /dev/usb/hiddevX (char 180:96 to 180:111).

drivers/hid/wacom_wac.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2548,6 +2548,9 @@ static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac,
25482548
int slot;
25492549

25502550
slot = input_mt_get_slot_by_key(input, hid_data->id);
2551+
if (slot < 0)
2552+
return;
2553+
25512554
input_mt_slot(input, slot);
25522555
input_mt_report_slot_state(input, MT_TOOL_FINGER, prox);
25532556
}
@@ -3831,7 +3834,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
38313834
wacom_wac->shared->touch->product == 0xF6) {
38323835
input_dev->evbit[0] |= BIT_MASK(EV_SW);
38333836
__set_bit(SW_MUTE_DEVICE, input_dev->swbit);
3834-
wacom_wac->shared->has_mute_touch_switch = true;
3837+
wacom_wac->has_mute_touch_switch = true;
38353838
}
38363839
fallthrough;
38373840

0 commit comments

Comments
 (0)