0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <linux/module.h>
0015 #include <linux/hid.h>
0016 #include "hid-ids.h"
0017
0018 static int penmount_input_mapping(struct hid_device *hdev,
0019 struct hid_input *hi, struct hid_field *field,
0020 struct hid_usage *usage, unsigned long **bit, int *max)
0021 {
0022 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) {
0023 if (((usage->hid - 1) & HID_USAGE) == 0) {
0024 hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
0025 return 1;
0026 } else {
0027 return -1;
0028 }
0029 }
0030
0031 return 0;
0032 }
0033
0034 static const struct hid_device_id penmount_devices[] = {
0035 { HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_6000) },
0036 { }
0037 };
0038 MODULE_DEVICE_TABLE(hid, penmount_devices);
0039
0040 static struct hid_driver penmount_driver = {
0041 .name = "hid-penmount",
0042 .id_table = penmount_devices,
0043 .input_mapping = penmount_input_mapping,
0044 };
0045
0046 module_hid_driver(penmount_driver);
0047
0048 MODULE_AUTHOR("Christian Gmeiner <christian.gmeiner@gmail.com>");
0049 MODULE_DESCRIPTION("PenMount HID TouchScreen driver");
0050 MODULE_LICENSE("GPL");