dde_linux: HID multitouch support

Fixes #1209
This commit is contained in:
Christian Menard 2014-07-11 18:08:59 +04:00 committed by Norman Feske
parent 2da020b688
commit ad2cd4b328
7 changed files with 47 additions and 17 deletions

View File

@ -38,6 +38,7 @@ linux-3.9/arch/arm/plat-samsung/include/plat/usb-phy.h
linux-3.9/drivers/hid/hid-cherry.c
linux-3.9/drivers/hid/hid-core.c
linux-3.9/drivers/hid/hid-generic.c
linux-3.9/drivers/hid/hid-multitouch.c
linux-3.9/drivers/hid/hid-ids.h
linux-3.9/drivers/hid/hid-input.c
linux-3.9/drivers/hid/usbhid/hid-core.c
@ -51,6 +52,7 @@ linux-3.9/drivers/hid/usbhid/usbkbd.c
linux-3.9/drivers/hid/usbhid/usbmouse.c
linux-3.9/drivers/input/evdev.c
linux-3.9/drivers/input/input.c
linux-3.9/drivers/input/input-mt.c
linux-3.9/drivers/input/input-compat.h
linux-3.9/drivers/net/usb/asix_common.c
linux-3.9/drivers/net/usb/asix_devices.c

View File

@ -43,8 +43,8 @@ SRC_C += $(addprefix usb/host/, ehci-hcd.c)
# USB hid
SRC_C += $(addprefix hid/usbhid/, hid-core.c hid-quirks.c)
SRC_C += $(addprefix hid/, hid-core.c hid-generic.c hid-input.c hid-cherry.c)
SRC_C += $(addprefix input/, evdev.c input.c)
SRC_C += $(addprefix hid/, hid-core.c hid-generic.c hid-input.c hid-cherry.c hid-multitouch.c)
SRC_C += $(addprefix input/, evdev.c input.c input-mt.c)
# USB storage
SRC_C += $(addprefix usb/storage/,scsiglue.c protocol.c transport.c usb.c \

View File

@ -1 +1 @@
b396829fbc0af030d9ad632d79ad3f53389d43f2
e407a48e201bda19915373eef0d114933c1e4223

View File

@ -6,6 +6,7 @@
*/
/*
* Copyright (C) 2014 Ksys Labs LLC
* Copyright (C) 2011-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
@ -56,6 +57,7 @@ long PTR_ERR(const void *ptr) { TRACE; return 0; }
void might_sleep() { SKIP; }
char *kasprintf(gfp_t gfp, const char *fmt, ...) { TRACE; return NULL; }
int kstrtouint(const char *s, unsigned int base, unsigned int *res) { TRACE; return 0; }
int kstrtoul(const char *s, unsigned int base, unsigned long *res) { TRACE; return 0; }
int sprintf(char *buf, const char *fmt, ...) { TRACE; return 0; }
int sscanf(const char *b, const char *s, ...) { TRACE; return 0; }
int scnprintf(char *buf, size_t size, const char *fmt, ...);
@ -751,12 +753,6 @@ int input_event_from_user(const char __user *buffer, struct input_event *event)
int input_event_to_user(char __user *buffer, const struct input_event *event) { TRACE; return 0; }
int input_ff_effect_from_user(const char __user *buffer, size_t size, struct ff_effect *effect) { TRACE; return 0;}
/****************
** linux/mt.h **
****************/
void input_mt_destroy_slots(struct input_dev *dev) { TRACE; }
/*********************
** linux/vmalloc.h **

View File

@ -587,6 +587,7 @@ void might_sleep();
char *kasprintf(gfp_t gfp, const char *fmt, ...);
int kstrtouint(const char *s, unsigned int base, unsigned int *res);
int kstrtoul(const char *s, unsigned int base, unsigned long *res);
#define clamp(val, min, max) ({ \
typeof(val) __val = (val); \

View File

@ -1,8 +1,9 @@
/*
* \brief Input service and event handler
* \author Christian Helmuth
* \author Dirk Vogt <dvogt@os.inf.tu-dresden.de>
* \author Sebastian Sumpf <sebastian.sumpf@genode-labs.com>
* \author Dirk Vogt <dvogt@os.inf.tu-dresden.de>
* \author Sebastian Sumpf <sebastian.sumpf@genode-labs.com>
* \author Christian Menard <christian.menard@ksyslabs.org>
* \date 2009-04-20
*
* The original implementation was in the L4Env from the TUD:OS group
@ -11,7 +12,8 @@
*/
/*
* Copyright (C) 2009-2013 Genode Labs GmbH
* Copyright (C) 2009-2014 Genode Labs GmbH
* Copyright (C) 2014 Ksys Labs LLC
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -33,6 +35,8 @@ void genode_evdev_event(struct input_handle *handle, unsigned int type,
static unsigned long count = 0;
#endif
static int last_ax = -1; /* store the last absolute x value */
/* filter sound events */
if (test_bit(EV_SND, handle->dev->evbit)) return;
@ -51,6 +55,11 @@ void genode_evdev_event(struct input_handle *handle, unsigned int type,
case EV_KEY:
arg_keycode = code;
/* map BTN_TOUCH events to BTN_LEFT */
if (code == BTN_TOUCH)
arg_keycode = BTN_LEFT;
switch (value) {
case 0:
@ -71,16 +80,34 @@ void genode_evdev_event(struct input_handle *handle, unsigned int type,
switch (code) {
case ABS_X:
arg_type = EVENT_TYPE_MOTION;
arg_ax = value;
break;
case ABS_MT_POSITION_X:
/*
* Don't create an input event yet. Store the value and wait for the
* subsequent Y event.
*/
last_ax = value;
return;
case ABS_Y:
case ABS_MT_POSITION_Y:
/*
* Create a unified input event with absolute positions on x and y
* axis.
*/
arg_type = EVENT_TYPE_MOTION;
arg_ay = value;
arg_ax = last_ax;
last_ax = -1;
if (arg_ax == -1) {
printk("Ignore absolute Y event without a preceeding X event\n");
return;
}
break;
case ABS_WHEEL:
/*
* XXX I do not know, how to handle this correctly. At least, this
* scheme works on Qemu.

View File

@ -1,12 +1,14 @@
/*
* \brief USB driver main program
* \author Norman Feske
* \author Sebastian Sumpf <sebastian.sumpf@genode-labs.com>
* \author Sebastian Sumpf <sebastian.sumpf@genode-labs.com>
* \author Christian Menard <christian.menard@ksyslabs.org>
* \date 2012-01-29
*/
/*
* Copyright (C) 2012-2013 Genode Labs GmbH
* Copyright (C) 2012-2014 Genode Labs GmbH
* Copyright (C) 2014 Ksys Labs LLC
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
@ -38,6 +40,7 @@ extern "C" void module_hid_init_core();
extern "C" void module_hid_generic_init();
extern "C" void module_usb_stor_init();
extern "C" void module_ch_driver_init();
extern "C" void module_mt_driver_init();
extern "C" void start_input_service(void *ep);
@ -67,6 +70,7 @@ static void init(Services *services)
module_hid_init();
module_hid_generic_init();
module_ch_driver_init();
module_mt_driver_init();
}
/* host controller */