diff options
| author | Vojtech Pavlik <vojtech@twilight.ucw.cz> | 2002-07-25 17:56:28 +0200 |
|---|---|---|
| committer | Vojtech Pavlik <vojtech@twilight.ucw.cz> | 2002-07-25 17:56:28 +0200 |
| commit | 2f39a6688e2e8d4f5fc12487a900b7cd2fc603b4 (patch) | |
| tree | e253ae74e8f5d4207ad6157236d3659e81e94a6b /drivers/usb/input | |
| parent | 252efaf31b375a8b8870ffeee51b2fd1a7dd5d89 (diff) | |
By popular request, and explicit method of telling which events
from a device belong together was implemented - input_sync() and
EV_SYN. Touches every input driver. The first to make use of it
is mousedev.c to properly merge events into PS/2 packets.
Diffstat (limited to 'drivers/usb/input')
| -rw-r--r-- | drivers/usb/input/aiptek.c | 2 | ||||
| -rw-r--r-- | drivers/usb/input/hid-core.c | 3 | ||||
| -rw-r--r-- | drivers/usb/input/hid-input.c | 5 | ||||
| -rw-r--r-- | drivers/usb/input/hid.h | 2 | ||||
| -rw-r--r-- | drivers/usb/input/powermate.c | 1 | ||||
| -rw-r--r-- | drivers/usb/input/usbkbd.c | 4 | ||||
| -rw-r--r-- | drivers/usb/input/usbmouse.c | 4 | ||||
| -rw-r--r-- | drivers/usb/input/wacom.c | 5 | ||||
| -rw-r--r-- | drivers/usb/input/xpad.c | 2 |
9 files changed, 26 insertions, 2 deletions
diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c index f869b223116d..48d5e86b268d 100644 --- a/drivers/usb/input/aiptek.c +++ b/drivers/usb/input/aiptek.c @@ -161,6 +161,8 @@ aiptek_irq(struct urb *urb) input_report_key(dev, BTN_STYLUS2, data[5] & 0x10); } + input_sync(dev); + } struct aiptek_features aiptek_features[] = { diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 19b6ff130baf..8c941083376c 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c @@ -903,6 +903,9 @@ static int hid_input_report(int type, struct urb *urb) for (n = 0; n < report->maxfield; n++) hid_input_field(hid, report->field[n], data); + if (hid->claimed & HID_CLAIMED_INPUT) + hidinput_report_event(hid, report); + return 0; } diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c index 4ffdec218fd5..9090b577643f 100644 --- a/drivers/usb/input/hid-input.c +++ b/drivers/usb/input/hid-input.c @@ -428,6 +428,11 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct input_event(input, usage->type, usage->code, 0); } +void hidinput_report_event(struct hid_device *hid, struct hid_report *report) +{ + input_sync(&hid->input); +} + static int hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) { struct hid_device *hid = dev->private; diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h index 93075dee2db7..566232f6415f 100644 --- a/drivers/usb/input/hid.h +++ b/drivers/usb/input/hid.h @@ -416,11 +416,13 @@ struct hid_descriptor { /* We ignore a few input applications that are not widely used */ #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || ( a == 0x00010080) || ( a == 0x000c0001)) extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); +extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); extern int hidinput_connect(struct hid_device *); extern void hidinput_disconnect(struct hid_device *); #else #define IS_INPUT_APPLICATION(a) (0) static inline void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) { } +static inline void hidinput_report_event(struct hid_device *hid, struct hid_report *report) { } static inline int hidinput_connect(struct hid_device *hid) { return -ENODEV; } static inline void hidinput_disconnect(struct hid_device *hid) { } #endif diff --git a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c index 79dcc55c7717..e24862884e53 100644 --- a/drivers/usb/input/powermate.c +++ b/drivers/usb/input/powermate.c @@ -83,6 +83,7 @@ static void powermate_irq(struct urb *urb) /* handle updates to device state */ input_report_key(&pm->input, BTN_0, pm->data[0] & 0x01); input_report_rel(&pm->input, REL_DIAL, pm->data[1]); + input_sync(&pm->input); } /* Decide if we need to issue a control message and do so. Must be called with pm->lock down */ diff --git a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c index bf42555c0d18..dccb13bd811a 100644 --- a/drivers/usb/input/usbkbd.c +++ b/drivers/usb/input/usbkbd.c @@ -104,6 +104,8 @@ static void usb_kbd_irq(struct urb *urb) } } + input_sync(&kbd->dev); + memcpy(kbd->old, kbd->new, 8); } @@ -236,7 +238,7 @@ static void *usb_kbd_probe(struct usb_device *dev, unsigned int ifnum, kbd->dev.name = kbd->name; kbd->dev.phys = kbd->phys; - kbd->dev.id.bus = BUS_USB; + kbd->dev.id.bustype = BUS_USB; kbd->dev.id.vendor = dev->descriptor.idVendor; kbd->dev.id.product = dev->descriptor.idProduct; kbd->dev.id.version = dev->descriptor.bcdDevice; diff --git a/drivers/usb/input/usbmouse.c b/drivers/usb/input/usbmouse.c index 37da58d9ad65..c72e498ee7a5 100644 --- a/drivers/usb/input/usbmouse.c +++ b/drivers/usb/input/usbmouse.c @@ -72,6 +72,8 @@ static void usb_mouse_irq(struct urb *urb) input_report_rel(dev, REL_X, data[1]); input_report_rel(dev, REL_Y, data[2]); input_report_rel(dev, REL_WHEEL, data[3]); + + input_sync(dev); } static int usb_mouse_open(struct input_dev *dev) @@ -145,7 +147,7 @@ static void *usb_mouse_probe(struct usb_device *dev, unsigned int ifnum, mouse->dev.name = mouse->name; mouse->dev.phys = mouse->phys; - mouse->dev.id.bus = BUS_USB; + mouse->dev.id.bustype = BUS_USB; mouse->dev.id.vendor = dev->descriptor.idVendor; mouse->dev.id.product = dev->descriptor.idProduct; mouse->dev.id.version = dev->descriptor.bcdDevice; diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c index 2fdac6221282..e4a3b59f5668 100644 --- a/drivers/usb/input/wacom.c +++ b/drivers/usb/input/wacom.c @@ -136,6 +136,7 @@ static void wacom_pl_irq(struct urb *urb) } input_event(dev, EV_MSC, MSC_SERIAL, 0); + input_sync(dev); } static void wacom_graphire_irq(struct urb *urb) @@ -189,6 +190,8 @@ static void wacom_graphire_irq(struct urb *urb) input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); input_event(dev, EV_MSC, MSC_SERIAL, data[1] & 0x01); + + input_sync(dev); } static void wacom_intuos_irq(struct urb *urb) @@ -291,6 +294,8 @@ static void wacom_intuos_irq(struct urb *urb) } input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); + + input_sync(dev); } #define WACOM_INTUOS_TOOLS (BIT(BTN_TOOL_BRUSH) | BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS)) diff --git a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c index b7651315df08..445741a489ba 100644 --- a/drivers/usb/input/xpad.c +++ b/drivers/usb/input/xpad.c @@ -158,6 +158,8 @@ static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *d /* "analog" buttons black, white */ input_report_key(dev, BTN_C, data[8]); input_report_key(dev, BTN_Z, data[9]); + + input_sync(dev); } static void xpad_irq_in(struct urb *urb) |
