14 #include <linux/device.h>
15 #include <linux/hid.h>
16 #include <linux/module.h>
51 #define SLIM_TABLET_5_8_INCH_RDESC_ORIG_SIZE 222
54 static __u8 slim_tablet_5_8_inch_rdesc_fixed[] = {
107 #define SLIM_TABLET_12_1_INCH_RDESC_ORIG_SIZE 269
110 static __u8 slim_tablet_12_1_inch_rdesc_fixed[] = {
163 #define Q_PAD_RDESC_ORIG_SIZE 241
166 static __u8 q_pad_rdesc_fixed[] = {
219 #define PID_0038_RDESC_ORIG_SIZE 241
224 static __u8 pid_0038_rdesc_fixed[] = {
277 #define MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE 300
280 static __u8 media_tablet_10_6_inch_rdesc_fixed[] = {
395 #define MEDIA_TABLET_14_1_INCH_RDESC_ORIG_SIZE 309
398 static __u8 media_tablet_14_1_inch_rdesc_fixed[] = {
512 #define SIRIUS_BATTERY_FREE_TABLET_RDESC_ORIG_SIZE 335
515 static __u8 sirius_battery_free_tablet_rdesc_fixed[] = {
647 rdesc = slim_tablet_5_8_inch_rdesc_fixed;
648 *rsize =
sizeof(slim_tablet_5_8_inch_rdesc_fixed);
653 rdesc = slim_tablet_12_1_inch_rdesc_fixed;
654 *rsize =
sizeof(slim_tablet_12_1_inch_rdesc_fixed);
659 rdesc = q_pad_rdesc_fixed;
660 *rsize =
sizeof(q_pad_rdesc_fixed);
665 rdesc = pid_0038_rdesc_fixed;
666 *rsize =
sizeof(pid_0038_rdesc_fixed);
671 rdesc = media_tablet_10_6_inch_rdesc_fixed;
672 *rsize =
sizeof(media_tablet_10_6_inch_rdesc_fixed);
677 rdesc = media_tablet_14_1_inch_rdesc_fixed;
678 *rsize =
sizeof(media_tablet_14_1_inch_rdesc_fixed);
683 rdesc = sirius_battery_free_tablet_rdesc_fixed;
684 *rsize =
sizeof(sirius_battery_free_tablet_rdesc_fixed);
702 if ((data[1] & 0xF) > 1) {
721 static const s8 tilt_to_radians[] = {
722 0, 5, 10, 14, 19, 24, 29, 34, 40, 45,
723 50, 56, 62, 68, 74, 81, 88, 96, 105
726 s8 tilt_x = (
s8)data[8];
727 s8 tilt_y = (
s8)data[9];
728 s8 sign_x = tilt_x >= 0 ? 1 : -1;
729 s8 sign_y = tilt_y >= 0 ? 1 : -1;
750 data[8] = tilt_to_radians[tilt_x] * sign_x;
751 data[9] = tilt_to_radians[tilt_y] * sign_y;
778 .id_table = waltop_devices,
779 .report_fixup = waltop_report_fixup,
780 .raw_event = waltop_raw_event,
783 static int __init waltop_init(
void)
788 static void __exit waltop_exit(
void)