aboutsummaryrefslogtreecommitdiff
path: root/hw/hid.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2011-07-15 15:52:33 +0200
committerGerd Hoffmann <kraxel@redhat.com>2011-08-04 15:51:51 +0200
commitb069d3488f327da97fb0da1939518a00637f01a3 (patch)
tree36f5a720c2d2675e9dcc5816d79b6d6e93d0a7f2 /hw/hid.c
parentdcfda673101313472524bfac8c2fe2e1d03c8214 (diff)
downloadqemu-b069d3488f327da97fb0da1939518a00637f01a3.zip
qemu-b069d3488f327da97fb0da1939518a00637f01a3.tar.gz
qemu-b069d3488f327da97fb0da1939518a00637f01a3.tar.bz2
hid: move idle+protocol from usb-hid to hid too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/hid.c')
-rw-r--r--hw/hid.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/hid.c b/hw/hid.c
index 1893ae5..7b5ef5f 100644
--- a/hw/hid.c
+++ b/hw/hid.c
@@ -24,6 +24,7 @@
*/
#include "hw.h"
#include "console.h"
+#include "qemu-timer.h"
#include "hid.h"
#define HID_USAGE_ERROR_ROLLOVER 0x01
@@ -73,6 +74,11 @@ bool hid_has_events(HIDState *hs)
return hs->n > 0;
}
+void hid_set_next_idle(HIDState *hs, int64_t curtime)
+{
+ hs->next_idle_clock = curtime + (get_ticks_per_sec() * hs->idle * 4) / 1000;
+}
+
static void hid_pointer_event_clear(HIDPointerEvent *e, int buttons)
{
e->xdx = e->ydy = e->dz = 0;
@@ -365,6 +371,8 @@ void hid_reset(HIDState *hs)
}
hs->head = 0;
hs->n = 0;
+ hs->protocol = 1;
+ hs->idle = 0;
}
void hid_free(HIDState *hs)