int firmwareCode; /* prom/eeprom version */
char usbPath[64 + 1]; /* device's physical usb path */
char inputPath[64 + 1]; /* input device path */
- char manuName[64 + 1]; /* manufacturer name */
- char prodName[64 + 1]; /* product name */
};
struct aiptek_settings {
* convention above.) I therefore have taken over REL_MISC and ABS_MISC
* (for relative and absolute reports, respectively) for communicating
* Proximity. Why two events? I thought it interesting to know if the
- * Proximity event occured while the tablet was in absolute or relative
+ * Proximity event occurred while the tablet was in absolute or relative
* mode.
*
* Other tablets use the notion of a certain minimum stylus pressure
} else {
input_regs(inputdev, regs);
- x = le16_to_cpu(get_unaligned((__u16 *) (data + 1)));
- y = le16_to_cpu(get_unaligned((__u16 *) (data + 3)));
- z = le16_to_cpu(get_unaligned((__u16 *) (data + 6)));
+ x = le16_to_cpu(get_unaligned((__le16 *) (data + 1)));
+ y = le16_to_cpu(get_unaligned((__le16 *) (data + 3)));
+ z = le16_to_cpu(get_unaligned((__le16 *) (data + 6)));
p = (data[5] & 0x01) != 0 ? 1 : 0;
dv = (data[5] & 0x02) != 0 ? 1 : 0;
aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED;
} else {
input_regs(inputdev, regs);
- x = le16_to_cpu(get_unaligned((__u16 *) (data + 1)));
- y = le16_to_cpu(get_unaligned((__u16 *) (data + 3)));
+ x = le16_to_cpu(get_unaligned((__le16 *) (data + 1)));
+ y = le16_to_cpu(get_unaligned((__le16 *) (data + 3)));
jitterable = data[5] & 0x1c;
pck = (data[1] & aiptek->curSetting.stylusButtonUpper) != 0 ? 1 : 0;
macro = data[3];
- z = le16_to_cpu(get_unaligned((__u16 *) (data + 4)));
+ z = le16_to_cpu(get_unaligned((__le16 *) (data + 4)));
if (dv != 0) {
input_regs(inputdev, regs);
* hat switches (which just so happen to be the macroKeys.)
*/
else if (data[0] == 6) {
- macro = le16_to_cpu(get_unaligned((__u16 *) (data + 1)));
+ macro = le16_to_cpu(get_unaligned((__le16 *) (data + 1)));
input_regs(inputdev, regs);
if (macro > 0) {
* manufacturing revisions. In any event, we consider these
* IDs to not be model-specific nor unique.
*/
-struct usb_device_id aiptek_ids[] = {
+static const struct usb_device_id aiptek_ids[] = {
{USB_DEVICE(USB_VENDOR_ID_AIPTEK, 0x01)},
{USB_DEVICE(USB_VENDOR_ID_AIPTEK, 0x10)},
{USB_DEVICE(USB_VENDOR_ID_AIPTEK, 0x20)},
struct aiptek *aiptek = inputdev->private;
if (--aiptek->openCount == 0) {
- usb_unlink_urb(aiptek->urb);
+ usb_kill_urb(aiptek->urb);
}
}
USB_REQ_SET_REPORT,
USB_TYPE_CLASS | USB_RECIP_INTERFACE |
USB_DIR_OUT, (report_type << 8) + report_id,
- aiptek->ifnum, buffer, size, 5 * HZ);
+ aiptek->ifnum, buffer, size, 5000);
}
static int
USB_REQ_GET_REPORT,
USB_TYPE_CLASS | USB_RECIP_INTERFACE |
USB_DIR_IN, (report_type << 8) + report_id,
- aiptek->ifnum, buffer, size, 5 * HZ);
+ aiptek->ifnum, buffer, size, 5000);
}
/***********************************************************************
buf[0], buf[1], buf[2]);
ret = -EIO;
} else {
- ret = le16_to_cpu(get_unaligned((__u16 *) (buf + 1)));
+ ret = le16_to_cpu(get_unaligned((__le16 *) (buf + 1)));
}
kfree(buf);
return ret;
if (aiptek == NULL)
return 0;
- retval = snprintf(buf, PAGE_SIZE, "%s\n", aiptek->features.manuName);
+ retval = snprintf(buf, PAGE_SIZE, "%s\n", aiptek->usbdev->manufacturer);
return retval;
}
if (aiptek == NULL)
return 0;
- retval = snprintf(buf, PAGE_SIZE, "%s\n", aiptek->features.prodName);
+ retval = snprintf(buf, PAGE_SIZE, "%s\n", aiptek->usbdev->product);
return retval;
}
if (strcmp(buf, "disable") == 0) {
aiptek->newSetting.xTilt = AIPTEK_TILT_DISABLE;
} else {
- x = (int)simple_strtol(buf, 0, 10);
+ x = (int)simple_strtol(buf, NULL, 10);
if (x >= AIPTEK_TILT_MIN && x <= AIPTEK_TILT_MAX) {
aiptek->newSetting.xTilt = x;
}
if (strcmp(buf, "disable") == 0) {
aiptek->newSetting.yTilt = AIPTEK_TILT_DISABLE;
} else {
- y = (int)simple_strtol(buf, 0, 10);
+ y = (int)simple_strtol(buf, NULL, 10);
if (y >= AIPTEK_TILT_MIN && y <= AIPTEK_TILT_MAX) {
aiptek->newSetting.yTilt = y;
}
if (aiptek == NULL)
return 0;
- aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, 0, 10);
+ aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, NULL, 10);
return count;
}
if (aiptek == NULL)
return 0;
- aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, 0, 10);
+ aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, NULL, 10);
return count;
}
if (aiptek == NULL)
return 0;
- aiptek->newSetting.wheel = (int)simple_strtol(buf, 0, 10);
+ aiptek->newSetting.wheel = (int)simple_strtol(buf, NULL, 10);
return count;
}
aiptek->inputdev.name = "Aiptek";
aiptek->inputdev.phys = aiptek->features.usbPath;
aiptek->inputdev.id.bustype = BUS_USB;
- aiptek->inputdev.id.vendor = usbdev->descriptor.idVendor;
- aiptek->inputdev.id.product = usbdev->descriptor.idProduct;
- aiptek->inputdev.id.version = usbdev->descriptor.bcdDevice;
+ aiptek->inputdev.id.vendor = le16_to_cpu(usbdev->descriptor.idVendor);
+ aiptek->inputdev.id.product = le16_to_cpu(usbdev->descriptor.idProduct);
+ aiptek->inputdev.id.version = le16_to_cpu(usbdev->descriptor.bcdDevice);
+ aiptek->inputdev.dev = &intf->dev;
aiptek->usbdev = usbdev;
aiptek->ifnum = intf->altsetting[0].desc.bInterfaceNumber;
*/
input_register_device(&aiptek->inputdev);
- /* Go and decode the USB representation of the tablet's manufacturer
- * name and product name. They only change once every hotplug event,
- * which is why we put it here instead of in the sysfs interface.
- */
- usb_string(usbdev,
- usbdev->descriptor.iManufacturer,
- aiptek->features.manuName,
- sizeof(aiptek->features.manuName));
- usb_string(usbdev,
- usbdev->descriptor.iProduct,
- aiptek->features.prodName,
- sizeof(aiptek->features.prodName));
-
/* We now will look for the evdev device which is mapped to
* the tablet. The partial name is kept in the link list of
* input_handles associated with this input device.
if (aiptek != NULL) {
/* Free & unhook everything from the system.
*/
- usb_unlink_urb(aiptek->urb);
+ usb_kill_urb(aiptek->urb);
input_unregister_device(&aiptek->inputdev);
aiptek_delete_files(&intf->dev);
usb_free_urb(aiptek->urb);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
-MODULE_PARM(programmableDelay, "i");
+module_param(programmableDelay, int, 0);
MODULE_PARM_DESC(programmableDelay, "delay used during tablet programming");
-MODULE_PARM(jitterDelay, "i");
+module_param(jitterDelay, int, 0);
MODULE_PARM_DESC(jitterDelay, "stylus/mouse settlement delay");
module_init(aiptek_init);