mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-23 22:25:40 +08:00
HID: uclogic: Always shift touch reports to zero
Always decrement touch report values to have the range start with zero, regardless if flipped or not. This fixes the future non-flipped touch strip reports. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
caf7e93479
commit
fbc08b4e8e
@ -386,15 +386,16 @@ static int uclogic_raw_event_frame(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If need to, and can, transform the touch ring reports */
|
/* If need to, and can, transform the touch ring reports */
|
||||||
if (frame->touch_byte > 0 && frame->touch_byte < size &&
|
if (frame->touch_byte > 0 && frame->touch_byte < size) {
|
||||||
frame->touch_flip_at != 0) {
|
|
||||||
__s8 value = data[frame->touch_byte];
|
__s8 value = data[frame->touch_byte];
|
||||||
if (value != 0) {
|
|
||||||
value = frame->touch_flip_at - value;
|
|
||||||
if (value < 0)
|
|
||||||
value = frame->touch_max + value;
|
|
||||||
|
|
||||||
data[frame->touch_byte] = value;
|
if (value != 0) {
|
||||||
|
if (frame->touch_flip_at != 0) {
|
||||||
|
value = frame->touch_flip_at - value;
|
||||||
|
if (value <= 0)
|
||||||
|
value = frame->touch_max + value;
|
||||||
|
}
|
||||||
|
data[frame->touch_byte] = value - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -889,7 +889,7 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
|
|||||||
UCLOGIC_RDESC_V2_FRAME_TOUCH_DEV_ID_BYTE;
|
UCLOGIC_RDESC_V2_FRAME_TOUCH_DEV_ID_BYTE;
|
||||||
p.frame_list[1].touch_byte = 5;
|
p.frame_list[1].touch_byte = 5;
|
||||||
p.frame_list[1].touch_max = 12;
|
p.frame_list[1].touch_max = 12;
|
||||||
p.frame_list[1].touch_flip_at = 6;
|
p.frame_list[1].touch_flip_at = 7;
|
||||||
|
|
||||||
/* Create v2 frame dial parameters */
|
/* Create v2 frame dial parameters */
|
||||||
rc = uclogic_params_frame_init_with_desc(
|
rc = uclogic_params_frame_init_with_desc(
|
||||||
|
Loading…
Reference in New Issue
Block a user