Input: mtouchusb was indented with spaces instead of tabs, pass
through Lindent and adjust results. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
@@ -103,7 +103,7 @@ struct mtouch_usb {
|
|||||||
char phys[64];
|
char phys[64];
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct usb_device_id mtouchusb_devices [] = {
|
static struct usb_device_id mtouchusb_devices[] = {
|
||||||
{ USB_DEVICE(0x0596, 0x0001) },
|
{ USB_DEVICE(0x0596, 0x0001) },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
@@ -138,21 +138,20 @@ static void mtouchusb_irq(struct urb *urb, struct pt_regs *regs)
|
|||||||
input_regs(&mtouch->input, regs);
|
input_regs(&mtouch->input, regs);
|
||||||
input_report_key(&mtouch->input, BTN_TOUCH,
|
input_report_key(&mtouch->input, BTN_TOUCH,
|
||||||
MTOUCHUSB_GET_TOUCHED(mtouch->data));
|
MTOUCHUSB_GET_TOUCHED(mtouch->data));
|
||||||
input_report_abs(&mtouch->input, ABS_X,
|
input_report_abs(&mtouch->input, ABS_X, MTOUCHUSB_GET_XC(mtouch->data));
|
||||||
MTOUCHUSB_GET_XC(mtouch->data));
|
|
||||||
input_report_abs(&mtouch->input, ABS_Y,
|
input_report_abs(&mtouch->input, ABS_Y,
|
||||||
(raw_coordinates ? MTOUCHUSB_MAX_RAW_YC : MTOUCHUSB_MAX_CALIB_YC)
|
(raw_coordinates ? MTOUCHUSB_MAX_RAW_YC : MTOUCHUSB_MAX_CALIB_YC)
|
||||||
- MTOUCHUSB_GET_YC(mtouch->data));
|
- MTOUCHUSB_GET_YC(mtouch->data));
|
||||||
input_sync(&mtouch->input);
|
input_sync(&mtouch->input);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
retval = usb_submit_urb (urb, GFP_ATOMIC);
|
retval = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
if (retval)
|
if (retval)
|
||||||
err ("%s - usb_submit_urb failed with result: %d",
|
err("%s - usb_submit_urb failed with result: %d",
|
||||||
__FUNCTION__, retval);
|
__FUNCTION__, retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mtouchusb_open (struct input_dev *input)
|
static int mtouchusb_open(struct input_dev *input)
|
||||||
{
|
{
|
||||||
struct mtouch_usb *mtouch = input->private;
|
struct mtouch_usb *mtouch = input->private;
|
||||||
|
|
||||||
@@ -161,7 +160,7 @@ static int mtouchusb_open (struct input_dev *input)
|
|||||||
|
|
||||||
mtouch->irq->dev = mtouch->udev;
|
mtouch->irq->dev = mtouch->udev;
|
||||||
|
|
||||||
if (usb_submit_urb (mtouch->irq, GFP_ATOMIC)) {
|
if (usb_submit_urb(mtouch->irq, GFP_ATOMIC)) {
|
||||||
mtouch->open--;
|
mtouch->open--;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
@@ -169,12 +168,12 @@ static int mtouchusb_open (struct input_dev *input)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mtouchusb_close (struct input_dev *input)
|
static void mtouchusb_close(struct input_dev *input)
|
||||||
{
|
{
|
||||||
struct mtouch_usb *mtouch = input->private;
|
struct mtouch_usb *mtouch = input->private;
|
||||||
|
|
||||||
if (!--mtouch->open)
|
if (!--mtouch->open)
|
||||||
usb_kill_urb (mtouch->irq);
|
usb_kill_urb(mtouch->irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mtouchusb_alloc_buffers(struct usb_device *udev, struct mtouch_usb *mtouch)
|
static int mtouchusb_alloc_buffers(struct usb_device *udev, struct mtouch_usb *mtouch)
|
||||||
@@ -204,7 +203,7 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
|
|||||||
struct mtouch_usb *mtouch;
|
struct mtouch_usb *mtouch;
|
||||||
struct usb_host_interface *interface;
|
struct usb_host_interface *interface;
|
||||||
struct usb_endpoint_descriptor *endpoint;
|
struct usb_endpoint_descriptor *endpoint;
|
||||||
struct usb_device *udev = interface_to_usbdev (intf);
|
struct usb_device *udev = interface_to_usbdev(intf);
|
||||||
char path[64];
|
char path[64];
|
||||||
int nRet;
|
int nRet;
|
||||||
|
|
||||||
@@ -216,7 +215,7 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
|
|||||||
dbg("%s - setting endpoint", __FUNCTION__);
|
dbg("%s - setting endpoint", __FUNCTION__);
|
||||||
endpoint = &interface->endpoint[0].desc;
|
endpoint = &interface->endpoint[0].desc;
|
||||||
|
|
||||||
if (!(mtouch = kmalloc (sizeof (struct mtouch_usb), GFP_KERNEL))) {
|
if (!(mtouch = kmalloc(sizeof(struct mtouch_usb), GFP_KERNEL))) {
|
||||||
err("%s - Out of memory.", __FUNCTION__);
|
err("%s - Out of memory.", __FUNCTION__);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
@@ -252,12 +251,12 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
|
|||||||
|
|
||||||
/* Used to Scale Compensated Data and Flip Y */
|
/* Used to Scale Compensated Data and Flip Y */
|
||||||
mtouch->input.absmin[ABS_X] = MTOUCHUSB_MIN_XC;
|
mtouch->input.absmin[ABS_X] = MTOUCHUSB_MIN_XC;
|
||||||
mtouch->input.absmax[ABS_X] = raw_coordinates ? \
|
mtouch->input.absmax[ABS_X] = raw_coordinates ?
|
||||||
MTOUCHUSB_MAX_RAW_XC : MTOUCHUSB_MAX_CALIB_XC;
|
MTOUCHUSB_MAX_RAW_XC : MTOUCHUSB_MAX_CALIB_XC;
|
||||||
mtouch->input.absfuzz[ABS_X] = MTOUCHUSB_XC_FUZZ;
|
mtouch->input.absfuzz[ABS_X] = MTOUCHUSB_XC_FUZZ;
|
||||||
mtouch->input.absflat[ABS_X] = MTOUCHUSB_XC_FLAT;
|
mtouch->input.absflat[ABS_X] = MTOUCHUSB_XC_FLAT;
|
||||||
mtouch->input.absmin[ABS_Y] = MTOUCHUSB_MIN_YC;
|
mtouch->input.absmin[ABS_Y] = MTOUCHUSB_MIN_YC;
|
||||||
mtouch->input.absmax[ABS_Y] = raw_coordinates ? \
|
mtouch->input.absmax[ABS_Y] = raw_coordinates ?
|
||||||
MTOUCHUSB_MAX_RAW_YC : MTOUCHUSB_MAX_CALIB_YC;
|
MTOUCHUSB_MAX_RAW_YC : MTOUCHUSB_MAX_CALIB_YC;
|
||||||
mtouch->input.absfuzz[ABS_Y] = MTOUCHUSB_YC_FUZZ;
|
mtouch->input.absfuzz[ABS_Y] = MTOUCHUSB_YC_FUZZ;
|
||||||
mtouch->input.absflat[ABS_Y] = MTOUCHUSB_YC_FLAT;
|
mtouch->input.absflat[ABS_Y] = MTOUCHUSB_YC_FLAT;
|
||||||
@@ -271,15 +270,10 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
|
|||||||
sprintf(mtouch->name, "USB Touchscreen %04x:%04x",
|
sprintf(mtouch->name, "USB Touchscreen %04x:%04x",
|
||||||
mtouch->input.id.vendor, mtouch->input.id.product);
|
mtouch->input.id.vendor, mtouch->input.id.product);
|
||||||
|
|
||||||
nRet = usb_control_msg(mtouch->udev,
|
nRet = usb_control_msg(mtouch->udev, usb_rcvctrlpipe(udev, 0),
|
||||||
usb_rcvctrlpipe(udev, 0),
|
|
||||||
MTOUCHUSB_RESET,
|
MTOUCHUSB_RESET,
|
||||||
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
1,
|
1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
|
||||||
0,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
USB_CTRL_SET_TIMEOUT);
|
|
||||||
dbg("%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d",
|
dbg("%s - usb_control_msg - MTOUCHUSB_RESET - bytes|err: %d",
|
||||||
__FUNCTION__, nRet);
|
__FUNCTION__, nRet);
|
||||||
|
|
||||||
@@ -293,27 +287,18 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
|
|||||||
}
|
}
|
||||||
|
|
||||||
dbg("%s - usb_fill_int_urb", __FUNCTION__);
|
dbg("%s - usb_fill_int_urb", __FUNCTION__);
|
||||||
usb_fill_int_urb(mtouch->irq,
|
usb_fill_int_urb(mtouch->irq, mtouch->udev,
|
||||||
mtouch->udev,
|
|
||||||
usb_rcvintpipe(mtouch->udev, 0x81),
|
usb_rcvintpipe(mtouch->udev, 0x81),
|
||||||
mtouch->data,
|
mtouch->data, MTOUCHUSB_REPORT_DATA_SIZE,
|
||||||
MTOUCHUSB_REPORT_DATA_SIZE,
|
mtouchusb_irq, mtouch, endpoint->bInterval);
|
||||||
mtouchusb_irq,
|
|
||||||
mtouch,
|
|
||||||
endpoint->bInterval);
|
|
||||||
|
|
||||||
dbg("%s - input_register_device", __FUNCTION__);
|
dbg("%s - input_register_device", __FUNCTION__);
|
||||||
input_register_device(&mtouch->input);
|
input_register_device(&mtouch->input);
|
||||||
|
|
||||||
nRet = usb_control_msg(mtouch->udev,
|
nRet = usb_control_msg(mtouch->udev, usb_rcvctrlpipe(udev, 0),
|
||||||
usb_rcvctrlpipe(udev, 0),
|
|
||||||
MTOUCHUSB_ASYNC_REPORT,
|
MTOUCHUSB_ASYNC_REPORT,
|
||||||
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
|
||||||
1,
|
1, 1, NULL, 0, USB_CTRL_SET_TIMEOUT);
|
||||||
1,
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
USB_CTRL_SET_TIMEOUT);
|
|
||||||
dbg("%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d",
|
dbg("%s - usb_control_msg - MTOUCHUSB_ASYNC_REPORT - bytes|err: %d",
|
||||||
__FUNCTION__, nRet);
|
__FUNCTION__, nRet);
|
||||||
|
|
||||||
@@ -325,7 +310,7 @@ static int mtouchusb_probe(struct usb_interface *intf, const struct usb_device_i
|
|||||||
|
|
||||||
static void mtouchusb_disconnect(struct usb_interface *intf)
|
static void mtouchusb_disconnect(struct usb_interface *intf)
|
||||||
{
|
{
|
||||||
struct mtouch_usb *mtouch = usb_get_intfdata (intf);
|
struct mtouch_usb *mtouch = usb_get_intfdata(intf);
|
||||||
|
|
||||||
dbg("%s - called", __FUNCTION__);
|
dbg("%s - called", __FUNCTION__);
|
||||||
usb_set_intfdata(intf, NULL);
|
usb_set_intfdata(intf, NULL);
|
||||||
@@ -339,7 +324,7 @@ static void mtouchusb_disconnect(struct usb_interface *intf)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MODULE_DEVICE_TABLE (usb, mtouchusb_devices);
|
MODULE_DEVICE_TABLE(usb, mtouchusb_devices);
|
||||||
|
|
||||||
static struct usb_driver mtouchusb_driver = {
|
static struct usb_driver mtouchusb_driver = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
@@ -349,12 +334,14 @@ static struct usb_driver mtouchusb_driver = {
|
|||||||
.id_table = mtouchusb_devices,
|
.id_table = mtouchusb_devices,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init mtouchusb_init(void) {
|
static int __init mtouchusb_init(void)
|
||||||
|
{
|
||||||
dbg("%s - called", __FUNCTION__);
|
dbg("%s - called", __FUNCTION__);
|
||||||
return usb_register(&mtouchusb_driver);
|
return usb_register(&mtouchusb_driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __exit mtouchusb_cleanup(void) {
|
static void __exit mtouchusb_cleanup(void)
|
||||||
|
{
|
||||||
dbg("%s - called", __FUNCTION__);
|
dbg("%s - called", __FUNCTION__);
|
||||||
usb_deregister(&mtouchusb_driver);
|
usb_deregister(&mtouchusb_driver);
|
||||||
}
|
}
|
||||||
@@ -362,6 +349,6 @@ static void __exit mtouchusb_cleanup(void) {
|
|||||||
module_init(mtouchusb_init);
|
module_init(mtouchusb_init);
|
||||||
module_exit(mtouchusb_cleanup);
|
module_exit(mtouchusb_cleanup);
|
||||||
|
|
||||||
MODULE_AUTHOR( DRIVER_AUTHOR );
|
MODULE_AUTHOR(DRIVER_AUTHOR);
|
||||||
MODULE_DESCRIPTION( DRIVER_DESC );
|
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
|
|||||||
Reference in New Issue
Block a user