diff options
author | Jiri Kosina <jkosina@suse.cz> | 2023-06-27 22:43:39 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2023-06-27 22:43:39 +0200 |
commit | b571809ec3b0af1a93d46bb09fece4ddeafe5a97 (patch) | |
tree | 2468945eee9364384c5287d89fc94a8a973750c9 /drivers/hid | |
parent | ef4ca0517c860b34fe4f112960ef40c4e3e9f39b (diff) | |
parent | 9a6c0e28e215535b2938c61ded54603b4e5814c5 (diff) |
Merge branch 'for-6.5/wacom' into for-linus
- touch selftests for hid-wacom (Joshua Dickens)
- conversion of hid-wacom to use ktime_t (Jason Gerecke)
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/wacom_wac.c | 6 | ||||
-rw-r--r-- | drivers/hid/wacom_wac.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 2ccf83837134..174bf03908d7 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1314,7 +1314,7 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom) struct input_dev *pen_input = wacom->pen_input; unsigned char *data = wacom->data; int number_of_valid_frames = 0; - int time_interval = 15000000; + ktime_t time_interval = 15000000; ktime_t time_packet_received = ktime_get(); int i; @@ -1348,7 +1348,7 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom) if (number_of_valid_frames) { if (wacom->hid_data.time_delayed) time_interval = ktime_get() - wacom->hid_data.time_delayed; - time_interval /= number_of_valid_frames; + time_interval = div_u64(time_interval, number_of_valid_frames); wacom->hid_data.time_delayed = time_packet_received; } @@ -1359,7 +1359,7 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom) bool range = frame[0] & 0x20; bool invert = frame[0] & 0x10; int frames_number_reversed = number_of_valid_frames - i - 1; - int event_timestamp = time_packet_received - frames_number_reversed * time_interval; + ktime_t event_timestamp = time_packet_received - frames_number_reversed * time_interval; if (!valid) continue; diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index 1a40bb8c5810..ee21bb260f22 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -324,7 +324,7 @@ struct hid_data { int ps_connected; bool pad_input_event_flag; unsigned short sequence_number; - int time_delayed; + ktime_t time_delayed; }; struct wacom_remote_data { |