Lines Matching refs:aiptek

386 struct aiptek {  struct
475 struct aiptek *aiptek = urb->context; in aiptek_irq() local
476 unsigned char *data = aiptek->data; in aiptek_irq()
477 struct input_dev *dev = &aiptek->dev; in aiptek_irq()
483 aiptek->eventCount++; in aiptek_irq()
488 if (aiptek->coordinate_mode == AIPTEK_COORDINATE_ABSOLUTE_MODE) { in aiptek_irq()
489 aiptek->diagnostic = in aiptek_irq()
494 if (aiptek->tool_mode != AIPTEK_TOOL_BUTTON_MOUSE_MODE) { in aiptek_irq()
495 aiptek->tool_mode = in aiptek_irq()
521 if (aiptek->coordinate_mode == AIPTEK_COORDINATE_RELATIVE_MODE) { in aiptek_irq()
522 aiptek->diagnostic = in aiptek_irq()
525 if (!AIPTEK_POINTER_ALLOW_STYLUS_MODE(aiptek->pointer_mode)) in aiptek_irq()
527 aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; in aiptek_irq()
543 switch (aiptek->tool_mode) { in aiptek_irq()
608 if (aiptek->tool_mode == in aiptek_irq()
624 if (aiptek->xTilt != in aiptek_irq()
628 aiptek->xTilt); in aiptek_irq()
629 if (aiptek->yTilt != in aiptek_irq()
633 aiptek->yTilt); in aiptek_irq()
642 if (aiptek->coordinate_mode == AIPTEK_COORDINATE_RELATIVE_MODE) { in aiptek_irq()
643 aiptek->diagnostic = in aiptek_irq()
646 if (!AIPTEK_POINTER_ALLOW_MOUSE_MODE(aiptek->pointer_mode)) in aiptek_irq()
648 aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; in aiptek_irq()
738 if (jitterable != 0 && aiptek->jitterDelay != 0) { in aiptek_irq()
739 wait_ms(aiptek->jitterDelay); in aiptek_irq()
779 struct aiptek *aiptek = dev->private; in aiptek_open() local
780 if (aiptek->open_count++) in aiptek_open()
783 aiptek->irq->dev = aiptek->usbdev; in aiptek_open()
784 if (usb_submit_urb(aiptek->irq)) in aiptek_open()
793 struct aiptek *aiptek = dev->private; in aiptek_close() local
795 if (!--aiptek->open_count) in aiptek_close()
796 usb_unlink_urb(aiptek->irq); in aiptek_close()
851 aiptek_program_tablet(struct aiptek *aiptek) in aiptek_program_tablet() argument
856 aiptek->diagnostic = AIPTEK_DIAGNOSTIC_NA; in aiptek_program_tablet()
859 aiptek_command(aiptek->usbdev, aiptek->ifnum, 0x18, 0x04); in aiptek_program_tablet()
861 modelCode = aiptek_query(aiptek->usbdev, aiptek->ifnum, 0x02, 0x00); in aiptek_program_tablet()
863 odmCode = aiptek_query(aiptek->usbdev, aiptek->ifnum, 0x03, 0x00); in aiptek_program_tablet()
865 firmwareCode = aiptek_query(aiptek->usbdev, aiptek->ifnum, 0x04, 0x00); in aiptek_program_tablet()
867 xResolution = aiptek_query(aiptek->usbdev, aiptek->ifnum, 0x01, 0x00); in aiptek_program_tablet()
869 yResolution = aiptek_query(aiptek->usbdev, aiptek->ifnum, 0x01, 0x01); in aiptek_program_tablet()
871 zResolution = aiptek_query(aiptek->usbdev, aiptek->ifnum, 0x08, 0x00); in aiptek_program_tablet()
875 if (aiptek->coordinate_mode == AIPTEK_COORDINATE_ABSOLUTE_MODE) { in aiptek_program_tablet()
877 aiptek_command(aiptek->usbdev, aiptek->ifnum, 0x10, 0x01); in aiptek_program_tablet()
880 aiptek_command(aiptek->usbdev, aiptek->ifnum, 0x10, 0x00); in aiptek_program_tablet()
883 aiptek_command(aiptek->usbdev, aiptek->ifnum, 0x11, 0x02); in aiptek_program_tablet()
885 aiptek_command(aiptek->usbdev, aiptek->ifnum, 0x17, 0x00); in aiptek_program_tablet()
887 aiptek_command(aiptek->usbdev, aiptek->ifnum, 0x12, 0xff); in aiptek_program_tablet()
889 aiptek->features->odmCode = odmCode; in aiptek_program_tablet()
890 aiptek->features->modelCode = modelCode & 0xff; in aiptek_program_tablet()
891 aiptek->features->firmwareCode = firmwareCode; in aiptek_program_tablet()
892 aiptek->features->pressure_max = zResolution; in aiptek_program_tablet()
893 aiptek->features->x_max = xResolution; in aiptek_program_tablet()
894 aiptek->features->y_max = yResolution; in aiptek_program_tablet()
896 aiptek->eventCount = 0; in aiptek_program_tablet()
906 aiptek_procfs_parse(struct aiptek *aiptek, char *keyword, char *value) in aiptek_procfs_parse() argument
910 aiptek->pointer_mode = AIPTEK_POINTER_ONLY_STYLUS_MODE; in aiptek_procfs_parse()
912 aiptek->pointer_mode = AIPTEK_POINTER_ONLY_MOUSE_MODE; in aiptek_procfs_parse()
914 aiptek->pointer_mode = AIPTEK_POINTER_EITHER_MODE; in aiptek_procfs_parse()
918 aiptek->coordinate_mode = in aiptek_procfs_parse()
921 aiptek->coordinate_mode = in aiptek_procfs_parse()
926 aiptek->xTilt = AIPTEK_TILT_DISABLE; in aiptek_procfs_parse()
930 aiptek->xTilt = x; in aiptek_procfs_parse()
934 aiptek->yTilt = AIPTEK_TILT_DISABLE; in aiptek_procfs_parse()
938 aiptek->yTilt = y; in aiptek_procfs_parse()
941 aiptek->jitterDelay = (int) simple_strtol(value, 0, 10); in aiptek_procfs_parse()
944 aiptek->tool_mode = AIPTEK_TOOL_BUTTON_MOUSE_MODE; in aiptek_procfs_parse()
946 aiptek->tool_mode = AIPTEK_TOOL_BUTTON_RUBBER_MODE; in aiptek_procfs_parse()
948 aiptek->tool_mode = AIPTEK_TOOL_BUTTON_PENCIL_MODE; in aiptek_procfs_parse()
950 aiptek->tool_mode = AIPTEK_TOOL_BUTTON_PEN_MODE; in aiptek_procfs_parse()
952 aiptek->tool_mode = AIPTEK_TOOL_BUTTON_BRUSH_MODE; in aiptek_procfs_parse()
954 aiptek->tool_mode = AIPTEK_TOOL_BUTTON_AIRBRUSH_MODE; in aiptek_procfs_parse()
970 struct aiptek *aiptek = data; in aiptek_procfs_read() local
974 aiptek->features->x_max, aiptek->features->y_max); in aiptek_procfs_read()
979 aiptek->dev.idvendor, aiptek->dev.idproduct, in aiptek_procfs_read()
980 aiptek->features->odmCode); in aiptek_procfs_read()
983 aiptek->features->modelCode, in aiptek_procfs_read()
984 aiptek->features->firmwareCode); in aiptek_procfs_read()
986 out += sprintf(out, "on /dev/input/event%d\n", aiptek->dev.number); in aiptek_procfs_read()
988 (aiptek->pointer_mode == AIPTEK_POINTER_ONLY_MOUSE_MODE in aiptek_procfs_read()
990 : (aiptek->pointer_mode == in aiptek_procfs_read()
995 (aiptek->coordinate_mode == in aiptek_procfs_read()
1000 switch (aiptek->tool_mode) { in aiptek_procfs_read()
1027 if (aiptek->xTilt == AIPTEK_TILT_DISABLE) { in aiptek_procfs_read()
1030 out += sprintf(out, "%d\n", aiptek->xTilt); in aiptek_procfs_read()
1034 if (aiptek->yTilt == AIPTEK_TILT_DISABLE) { in aiptek_procfs_read()
1037 out += sprintf(out, "%d\n", aiptek->yTilt); in aiptek_procfs_read()
1040 out += sprintf(out, "jitter=%d\n", aiptek->jitterDelay); in aiptek_procfs_read()
1043 switch (aiptek->diagnostic) { in aiptek_procfs_read()
1055 if (aiptek->pointer_mode == AIPTEK_POINTER_ONLY_MOUSE_MODE) in aiptek_procfs_read()
1062 out += sprintf(out, "eventsReceived=%lu\n", aiptek->eventCount); in aiptek_procfs_read()
1101 struct aiptek *aiptek = data; in aiptek_procfs_write() local
1117 aiptek_procfs_parse(aiptek, keyword, value); in aiptek_procfs_write()
1134 aiptek_procfs_parse(aiptek, keyword, value); in aiptek_procfs_write()
1137 aiptek_program_tablet(aiptek); in aiptek_procfs_write()
1147 destroy_procfs_file(struct aiptek *aiptek) in destroy_procfs_file() argument
1149 if (aiptek->aiptekProcfsEntry) in destroy_procfs_file()
1150 remove_proc_entry("aiptek", aiptek->usbProcfsEntry); in destroy_procfs_file()
1151 if (aiptek->usbProcfsEntry) in destroy_procfs_file()
1154 aiptek->usbProcfsEntry = NULL; in destroy_procfs_file()
1155 aiptek->aiptekProcfsEntry = NULL; in destroy_procfs_file()
1163 create_procfs_file(struct aiptek *aiptek) in create_procfs_file() argument
1166 aiptek->usbProcfsEntry = create_proc_entry("usb", S_IFDIR, in create_procfs_file()
1168 if (!aiptek->usbProcfsEntry) { in create_procfs_file()
1170 destroy_procfs_file(aiptek); in create_procfs_file()
1173 aiptek->usbProcfsEntry->owner = THIS_MODULE; in create_procfs_file()
1176 aiptek->aiptekProcfsEntry = create_proc_entry("aiptek", in create_procfs_file()
1179 aiptek->usbProcfsEntry); in create_procfs_file()
1180 if (!aiptek->aiptekProcfsEntry) { in create_procfs_file()
1182 destroy_procfs_file(aiptek); in create_procfs_file()
1185 aiptek->aiptekProcfsEntry->owner = THIS_MODULE; in create_procfs_file()
1186 aiptek->aiptekProcfsEntry->data = aiptek; in create_procfs_file()
1187 aiptek->aiptekProcfsEntry->read_proc = aiptek_procfs_read; in create_procfs_file()
1188 aiptek->aiptekProcfsEntry->write_proc = aiptek_procfs_write; in create_procfs_file()
1197 struct aiptek *aiptek; in aiptek_probe() local
1200 if (!(aiptek = kmalloc(sizeof (struct aiptek), GFP_KERNEL))) in aiptek_probe()
1203 memset(aiptek, 0, sizeof (struct aiptek)); in aiptek_probe()
1205 aiptek->irq = usb_alloc_urb(0); in aiptek_probe()
1206 if (!aiptek->irq) { in aiptek_probe()
1207 kfree(aiptek); in aiptek_probe()
1214 aiptek->features = aiptek_features; in aiptek_probe()
1223 aiptek->usbdev = dev; in aiptek_probe()
1224 aiptek->ifnum = ifnum; in aiptek_probe()
1225 aiptek->pointer_mode = AIPTEK_POINTER_EITHER_MODE; in aiptek_probe()
1226 aiptek->coordinate_mode = AIPTEK_COORDINATE_ABSOLUTE_MODE; in aiptek_probe()
1227 aiptek->tool_mode = AIPTEK_TOOL_BUTTON_PEN_MODE; in aiptek_probe()
1228 aiptek->xTilt = AIPTEK_TILT_DISABLE; in aiptek_probe()
1229 aiptek->yTilt = AIPTEK_TILT_DISABLE; in aiptek_probe()
1230 aiptek->jitterDelay = AIPTEK_JITTER_DELAY_DEFAULT; in aiptek_probe()
1233 create_procfs_file(aiptek); in aiptek_probe()
1236 aiptek_program_tablet(aiptek); in aiptek_probe()
1238 aiptek->dev.evbit[0] |= BIT(EV_KEY) in aiptek_probe()
1242 aiptek->dev.absbit[0] |= BIT(ABS_X) in aiptek_probe()
1249 aiptek->dev.relbit[0] |= BIT(REL_X) in aiptek_probe()
1258 set_bit(macroKeyEvents[i], aiptek->dev.keybit); in aiptek_probe()
1261 aiptek->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) in aiptek_probe()
1265 aiptek->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) in aiptek_probe()
1275 aiptek->dev.mscbit[0] = BIT(MSC_SERIAL); in aiptek_probe()
1277 aiptek->dev.absmax[ABS_X] = aiptek->features->x_max; in aiptek_probe()
1278 aiptek->dev.absmax[ABS_Y] = aiptek->features->y_max; in aiptek_probe()
1279 aiptek->dev.absmax[ABS_PRESSURE] = aiptek->features->pressure_max; in aiptek_probe()
1280 aiptek->dev.absmax[ABS_TILT_X] = AIPTEK_TILT_MAX; in aiptek_probe()
1281 aiptek->dev.absmax[ABS_TILT_Y] = AIPTEK_TILT_MAX; in aiptek_probe()
1282 aiptek->dev.absfuzz[ABS_X] = 0; in aiptek_probe()
1283 aiptek->dev.absfuzz[ABS_Y] = 0; in aiptek_probe()
1285 aiptek->dev.private = aiptek; in aiptek_probe()
1286 aiptek->dev.open = aiptek_open; in aiptek_probe()
1287 aiptek->dev.close = aiptek_close; in aiptek_probe()
1289 aiptek->dev.name = aiptek->features->name; in aiptek_probe()
1290 aiptek->dev.idbus = BUS_USB; in aiptek_probe()
1291 aiptek->dev.idvendor = dev->descriptor.idVendor; in aiptek_probe()
1292 aiptek->dev.idproduct = dev->descriptor.idProduct; in aiptek_probe()
1293 aiptek->dev.idversion = dev->descriptor.bcdDevice; in aiptek_probe()
1294 aiptek->usbdev = dev; in aiptek_probe()
1298 usb_fill_int_urb(aiptek->irq, in aiptek_probe()
1301 aiptek->data, in aiptek_probe()
1302 aiptek->features->pktlen, in aiptek_probe()
1303 aiptek->features->irq, aiptek, endpoint->bInterval); in aiptek_probe()
1305 input_register_device(&aiptek->dev); in aiptek_probe()
1308 aiptek->dev.number, in aiptek_probe()
1309 aiptek->features->name, dev->bus->busnum, dev->devnum, ifnum); in aiptek_probe()
1311 return aiptek; in aiptek_probe()
1319 struct aiptek *aiptek = ptr; in aiptek_disconnect() local
1321 destroy_procfs_file(aiptek); in aiptek_disconnect()
1323 usb_unlink_urb(aiptek->irq); in aiptek_disconnect()
1324 input_unregister_device(&aiptek->dev); in aiptek_disconnect()
1325 usb_free_urb(aiptek->irq); in aiptek_disconnect()
1326 kfree(aiptek); in aiptek_disconnect()