aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_wac.c
diff options
context:
space:
mode:
authorPing Cheng <pinglinux@gmail.com>2010-06-28 04:10:51 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-06-28 04:12:26 -0400
commitc8f2edc56acf0a55ede777c07314c9744bb723be (patch)
treec2c92ac75bf535b6315b745d0cb488c31f9515b0 /drivers/input/tablet/wacom_wac.c
parent1fcb8bb631831c9018a1f7f77b93f9f02e122fc5 (diff)
Input: wacom - add support for DTU2231 and DTU1631
Add support for the two new devices: DTU2231 and DTU1631. Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r--drivers/input/tablet/wacom_wac.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index d564af58175c..555ef26e206d 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -158,6 +158,39 @@ static int wacom_ptu_irq(struct wacom_wac *wacom)
158 return 1; 158 return 1;
159} 159}
160 160
161static int wacom_dtu_irq(struct wacom_wac *wacom)
162{
163 struct wacom_features *features = &wacom->features;
164 char *data = wacom->data;
165 struct input_dev *input = wacom->input;
166 int prox = data[1] & 0x20, pressure;
167
168 dbg("wacom_dtu_irq: received report #%d", data[0]);
169
170 if (prox) {
171 /* Going into proximity select tool */
172 wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
173 if (wacom->tool[0] == BTN_TOOL_PEN)
174 wacom->id[0] = STYLUS_DEVICE_ID;
175 else
176 wacom->id[0] = ERASER_DEVICE_ID;
177 }
178 input_report_key(input, BTN_STYLUS, data[1] & 0x02);
179 input_report_key(input, BTN_STYLUS2, data[1] & 0x10);
180 input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));
181 input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
182 pressure = ((data[7] & 0x01) << 8) | data[6];
183 if (pressure < 0)
184 pressure = features->pressure_max + pressure + 1;
185 input_report_abs(input, ABS_PRESSURE, pressure);
186 input_report_key(input, BTN_TOUCH, data[1] & 0x05);
187 if (!prox) /* out-prox */
188 wacom->id[0] = 0;
189 input_report_key(input, wacom->tool[0], prox);
190 input_report_abs(input, ABS_MISC, wacom->id[0]);
191 return 1;
192}
193
161static int wacom_graphire_irq(struct wacom_wac *wacom) 194static int wacom_graphire_irq(struct wacom_wac *wacom)
162{ 195{
163 struct wacom_features *features = &wacom->features; 196 struct wacom_features *features = &wacom->features;
@@ -844,6 +877,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
844 sync = wacom_ptu_irq(wacom_wac); 877 sync = wacom_ptu_irq(wacom_wac);
845 break; 878 break;
846 879
880 case DTU:
881 sync = wacom_dtu_irq(wacom_wac);
882 break;
883
847 case INTUOS: 884 case INTUOS:
848 case INTUOS3S: 885 case INTUOS3S:
849 case INTUOS3: 886 case INTUOS3:
@@ -1029,6 +1066,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1029 1066
1030 case PL: 1067 case PL:
1031 case PTU: 1068 case PTU:
1069 case DTU:
1032 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1070 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
1033 __set_bit(BTN_STYLUS, input_dev->keybit); 1071 __set_bit(BTN_STYLUS, input_dev->keybit);
1034 __set_bit(BTN_STYLUS2, input_dev->keybit); 1072 __set_bit(BTN_STYLUS2, input_dev->keybit);
@@ -1154,6 +1192,10 @@ static const struct wacom_features wacom_features_0xC6 =
1154 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 63, WACOM_BEE }; 1192 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 63, WACOM_BEE };
1155static const struct wacom_features wacom_features_0xC7 = 1193static const struct wacom_features wacom_features_0xC7 =
1156 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 0, PL }; 1194 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 0, PL };
1195static const struct wacom_features wacom_features_0xCE =
1196 { "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511, 0, DTU };
1197static const struct wacom_features wacom_features_0xF0 =
1198 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511, 0, DTU };
1157static const struct wacom_features wacom_features_0xCC = 1199static const struct wacom_features wacom_features_0xCC =
1158 { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047, 63, WACOM_21UX2 }; 1200 { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047, 63, WACOM_21UX2 };
1159static const struct wacom_features wacom_features_0x90 = 1201static const struct wacom_features wacom_features_0x90 =
@@ -1233,6 +1275,8 @@ const struct usb_device_id wacom_ids[] = {
1233 { USB_DEVICE_WACOM(0xC5) }, 1275 { USB_DEVICE_WACOM(0xC5) },
1234 { USB_DEVICE_WACOM(0xC6) }, 1276 { USB_DEVICE_WACOM(0xC6) },
1235 { USB_DEVICE_WACOM(0xC7) }, 1277 { USB_DEVICE_WACOM(0xC7) },
1278 { USB_DEVICE_WACOM(0xCE) },
1279 { USB_DEVICE_WACOM(0xF0) },
1236 { USB_DEVICE_WACOM(0xCC) }, 1280 { USB_DEVICE_WACOM(0xCC) },
1237 { USB_DEVICE_WACOM(0x90) }, 1281 { USB_DEVICE_WACOM(0x90) },
1238 { USB_DEVICE_WACOM(0x93) }, 1282 { USB_DEVICE_WACOM(0x93) },