diff options
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 164bb55064de..6b9adc7bec6e 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -799,6 +799,9 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) | |||
799 | unsigned char *data = wacom->data; | 799 | unsigned char *data = wacom->data; |
800 | int i; | 800 | int i; |
801 | 801 | ||
802 | if (data[0] != 0x02) | ||
803 | return 0; | ||
804 | |||
802 | for (i = 0; i < 2; i++) { | 805 | for (i = 0; i < 2; i++) { |
803 | int p = data[9 * i + 2]; | 806 | int p = data[9 * i + 2]; |
804 | bool touch = p && !wacom->shared->stylus_in_proximity; | 807 | bool touch = p && !wacom->shared->stylus_in_proximity; |
@@ -875,6 +878,9 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom) | |||
875 | int count = data[1] & 0x03; | 878 | int count = data[1] & 0x03; |
876 | int i; | 879 | int i; |
877 | 880 | ||
881 | if (data[0] != 0x02) | ||
882 | return 0; | ||
883 | |||
878 | /* data has up to 7 fixed sized 8-byte messages starting at data[2] */ | 884 | /* data has up to 7 fixed sized 8-byte messages starting at data[2] */ |
879 | for (i = 0; i < count; i++) { | 885 | for (i = 0; i < count; i++) { |
880 | int offset = (8 * i) + 2; | 886 | int offset = (8 * i) + 2; |
@@ -900,6 +906,9 @@ static int wacom_bpt_pen(struct wacom_wac *wacom) | |||
900 | unsigned char *data = wacom->data; | 906 | unsigned char *data = wacom->data; |
901 | int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0; | 907 | int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0; |
902 | 908 | ||
909 | if (data[0] != 0x02) | ||
910 | return 0; | ||
911 | |||
903 | prox = (data[1] & 0x20) == 0x20; | 912 | prox = (data[1] & 0x20) == 0x20; |
904 | 913 | ||
905 | /* | 914 | /* |