* packets (Report ID 2). This code changes device mode, so it
* sends raw sensor reports (Report ID 5).
*/
-static int atp_geyser_init(struct usb_device *udev)
+static int atp_geyser_init(struct atp *dev)
{
+ struct usb_device *udev = dev->udev;
char *data;
int size;
int i;
data = kmalloc(8, GFP_KERNEL);
if (!data) {
- dev_err(&udev->dev, "Out of memory\n");
+ dev_err(&dev->input->dev, "Out of memory\n");
return -ENOMEM;
}
for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[i]);
- dev_err(&udev->dev, "Failed to read mode from device.\n");
+ dev_err(&dev->input->dev, "Failed to read mode from device.\n");
ret = -EIO;
goto out_free;
}
for (i = 0; i < 8; i++)
dprintk("appletouch[%d]: %d\n", i, data[i]);
- dev_err(&udev->dev, "Failed to request geyser raw mode\n");
+ dev_err(&dev->input->dev, "Failed to request geyser raw mode\n");
ret = -EIO;
goto out_free;
}
static void atp_reinit(struct work_struct *work)
{
struct atp *dev = container_of(work, struct atp, work);
- struct usb_device *udev = dev->udev;
int retval;
dprintk("appletouch: putting appletouch to sleep (reinit)\n");
- atp_geyser_init(udev);
+ atp_geyser_init(dev);
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval)
- dev_err(&udev->dev,
+ dev_err(&dev->input->dev,
"atp_reinit: usb_submit_urb failed with error %d\n",
retval);
}
exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval)
- dev_err(&dev->udev->dev,
+ dev_err(&dev->input->dev,
"atp_complete: usb_submit_urb failed with result %d\n",
retval);
}
exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
if (retval)
- dev_err(&dev->udev->dev,
+ dev_err(&dev->input->dev,
"atp_complete: usb_submit_urb failed with result %d\n",
retval);
}
static int atp_handle_geyser(struct atp *dev)
{
- struct usb_device *udev = dev->udev;
-
if (dev->info != &fountain_info) {
/* switch to raw sensor mode */
- if (atp_geyser_init(udev))
+ if (atp_geyser_init(dev))
return -EIO;
- printk(KERN_INFO "appletouch: Geyser mode initialized.\n");
+ dev_info(&dev->input->dev, "Geyser mode initialized.\n");
}
return 0;