Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: wacom - specify Cinitq supported tools

Cintiq, being a display tablet, doesn't have mouse and associated BTN_s.
Make sure we do not specify them when registering Cintiq's input device
so that userland can retrieve the exact tool set the device supports.

Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Ping Cheng and committed by
Dmitry Torokhov
6521d0bf c5fb514d

+30 -12
+30 -12
drivers/input/tablet/wacom_wac.c
··· 1043 input_sync(wacom_wac->input); 1044 } 1045 1046 - static void wacom_setup_intuos(struct wacom_wac *wacom_wac) 1047 { 1048 struct input_dev *input_dev = wacom_wac->input; 1049 1050 input_set_capability(input_dev, EV_MSC, MSC_SERIAL); 1051 - input_set_capability(input_dev, EV_REL, REL_WHEEL); 1052 - 1053 - __set_bit(BTN_LEFT, input_dev->keybit); 1054 - __set_bit(BTN_RIGHT, input_dev->keybit); 1055 - __set_bit(BTN_MIDDLE, input_dev->keybit); 1056 - __set_bit(BTN_SIDE, input_dev->keybit); 1057 - __set_bit(BTN_EXTRA, input_dev->keybit); 1058 1059 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1060 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1061 - __set_bit(BTN_TOOL_MOUSE, input_dev->keybit); 1062 __set_bit(BTN_TOOL_BRUSH, input_dev->keybit); 1063 __set_bit(BTN_TOOL_PENCIL, input_dev->keybit); 1064 __set_bit(BTN_TOOL_AIRBRUSH, input_dev->keybit); 1065 - __set_bit(BTN_TOOL_LENS, input_dev->keybit); 1066 __set_bit(BTN_STYLUS, input_dev->keybit); 1067 __set_bit(BTN_STYLUS2, input_dev->keybit); 1068 ··· 1062 input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0); 1063 input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0); 1064 input_set_abs_params(input_dev, ABS_TILT_Y, 0, 127, 0, 0); 1065 input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0); 1066 input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0); 1067 } 1068 - 1069 1070 void wacom_setup_device_quirks(struct wacom_features *features) 1071 { ··· 1176 __set_bit(BTN_9, input_dev->keybit); 1177 /* fall through */ 1178 1179 case INTUOS3: 1180 case INTUOS3L: 1181 - case CINTIQ: 1182 __set_bit(BTN_4, input_dev->keybit); 1183 __set_bit(BTN_5, input_dev->keybit); 1184 __set_bit(BTN_6, input_dev->keybit);
··· 1043 input_sync(wacom_wac->input); 1044 } 1045 1046 + static void wacom_setup_cintiq(struct wacom_wac *wacom_wac) 1047 { 1048 struct input_dev *input_dev = wacom_wac->input; 1049 1050 input_set_capability(input_dev, EV_MSC, MSC_SERIAL); 1051 1052 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1053 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1054 __set_bit(BTN_TOOL_BRUSH, input_dev->keybit); 1055 __set_bit(BTN_TOOL_PENCIL, input_dev->keybit); 1056 __set_bit(BTN_TOOL_AIRBRUSH, input_dev->keybit); 1057 __set_bit(BTN_STYLUS, input_dev->keybit); 1058 __set_bit(BTN_STYLUS2, input_dev->keybit); 1059 ··· 1071 input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0); 1072 input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0); 1073 input_set_abs_params(input_dev, ABS_TILT_Y, 0, 127, 0, 0); 1074 + } 1075 + 1076 + static void wacom_setup_intuos(struct wacom_wac *wacom_wac) 1077 + { 1078 + struct input_dev *input_dev = wacom_wac->input; 1079 + 1080 + input_set_capability(input_dev, EV_REL, REL_WHEEL); 1081 + 1082 + wacom_setup_cintiq(wacom_wac); 1083 + 1084 + __set_bit(BTN_LEFT, input_dev->keybit); 1085 + __set_bit(BTN_RIGHT, input_dev->keybit); 1086 + __set_bit(BTN_MIDDLE, input_dev->keybit); 1087 + __set_bit(BTN_SIDE, input_dev->keybit); 1088 + __set_bit(BTN_EXTRA, input_dev->keybit); 1089 + __set_bit(BTN_TOOL_MOUSE, input_dev->keybit); 1090 + __set_bit(BTN_TOOL_LENS, input_dev->keybit); 1091 + 1092 input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0); 1093 input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0); 1094 } 1095 1096 void wacom_setup_device_quirks(struct wacom_features *features) 1097 { ··· 1168 __set_bit(BTN_9, input_dev->keybit); 1169 /* fall through */ 1170 1171 + case CINTIQ: 1172 + for (i = 0; i < 8; i++) 1173 + __set_bit(BTN_0 + i, input_dev->keybit); 1174 + __set_bit(BTN_TOOL_FINGER, input_dev->keybit); 1175 + 1176 + input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); 1177 + input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); 1178 + input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1179 + wacom_setup_cintiq(wacom_wac); 1180 + break; 1181 + 1182 case INTUOS3: 1183 case INTUOS3L: 1184 __set_bit(BTN_4, input_dev->keybit); 1185 __set_bit(BTN_5, input_dev->keybit); 1186 __set_bit(BTN_6, input_dev->keybit);