- usb_fill_int_urb(dev->urb, dev->udev,
- usb_rcvintpipe(dev->udev, int_in_endpointAddr),
- dev->data, ATP_DATASIZE, atp_complete, dev, 1);
-
- init_input_dev(&dev->input);
- dev->input.name = "appletouch";
- dev->input.dev = &iface->dev;
- dev->input.private = dev;
- dev->input.open = atp_open;
- dev->input.close = atp_close;
-
- dev->input.id.bustype = BUS_USB;
- dev->input.id.vendor = id->idVendor;
- dev->input.id.product = id->idProduct;
- dev->input.id.version = ATP_DRIVER_VERSION;
-
- set_bit(EV_ABS, dev->input.evbit);
- if (id->idProduct == ATP_17INCH_ID1)
- input_set_abs_params(&dev->input, ABS_X, 0,
- (ATP_XSENSORS - 1) * ATP_XFACT - 1,
- ATP_FUZZ, 0);
- else
- /* 12" and 15" Powerbooks only have 16 x sensors */
- input_set_abs_params(&dev->input, ABS_X, 0,
- (16 - 1) * ATP_XFACT - 1,
- ATP_FUZZ, 0);
- input_set_abs_params(&dev->input, ABS_Y, 0,
- (ATP_YSENSORS - 1) * ATP_YFACT - 1,
- ATP_FUZZ, 0);
- input_set_abs_params(&dev->input, ABS_PRESSURE, 0, ATP_PRESSURE, 0, 0);
-
- set_bit(EV_KEY, dev->input.evbit);
- set_bit(BTN_TOUCH, dev->input.keybit);
- set_bit(BTN_TOOL_FINGER, dev->input.keybit);
- set_bit(BTN_TOOL_DOUBLETAP, dev->input.keybit);
- set_bit(BTN_TOOL_TRIPLETAP, dev->input.keybit);
- set_bit(BTN_LEFT, dev->input.keybit);
-
- input_register_device(&dev->input);
-
- printk(KERN_INFO "input: appletouch connected\n");
+
+ usb_fill_int_urb(dev->urb, udev,
+ usb_rcvintpipe(udev, int_in_endpointAddr),
+ dev->data, dev->datalen, atp_complete, dev, 1);
+
+ usb_make_path(udev, dev->phys, sizeof(dev->phys));
+ strlcat(dev->phys, "/input0", sizeof(dev->phys));
+
+ input_dev->name = "appletouch";
+ input_dev->phys = dev->phys;
+ usb_to_input_id(dev->udev, &input_dev->id);
+ input_dev->cdev.dev = &iface->dev;
+
+ input_dev->private = dev;
+ input_dev->open = atp_open;
+ input_dev->close = atp_close;
+
+ set_bit(EV_ABS, input_dev->evbit);
+
+ if (atp_is_geyser_3(dev)) {
+ /*
+ * MacBook have 20 X sensors, 10 Y sensors
+ */
+ input_set_abs_params(input_dev, ABS_X, 0,
+ ((20 - 1) * ATP_XFACT) - 1, ATP_FUZZ, 0);
+ input_set_abs_params(input_dev, ABS_Y, 0,
+ ((10 - 1) * ATP_YFACT) - 1, ATP_FUZZ, 0);
+ } else if (atp_is_geyser_2(dev)) {
+ /*
+ * Oct 2005 15" PowerBooks have 15 X sensors, 17" are detected
+ * later.
+ */
+ input_set_abs_params(input_dev, ABS_X, 0,
+ ((15 - 1) * ATP_XFACT) - 1, ATP_FUZZ, 0);
+ input_set_abs_params(input_dev, ABS_Y, 0,
+ ((9 - 1) * ATP_YFACT) - 1, ATP_FUZZ, 0);
+ } else {
+ /*
+ * 12" and 15" Powerbooks only have 16 x sensors,
+ * 17" models are detected later.
+ */
+ input_set_abs_params(input_dev, ABS_X, 0,
+ (16 - 1) * ATP_XFACT - 1, ATP_FUZZ, 0);
+ input_set_abs_params(input_dev, ABS_Y, 0,
+ (ATP_YSENSORS - 1) * ATP_YFACT - 1, ATP_FUZZ, 0);
+ }
+ input_set_abs_params(input_dev, ABS_PRESSURE, 0, ATP_PRESSURE, 0, 0);
+
+ set_bit(EV_KEY, input_dev->evbit);
+ set_bit(BTN_TOUCH, input_dev->keybit);
+ set_bit(BTN_TOOL_FINGER, input_dev->keybit);
+ set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
+ set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
+ set_bit(BTN_LEFT, input_dev->keybit);
+
+ input_register_device(dev->input);
+
+ /* save our data pointer in this interface device */
+ usb_set_intfdata(iface, dev);