2 * Copyright (c) 2016 Masaki Ota <masaki.ota@jp.alps.com>
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
10 #include <linux/kernel.h>
11 #include <linux/hid.h>
12 #include <linux/input.h>
13 #include <linux/input/mt.h>
14 #include <linux/module.h>
15 #include <asm/unaligned.h>
18 /* ALPS Device Product ID */
19 #define HID_PRODUCT_ID_T3_BTNLESS 0xD0C0
20 #define HID_PRODUCT_ID_COSMO 0x1202
21 #define HID_PRODUCT_ID_U1_PTP_1 0x1207
22 #define HID_PRODUCT_ID_U1 0x1209
23 #define HID_PRODUCT_ID_U1_PTP_2 0x120A
24 #define HID_PRODUCT_ID_U1_DUAL 0x120B
25 #define HID_PRODUCT_ID_T4_BTNLESS 0x120C
27 #define DEV_SINGLEPOINT 0x01
28 #define DEV_DUALPOINT 0x02
30 #define U1_MOUSE_REPORT_ID 0x01 /* Mouse data ReportID */
31 #define U1_ABSOLUTE_REPORT_ID 0x03 /* Absolute data ReportID */
32 #define U1_FEATURE_REPORT_ID 0x05 /* Feature ReportID */
33 #define U1_SP_ABSOLUTE_REPORT_ID 0x06 /* Feature ReportID */
35 #define U1_FEATURE_REPORT_LEN 0x08 /* Feature Report Length */
36 #define U1_FEATURE_REPORT_LEN_ALL 0x0A
37 #define U1_CMD_REGISTER_READ 0xD1
38 #define U1_CMD_REGISTER_WRITE 0xD2
40 #define U1_DEVTYPE_SP_SUPPORT 0x10 /* SP Support */
41 #define U1_DISABLE_DEV 0x01
42 #define U1_TP_ABS_MODE 0x02
43 #define U1_SP_ABS_MODE 0x80
45 #define ADDRESS_U1_DEV_CTRL_1 0x00800040
46 #define ADDRESS_U1_DEVICE_TYP 0x00800043
47 #define ADDRESS_U1_NUM_SENS_X 0x00800047
48 #define ADDRESS_U1_NUM_SENS_Y 0x00800048
49 #define ADDRESS_U1_PITCH_SENS_X 0x00800049
50 #define ADDRESS_U1_PITCH_SENS_Y 0x0080004A
51 #define ADDRESS_U1_RESO_DWN_ABS 0x0080004E
52 #define ADDRESS_U1_PAD_BTN 0x00800052
53 #define ADDRESS_U1_SP_BTN 0x0080009F
55 #define T4_INPUT_REPORT_LEN sizeof(struct t4_input_report)
56 #define T4_FEATURE_REPORT_LEN T4_INPUT_REPORT_LEN
57 #define T4_FEATURE_REPORT_ID 7
58 #define T4_CMD_REGISTER_READ 0x08
59 #define T4_CMD_REGISTER_WRITE 0x07
61 #define T4_ADDRESS_BASE 0xC2C0
62 #define PRM_SYS_CONFIG_1 (T4_ADDRESS_BASE + 0x0002)
63 #define T4_PRM_FEED_CONFIG_1 (T4_ADDRESS_BASE + 0x0004)
64 #define T4_PRM_FEED_CONFIG_4 (T4_ADDRESS_BASE + 0x001A)
65 #define T4_PRM_ID_CONFIG_3 (T4_ADDRESS_BASE + 0x00B0)
68 #define T4_FEEDCFG4_ADVANCED_ABS_ENABLE 0x01
69 #define T4_I2C_ABS 0x78
71 #define T4_COUNT_PER_ELECTRODE 256
82 * @input: pointer to the kernel input device
83 * @input2: pointer to the kernel input2 device
84 * @hdev: pointer to the struct hid_device
86 * @dev_type: device type
87 * @max_fingers: total number of fingers
88 * @has_sp: boolean of sp existense
89 * @sp_btn_info: button information
90 * @x_active_len_mm: active area length of X (mm)
91 * @y_active_len_mm: active area length of Y (mm)
92 * @x_max: maximum x coordinate value
93 * @y_max: maximum y coordinate value
94 * @x_min: minimum x coordinate value
95 * @y_min: minimum y coordinate value
96 * @btn_cnt: number of buttons
97 * @sp_btn_cnt: number of stick buttons
100 struct input_dev
*input
;
101 struct input_dev
*input2
;
102 struct hid_device
*hdev
;
104 enum dev_num dev_type
;
118 struct t4_contact_data
{
126 struct t4_input_report
{
129 struct t4_contact_data contact
[5];
138 static u16
t4_calc_check_sum(u8
*buffer
,
139 unsigned long offset
, unsigned long length
)
141 u16 sum1
= 0xFF, sum2
= 0xFF;
144 if (offset
+ length
>= 50)
148 u32 tlen
= length
> 20 ? 20 : length
;
153 sum1
+= buffer
[offset
+ i
];
156 } while (--tlen
> 0);
158 sum1
= (sum1
& 0xFF) + (sum1
>> 8);
159 sum2
= (sum2
& 0xFF) + (sum2
>> 8);
162 sum1
= (sum1
& 0xFF) + (sum1
>> 8);
163 sum2
= (sum2
& 0xFF) + (sum2
>> 8);
165 return(sum2
<< 8 | sum1
);
168 static int t4_read_write_register(struct hid_device
*hdev
, u32 address
,
169 u8
*read_val
, u8 write_val
, bool read_flag
)
176 input
= kzalloc(T4_FEATURE_REPORT_LEN
, GFP_KERNEL
);
180 input
[0] = T4_FEATURE_REPORT_ID
;
182 input
[1] = T4_CMD_REGISTER_READ
;
185 input
[1] = T4_CMD_REGISTER_WRITE
;
186 input
[8] = write_val
;
188 put_unaligned_le32(address
, input
+ 2);
192 /* Calculate the checksum */
193 check_sum
= t4_calc_check_sum(input
, 1, 8);
194 input
[9] = (u8
)check_sum
;
195 input
[10] = (u8
)(check_sum
>> 8);
198 ret
= hid_hw_raw_request(hdev
, T4_FEATURE_REPORT_ID
, input
,
199 T4_FEATURE_REPORT_LEN
,
200 HID_FEATURE_REPORT
, HID_REQ_SET_REPORT
);
203 dev_err(&hdev
->dev
, "failed to read command (%d)\n", ret
);
207 readbuf
= kzalloc(T4_FEATURE_REPORT_LEN
, GFP_KERNEL
);
214 ret
= hid_hw_raw_request(hdev
, T4_FEATURE_REPORT_ID
, readbuf
,
215 T4_FEATURE_REPORT_LEN
,
216 HID_FEATURE_REPORT
, HID_REQ_GET_REPORT
);
218 dev_err(&hdev
->dev
, "failed read register (%d)\n", ret
);
222 if (*(u32
*)&readbuf
[6] != address
) {
223 dev_err(&hdev
->dev
, "read register address error (%x,%x)\n",
224 *(u32
*)&readbuf
[6], address
);
228 if (*(u16
*)&readbuf
[10] != 1) {
229 dev_err(&hdev
->dev
, "read register size error (%x)\n",
230 *(u16
*)&readbuf
[10]);
234 check_sum
= t4_calc_check_sum(readbuf
, 6, 7);
235 if (*(u16
*)&readbuf
[13] != check_sum
) {
236 dev_err(&hdev
->dev
, "read register checksum error (%x,%x)\n",
237 *(u16
*)&readbuf
[13], check_sum
);
241 *read_val
= readbuf
[12];
253 static int u1_read_write_register(struct hid_device
*hdev
, u32 address
,
254 u8
*read_val
, u8 write_val
, bool read_flag
)
261 input
= kzalloc(U1_FEATURE_REPORT_LEN
, GFP_KERNEL
);
265 input
[0] = U1_FEATURE_REPORT_ID
;
267 input
[1] = U1_CMD_REGISTER_READ
;
270 input
[1] = U1_CMD_REGISTER_WRITE
;
271 input
[6] = write_val
;
274 put_unaligned_le32(address
, input
+ 2);
276 /* Calculate the checksum */
277 check_sum
= U1_FEATURE_REPORT_LEN_ALL
;
278 for (i
= 0; i
< U1_FEATURE_REPORT_LEN
- 1; i
++)
279 check_sum
+= input
[i
];
281 input
[7] = check_sum
;
282 ret
= hid_hw_raw_request(hdev
, U1_FEATURE_REPORT_ID
, input
,
283 U1_FEATURE_REPORT_LEN
,
284 HID_FEATURE_REPORT
, HID_REQ_SET_REPORT
);
287 dev_err(&hdev
->dev
, "failed to read command (%d)\n", ret
);
292 readbuf
= kzalloc(U1_FEATURE_REPORT_LEN
, GFP_KERNEL
);
298 ret
= hid_hw_raw_request(hdev
, U1_FEATURE_REPORT_ID
, readbuf
,
299 U1_FEATURE_REPORT_LEN
,
300 HID_FEATURE_REPORT
, HID_REQ_GET_REPORT
);
303 dev_err(&hdev
->dev
, "failed read register (%d)\n", ret
);
308 *read_val
= readbuf
[6];
320 static int t4_raw_event(struct alps_dev
*hdata
, u8
*data
, int size
)
322 unsigned int x
, y
, z
;
324 struct t4_input_report
*p_report
= (struct t4_input_report
*)data
;
328 for (i
= 0; i
< hdata
->max_fingers
; i
++) {
329 x
= p_report
->contact
[i
].x_hi
<< 8 | p_report
->contact
[i
].x_lo
;
330 y
= p_report
->contact
[i
].y_hi
<< 8 | p_report
->contact
[i
].y_lo
;
331 y
= hdata
->y_max
- y
+ hdata
->y_min
;
332 z
= (p_report
->contact
[i
].palm
< 0x80 &&
333 p_report
->contact
[i
].palm
> 0) * 62;
339 input_mt_slot(hdata
->input
, i
);
341 input_mt_report_slot_state(hdata
->input
,
342 MT_TOOL_FINGER
, z
!= 0);
347 input_report_abs(hdata
->input
, ABS_MT_POSITION_X
, x
);
348 input_report_abs(hdata
->input
, ABS_MT_POSITION_Y
, y
);
349 input_report_abs(hdata
->input
, ABS_MT_PRESSURE
, z
);
351 input_mt_sync_frame(hdata
->input
);
353 input_report_key(hdata
->input
, BTN_LEFT
, p_report
->button
);
355 input_sync(hdata
->input
);
359 static int u1_raw_event(struct alps_dev
*hdata
, u8
*data
, int size
)
361 unsigned int x
, y
, z
;
368 case U1_MOUSE_REPORT_ID
:
370 case U1_FEATURE_REPORT_ID
:
372 case U1_ABSOLUTE_REPORT_ID
:
373 for (i
= 0; i
< hdata
->max_fingers
; i
++) {
374 u8
*contact
= &data
[i
* 5];
376 x
= get_unaligned_le16(contact
+ 3);
377 y
= get_unaligned_le16(contact
+ 5);
378 z
= contact
[7] & 0x7F;
380 input_mt_slot(hdata
->input
, i
);
383 input_mt_report_slot_state(hdata
->input
,
385 input_report_abs(hdata
->input
,
386 ABS_MT_POSITION_X
, x
);
387 input_report_abs(hdata
->input
,
388 ABS_MT_POSITION_Y
, y
);
389 input_report_abs(hdata
->input
,
392 input_mt_report_slot_state(hdata
->input
,
397 input_mt_sync_frame(hdata
->input
);
399 input_report_key(hdata
->input
, BTN_LEFT
,
401 input_report_key(hdata
->input
, BTN_RIGHT
,
403 input_report_key(hdata
->input
, BTN_MIDDLE
,
406 input_sync(hdata
->input
);
410 case U1_SP_ABSOLUTE_REPORT_ID
:
411 sp_x
= get_unaligned_le16(data
+2);
412 sp_y
= get_unaligned_le16(data
+4);
417 input_report_rel(hdata
->input2
, REL_X
, sp_x
);
418 input_report_rel(hdata
->input2
, REL_Y
, sp_y
);
420 input_report_key(hdata
->input2
, BTN_LEFT
,
422 input_report_key(hdata
->input2
, BTN_RIGHT
,
424 input_report_key(hdata
->input2
, BTN_MIDDLE
,
427 input_sync(hdata
->input2
);
435 static int alps_raw_event(struct hid_device
*hdev
,
436 struct hid_report
*report
, u8
*data
, int size
)
439 struct alps_dev
*hdata
= hid_get_drvdata(hdev
);
441 switch (hdev
->product
) {
442 case HID_PRODUCT_ID_T4_BTNLESS
:
443 ret
= t4_raw_event(hdata
, data
, size
);
446 ret
= u1_raw_event(hdata
, data
, size
);
452 static int __maybe_unused
alps_post_reset(struct hid_device
*hdev
)
455 struct alps_dev
*data
= hid_get_drvdata(hdev
);
457 switch (data
->dev_type
) {
459 ret
= t4_read_write_register(hdev
, T4_PRM_FEED_CONFIG_1
,
460 NULL
, T4_I2C_ABS
, false);
461 ret
= t4_read_write_register(hdev
, T4_PRM_FEED_CONFIG_4
,
462 NULL
, T4_FEEDCFG4_ADVANCED_ABS_ENABLE
, false);
465 ret
= u1_read_write_register(hdev
,
466 ADDRESS_U1_DEV_CTRL_1
, NULL
,
467 U1_TP_ABS_MODE
| U1_SP_ABS_MODE
, false);
475 static int __maybe_unused
alps_post_resume(struct hid_device
*hdev
)
477 return alps_post_reset(hdev
);
480 static int u1_init(struct hid_device
*hdev
, struct alps_dev
*pri_data
)
483 u8 tmp
, dev_ctrl
, sen_line_num_x
, sen_line_num_y
;
484 u8 pitch_x
, pitch_y
, resolution
;
486 /* Device initialization */
487 ret
= u1_read_write_register(hdev
, ADDRESS_U1_DEV_CTRL_1
,
490 dev_err(&hdev
->dev
, "failed U1_DEV_CTRL_1 (%d)\n", ret
);
494 dev_ctrl
&= ~U1_DISABLE_DEV
;
495 dev_ctrl
|= U1_TP_ABS_MODE
;
496 ret
= u1_read_write_register(hdev
, ADDRESS_U1_DEV_CTRL_1
,
497 NULL
, dev_ctrl
, false);
499 dev_err(&hdev
->dev
, "failed to change TP mode (%d)\n", ret
);
503 ret
= u1_read_write_register(hdev
, ADDRESS_U1_NUM_SENS_X
,
504 &sen_line_num_x
, 0, true);
506 dev_err(&hdev
->dev
, "failed U1_NUM_SENS_X (%d)\n", ret
);
510 ret
= u1_read_write_register(hdev
, ADDRESS_U1_NUM_SENS_Y
,
511 &sen_line_num_y
, 0, true);
513 dev_err(&hdev
->dev
, "failed U1_NUM_SENS_Y (%d)\n", ret
);
517 ret
= u1_read_write_register(hdev
, ADDRESS_U1_PITCH_SENS_X
,
520 dev_err(&hdev
->dev
, "failed U1_PITCH_SENS_X (%d)\n", ret
);
524 ret
= u1_read_write_register(hdev
, ADDRESS_U1_PITCH_SENS_Y
,
527 dev_err(&hdev
->dev
, "failed U1_PITCH_SENS_Y (%d)\n", ret
);
531 ret
= u1_read_write_register(hdev
, ADDRESS_U1_RESO_DWN_ABS
,
532 &resolution
, 0, true);
534 dev_err(&hdev
->dev
, "failed U1_RESO_DWN_ABS (%d)\n", ret
);
537 pri_data
->x_active_len_mm
=
538 (pitch_x
* (sen_line_num_x
- 1)) / 10;
539 pri_data
->y_active_len_mm
=
540 (pitch_y
* (sen_line_num_y
- 1)) / 10;
543 (resolution
<< 2) * (sen_line_num_x
- 1);
546 (resolution
<< 2) * (sen_line_num_y
- 1);
549 ret
= u1_read_write_register(hdev
, ADDRESS_U1_PAD_BTN
,
552 dev_err(&hdev
->dev
, "failed U1_PAD_BTN (%d)\n", ret
);
555 if ((tmp
& 0x0F) == (tmp
& 0xF0) >> 4) {
556 pri_data
->btn_cnt
= (tmp
& 0x0F);
559 pri_data
->btn_cnt
= 1;
562 pri_data
->has_sp
= 0;
563 /* Check StickPointer device */
564 ret
= u1_read_write_register(hdev
, ADDRESS_U1_DEVICE_TYP
,
567 dev_err(&hdev
->dev
, "failed U1_DEVICE_TYP (%d)\n", ret
);
570 if (tmp
& U1_DEVTYPE_SP_SUPPORT
) {
571 dev_ctrl
|= U1_SP_ABS_MODE
;
572 ret
= u1_read_write_register(hdev
, ADDRESS_U1_DEV_CTRL_1
,
573 NULL
, dev_ctrl
, false);
575 dev_err(&hdev
->dev
, "failed SP mode (%d)\n", ret
);
579 ret
= u1_read_write_register(hdev
, ADDRESS_U1_SP_BTN
,
580 &pri_data
->sp_btn_info
, 0, true);
582 dev_err(&hdev
->dev
, "failed U1_SP_BTN (%d)\n", ret
);
585 pri_data
->has_sp
= 1;
587 pri_data
->max_fingers
= 5;
592 static int T4_init(struct hid_device
*hdev
, struct alps_dev
*pri_data
)
595 u8 tmp
, sen_line_num_x
, sen_line_num_y
;
597 ret
= t4_read_write_register(hdev
, T4_PRM_ID_CONFIG_3
, &tmp
, 0, true);
599 dev_err(&hdev
->dev
, "failed T4_PRM_ID_CONFIG_3 (%d)\n", ret
);
602 sen_line_num_x
= 16 + ((tmp
& 0x0F) | (tmp
& 0x08 ? 0xF0 : 0));
603 sen_line_num_y
= 12 + (((tmp
& 0xF0) >> 4) | (tmp
& 0x80 ? 0xF0 : 0));
605 pri_data
->x_max
= sen_line_num_x
* T4_COUNT_PER_ELECTRODE
;
606 pri_data
->x_min
= T4_COUNT_PER_ELECTRODE
;
607 pri_data
->y_max
= sen_line_num_y
* T4_COUNT_PER_ELECTRODE
;
608 pri_data
->y_min
= T4_COUNT_PER_ELECTRODE
;
609 pri_data
->x_active_len_mm
= pri_data
->y_active_len_mm
= 0;
610 pri_data
->btn_cnt
= 1;
612 ret
= t4_read_write_register(hdev
, PRM_SYS_CONFIG_1
, &tmp
, 0, true);
614 dev_err(&hdev
->dev
, "failed PRM_SYS_CONFIG_1 (%d)\n", ret
);
618 ret
= t4_read_write_register(hdev
, PRM_SYS_CONFIG_1
, NULL
, tmp
, false);
620 dev_err(&hdev
->dev
, "failed PRM_SYS_CONFIG_1 (%d)\n", ret
);
624 ret
= t4_read_write_register(hdev
, T4_PRM_FEED_CONFIG_1
,
625 NULL
, T4_I2C_ABS
, false);
627 dev_err(&hdev
->dev
, "failed T4_PRM_FEED_CONFIG_1 (%d)\n", ret
);
631 ret
= t4_read_write_register(hdev
, T4_PRM_FEED_CONFIG_4
, NULL
,
632 T4_FEEDCFG4_ADVANCED_ABS_ENABLE
, false);
634 dev_err(&hdev
->dev
, "failed T4_PRM_FEED_CONFIG_4 (%d)\n", ret
);
637 pri_data
->max_fingers
= 5;
638 pri_data
->has_sp
= 0;
643 static int alps_input_configured(struct hid_device
*hdev
, struct hid_input
*hi
)
645 struct alps_dev
*data
= hid_get_drvdata(hdev
);
646 struct input_dev
*input
= hi
->input
, *input2
;
652 hid_dbg(hdev
, "Opening low level driver\n");
653 ret
= hid_hw_open(hdev
);
657 /* Allow incoming hid reports */
658 hid_device_io_start(hdev
);
659 switch (data
->dev_type
) {
661 ret
= T4_init(hdev
, data
);
664 ret
= u1_init(hdev
, data
);
673 __set_bit(EV_ABS
, input
->evbit
);
674 input_set_abs_params(input
, ABS_MT_POSITION_X
,
675 data
->x_min
, data
->x_max
, 0, 0);
676 input_set_abs_params(input
, ABS_MT_POSITION_Y
,
677 data
->y_min
, data
->y_max
, 0, 0);
679 if (data
->x_active_len_mm
&& data
->y_active_len_mm
) {
680 res_x
= (data
->x_max
- 1) / data
->x_active_len_mm
;
681 res_y
= (data
->y_max
- 1) / data
->y_active_len_mm
;
683 input_abs_set_res(input
, ABS_MT_POSITION_X
, res_x
);
684 input_abs_set_res(input
, ABS_MT_POSITION_Y
, res_y
);
687 input_set_abs_params(input
, ABS_MT_PRESSURE
, 0, 64, 0, 0);
689 input_mt_init_slots(input
, data
->max_fingers
, INPUT_MT_POINTER
);
691 __set_bit(EV_KEY
, input
->evbit
);
693 if (data
->btn_cnt
== 1)
694 __set_bit(INPUT_PROP_BUTTONPAD
, input
->propbit
);
696 for (i
= 0; i
< data
->btn_cnt
; i
++)
697 __set_bit(BTN_LEFT
+ i
, input
->keybit
);
699 /* Stick device initialization */
701 input2
= input_allocate_device();
703 input_free_device(input2
);
707 data
->input2
= input2
;
708 input2
->phys
= input
->phys
;
709 input2
->name
= "DualPoint Stick";
710 input2
->id
.bustype
= BUS_I2C
;
711 input2
->id
.vendor
= input
->id
.vendor
;
712 input2
->id
.product
= input
->id
.product
;
713 input2
->id
.version
= input
->id
.version
;
714 input2
->dev
.parent
= input
->dev
.parent
;
716 __set_bit(EV_KEY
, input2
->evbit
);
717 data
->sp_btn_cnt
= (data
->sp_btn_info
& 0x0F);
718 for (i
= 0; i
< data
->sp_btn_cnt
; i
++)
719 __set_bit(BTN_LEFT
+ i
, input2
->keybit
);
721 __set_bit(EV_REL
, input2
->evbit
);
722 __set_bit(REL_X
, input2
->relbit
);
723 __set_bit(REL_Y
, input2
->relbit
);
724 __set_bit(INPUT_PROP_POINTER
, input2
->propbit
);
725 __set_bit(INPUT_PROP_POINTING_STICK
, input2
->propbit
);
727 if (input_register_device(data
->input2
)) {
728 input_free_device(input2
);
734 hid_device_io_stop(hdev
);
739 static int alps_input_mapping(struct hid_device
*hdev
,
740 struct hid_input
*hi
, struct hid_field
*field
,
741 struct hid_usage
*usage
, unsigned long **bit
, int *max
)
746 static int alps_probe(struct hid_device
*hdev
, const struct hid_device_id
*id
)
748 struct alps_dev
*data
= NULL
;
750 data
= devm_kzalloc(&hdev
->dev
, sizeof(struct alps_dev
), GFP_KERNEL
);
755 hid_set_drvdata(hdev
, data
);
757 hdev
->quirks
|= HID_QUIRK_NO_INIT_REPORTS
;
759 ret
= hid_parse(hdev
);
761 hid_err(hdev
, "parse failed\n");
765 switch (hdev
->product
) {
766 case HID_DEVICE_ID_ALPS_T4_BTNLESS
:
769 case HID_DEVICE_ID_ALPS_U1_DUAL
:
770 case HID_DEVICE_ID_ALPS_U1
:
774 data
->dev_type
= UNKNOWN
;
777 ret
= hid_hw_start(hdev
, HID_CONNECT_DEFAULT
);
779 hid_err(hdev
, "hw start failed\n");
786 static void alps_remove(struct hid_device
*hdev
)
791 static const struct hid_device_id alps_id
[] = {
792 { HID_DEVICE(HID_BUS_ANY
, HID_GROUP_ANY
,
793 USB_VENDOR_ID_ALPS_JP
, HID_DEVICE_ID_ALPS_U1_DUAL
) },
794 { HID_DEVICE(HID_BUS_ANY
, HID_GROUP_ANY
,
795 USB_VENDOR_ID_ALPS_JP
, HID_DEVICE_ID_ALPS_U1
) },
796 { HID_DEVICE(HID_BUS_ANY
, HID_GROUP_ANY
,
797 USB_VENDOR_ID_ALPS_JP
, HID_DEVICE_ID_ALPS_T4_BTNLESS
) },
800 MODULE_DEVICE_TABLE(hid
, alps_id
);
802 static struct hid_driver alps_driver
= {
806 .remove
= alps_remove
,
807 .raw_event
= alps_raw_event
,
808 .input_mapping
= alps_input_mapping
,
809 .input_configured
= alps_input_configured
,
811 .resume
= alps_post_resume
,
812 .reset_resume
= alps_post_reset
,
816 module_hid_driver(alps_driver
);
818 MODULE_AUTHOR("Masaki Ota <masaki.ota@jp.alps.com>");
819 MODULE_DESCRIPTION("ALPS HID driver");
820 MODULE_LICENSE("GPL");