Skip to content

Commit

Permalink
Merge branch 'for-6.5' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jigpu committed Jun 29, 2023
2 parents d95d4d8 + 74258e4 commit f4e976f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions 4.5/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
unsigned char *data = wacom->data;
int number_of_valid_frames = 0;
#ifdef WACOM_INPUT_SET_TIMESTAMP
int time_interval = 15000000;
ktime_t time_interval = 15000000;
ktime_t time_packet_received = ktime_get();
#endif
int i;
Expand Down Expand Up @@ -1361,7 +1361,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;
}
#endif
Expand All @@ -1374,7 +1374,7 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
bool invert = frame[0] & 0x10;
#ifdef WACOM_INPUT_SET_TIMESTAMP
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;
#endif

if (!valid)
Expand All @@ -1388,7 +1388,9 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom)
wacom->tool[0] = 0;
wacom->id[0] = 0;
wacom->serial[0] = 0;
#ifdef WACOM_INPUT_SET_TIMESTAMP
wacom->hid_data.time_delayed = 0;
#endif
return;
}

Expand Down
6 changes: 5 additions & 1 deletion 4.5/wacom_wac.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#ifndef WACOM_WAC_H
#define WACOM_WAC_H

#include "../config.h"

#include <linux/types.h>
#include <linux/hid.h>
#include <linux/kfifo.h>
Expand Down Expand Up @@ -348,7 +350,9 @@ struct hid_data {
int ps_connected;
bool pad_input_event_flag;
unsigned short sequence_number;
int time_delayed;
#ifdef WACOM_INPUT_SET_TIMESTAMP
ktime_t time_delayed;
#endif
};

struct wacom_remote_data {
Expand Down

0 comments on commit f4e976f

Please sign in to comment.