Lines Matching defs:device
104 /* Structure to hold all of our device specific stuff */
107 struct input_dev *inputdevice; /* input device struct pointer */
108 struct usb_interface *intf; /* the usb interface for this device */
200 static void parse_hid_report_descriptor(struct gtco *device, char * report,
203 struct device *ddev = &device->intf->dev;
297 if (device->max_X == 0) {
298 device->max_X = globalval[TAG_GLOB_LOG_MAX];
299 device->min_X = globalval[TAG_GLOB_LOG_MIN];
305 if (device->max_Y == 0) {
306 device->max_Y = globalval[TAG_GLOB_LOG_MAX];
307 device->min_Y = globalval[TAG_GLOB_LOG_MIN];
314 if (device->maxtilt_X == 0) {
315 device->maxtilt_X = globalval[TAG_GLOB_LOG_MAX];
316 device->mintilt_X = globalval[TAG_GLOB_LOG_MIN];
322 if (device->maxtilt_Y == 0) {
323 device->maxtilt_Y = globalval[TAG_GLOB_LOG_MAX];
324 device->mintilt_Y = globalval[TAG_GLOB_LOG_MIN];
330 if (device->maxpressure == 0) {
331 device->maxpressure = globalval[TAG_GLOB_LOG_MAX];
332 device->minpressure = globalval[TAG_GLOB_LOG_MIN];
423 * it should tell us the type of device
425 if (device->usage == 0)
426 device->usage = data;
552 * Called when opening the input device. This will submit the URB to
557 struct gtco *device = input_get_drvdata(inputdev);
559 device->urbinfo->dev = interface_to_usbdev(device->intf);
560 if (usb_submit_urb(device->urbinfo, GFP_KERNEL))
567 * Called when closing the input device. This will unlink the URB
571 struct gtco *device = input_get_drvdata(inputdev);
573 usb_kill_urb(device->urbinfo);
578 * Setup input device capabilities. Tell the input system what this
579 * device is capable of generating.
587 struct gtco *device = input_get_drvdata(inputdev);
598 input_set_abs_params(inputdev, ABS_X, device->min_X, device->max_X,
600 input_set_abs_params(inputdev, ABS_Y, device->min_Y, device->max_Y,
607 input_set_abs_params(inputdev, ABS_TILT_X, device->mintilt_X,
608 device->maxtilt_X, 0, 0);
609 input_set_abs_params(inputdev, ABS_TILT_Y, device->mintilt_Y,
610 device->maxtilt_Y, 0, 0);
611 input_set_abs_params(inputdev, ABS_PRESSURE, device->minpressure,
612 device->maxpressure, 0, 0);
624 * This bridges the USB and input device worlds. It generates events
625 * on the input device based on the USB reports.
629 struct gtco *device = urbinfo->context;
635 inputdev = device->inputdevice;
669 switch (device->buffer[0]) {
672 val = ((u16)(device->buffer[8]) << 1);
673 val |= (u16)(device->buffer[7] >> 7);
675 device->buffer[8]);
678 device->buffer[7] = (u8)((device->buffer[7]) & 0x7F);
684 sign_extend32(device->buffer[6], 6));
687 sign_extend32(device->buffer[7], 6));
693 val = (device->buffer[5]) & MASK_BUTTON;
702 val = get_unaligned_le16(&device->buffer[1]);
705 val = get_unaligned_le16(&device->buffer[3]);
709 val = device->buffer[5] & MASK_INRANGE ? 1 : 0;
714 if (device->buffer[0] == 1) {
721 val = device->buffer[5] & MASK_BUTTON;
722 dev_dbg(&device->intf->dev,
737 device->buffer[1]);
747 if (device->buffer[0] == 2) {
749 input_event(inputdev, EV_MSC, MSC_SCAN, device->buffer[1]);
753 if (device->buffer[0] == 1) {
757 if (device->max_X > 0x10000) {
759 val = (u16)(((u16)(device->buffer[2] << 8)) | (u8)device->buffer[1]);
760 val |= (u32)(((u8)device->buffer[3] & 0x1) << 16);
764 le_buffer[0] = (u8)((u8)(device->buffer[3]) >> 1);
765 le_buffer[0] |= (u8)((device->buffer[3] & 0x1) << 7);
767 le_buffer[1] = (u8)(device->buffer[4] >> 1);
768 le_buffer[1] |= (u8)((device->buffer[5] & 0x1) << 7);
777 buttonbyte = device->buffer[5] >> 1;
780 val = get_unaligned_le16(&device->buffer[1]);
783 val = get_unaligned_le16(&device->buffer[3]);
786 buttonbyte = device->buffer[5];
804 input_report_abs(inputdev, ABS_MISC, device->buffer[6]);
809 input_event(inputdev, EV_MSC, MSC_RAW, device->buffer[0]);
817 dev_err(&device->intf->dev,
825 * - Allocate mem for a local structure to manage the device
826 * - Request a HID Report Descriptor from the device and parse it to
827 * find out the device parameters
828 * - Create an input device and assign it attributes
829 * - Allocate an URB so the device can talk to us when the input
845 /* Allocate memory for device structure */
854 /* Set pointer to the input device */
877 /* Sanity check that a device has an endpoint */
951 /* Create a device file node */
955 /* Set Input device functions */
959 /* Set input device information */
965 /* Now set up all the input device capabilities */
968 /* Set input device required ID information */
972 /* Setup the URB, it will be posted later on open of input device */
989 /* All done, now register the input device */
1008 * This function is a standard USB function called when the USB device
1010 * device, and free up allocated memory
1014 /* Grab private device ptr */