@@ -304,11 +304,51 @@ static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
304304 return 1 ;
305305}
306306
307+ static int wacom_input_mapped (struct hid_device * hdev , struct hid_input * hi ,
308+ struct hid_field * field , struct hid_usage * usage , unsigned long * * bit ,
309+ int * max )
310+ {
311+ struct input_dev * input = hi -> input ;
312+
313+ __set_bit (INPUT_PROP_POINTER , input -> propbit );
314+
315+ /* Basics */
316+ input -> evbit [0 ] |= BIT (EV_KEY ) | BIT (EV_ABS ) | BIT (EV_REL );
317+
318+ __set_bit (REL_WHEEL , input -> relbit );
319+
320+ __set_bit (BTN_TOOL_PEN , input -> keybit );
321+ __set_bit (BTN_TOUCH , input -> keybit );
322+ __set_bit (BTN_STYLUS , input -> keybit );
323+ __set_bit (BTN_STYLUS2 , input -> keybit );
324+ __set_bit (BTN_LEFT , input -> keybit );
325+ __set_bit (BTN_RIGHT , input -> keybit );
326+ __set_bit (BTN_MIDDLE , input -> keybit );
327+
328+ /* Pad */
329+ input -> evbit [0 ] |= BIT (EV_MSC );
330+
331+ __set_bit (MSC_SERIAL , input -> mscbit );
332+
333+ __set_bit (BTN_0 , input -> keybit );
334+ __set_bit (BTN_1 , input -> keybit );
335+ __set_bit (BTN_TOOL_FINGER , input -> keybit );
336+
337+ /* Distance, rubber and mouse */
338+ __set_bit (BTN_TOOL_RUBBER , input -> keybit );
339+ __set_bit (BTN_TOOL_MOUSE , input -> keybit );
340+
341+ input_set_abs_params (input , ABS_X , 0 , 16704 , 4 , 0 );
342+ input_set_abs_params (input , ABS_Y , 0 , 12064 , 4 , 0 );
343+ input_set_abs_params (input , ABS_PRESSURE , 0 , 511 , 0 , 0 );
344+ input_set_abs_params (input , ABS_DISTANCE , 0 , 32 , 0 , 0 );
345+
346+ return 0 ;
347+ }
348+
307349static int wacom_probe (struct hid_device * hdev ,
308350 const struct hid_device_id * id )
309351{
310- struct hid_input * hidinput ;
311- struct input_dev * input ;
312352 struct wacom_data * wdata ;
313353 int ret ;
314354
@@ -370,42 +410,6 @@ static int wacom_probe(struct hid_device *hdev,
370410 goto err_ac ;
371411 }
372412#endif
373- hidinput = list_entry (hdev -> inputs .next , struct hid_input , list );
374- input = hidinput -> input ;
375-
376- __set_bit (INPUT_PROP_POINTER , input -> propbit );
377-
378- /* Basics */
379- input -> evbit [0 ] |= BIT (EV_KEY ) | BIT (EV_ABS ) | BIT (EV_REL );
380-
381- __set_bit (REL_WHEEL , input -> relbit );
382-
383- __set_bit (BTN_TOOL_PEN , input -> keybit );
384- __set_bit (BTN_TOUCH , input -> keybit );
385- __set_bit (BTN_STYLUS , input -> keybit );
386- __set_bit (BTN_STYLUS2 , input -> keybit );
387- __set_bit (BTN_LEFT , input -> keybit );
388- __set_bit (BTN_RIGHT , input -> keybit );
389- __set_bit (BTN_MIDDLE , input -> keybit );
390-
391- /* Pad */
392- input -> evbit [0 ] |= BIT (EV_MSC );
393-
394- __set_bit (MSC_SERIAL , input -> mscbit );
395-
396- __set_bit (BTN_0 , input -> keybit );
397- __set_bit (BTN_1 , input -> keybit );
398- __set_bit (BTN_TOOL_FINGER , input -> keybit );
399-
400- /* Distance, rubber and mouse */
401- __set_bit (BTN_TOOL_RUBBER , input -> keybit );
402- __set_bit (BTN_TOOL_MOUSE , input -> keybit );
403-
404- input_set_abs_params (input , ABS_X , 0 , 16704 , 4 , 0 );
405- input_set_abs_params (input , ABS_Y , 0 , 12064 , 4 , 0 );
406- input_set_abs_params (input , ABS_PRESSURE , 0 , 511 , 0 , 0 );
407- input_set_abs_params (input , ABS_DISTANCE , 0 , 32 , 0 , 0 );
408-
409413 return 0 ;
410414
411415#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
@@ -448,6 +452,7 @@ static struct hid_driver wacom_driver = {
448452 .probe = wacom_probe ,
449453 .remove = wacom_remove ,
450454 .raw_event = wacom_raw_event ,
455+ .input_mapped = wacom_input_mapped ,
451456};
452457
453458static int __init wacom_init (void )
0 commit comments