From: jinhyung.jo Date: Thu, 24 Oct 2013 11:19:59 +0000 (+0900) Subject: Sync up with tizen 2.2 X-Git-Tag: 2.2.1_release~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7a489ce75217784c128d208942417a1e0a29de8;p=sdk%2Femulator%2Femulator-kernel.git Sync up with tizen 2.2 Change-Id: Ic2f4801957564061b6f2891b6f414cb3b7033f86 Signed-off-by: Jinhyung Jo --- diff --git a/arch/x86/configs/i386_tizen_emul_defconfig b/arch/x86/configs/i386_tizen_emul_defconfig index 2b774cddc96a..09067ee62a82 100644 --- a/arch/x86/configs/i386_tizen_emul_defconfig +++ b/arch/x86/configs/i386_tizen_emul_defconfig @@ -2780,6 +2780,7 @@ CONFIG_MARU_USB_MASS_STORAGE=y CONFIG_MARU_USB_MODE=y CONFIG_MARU_VIRTIO_KEYBOARD=y CONFIG_MARU_VIRTIO_ESM=y +CONFIG_MARU_BRILL_CODEC=y # # Firmware Drivers diff --git a/drivers/maru/Kconfig b/drivers/maru/Kconfig index 6f959334ea81..21f72ee8159e 100644 --- a/drivers/maru/Kconfig +++ b/drivers/maru/Kconfig @@ -67,3 +67,7 @@ config MARU_VIRTIO_KEYBOARD config MARU_VIRTIO_ESM tristate "MARU VirtIO Emulator Status Medium Driver" depends on MARU != n + +config MARU_BRILL_CODEC + tristate "MARU brillcodec driver" + depends on MARU != n diff --git a/drivers/maru/Makefile b/drivers/maru/Makefile index 01700ce335f9..e482cf0155b4 100644 --- a/drivers/maru/Makefile +++ b/drivers/maru/Makefile @@ -13,3 +13,4 @@ obj-$(CONFIG_MARU_USB_MASS_STORAGE) += maru_usb_mass_storage.o obj-$(CONFIG_MARU_USB_MODE) += maru_usb_mode.o obj-$(CONFIG_MARU_VIRTIO_KEYBOARD) += maru_virtio_keyboard.o obj-$(CONFIG_MARU_VIRTIO_ESM) += maru_virtio_esm.o +obj-$(CONFIG_MARU_BRILL_CODEC) += maru_brill_codec.o diff --git a/drivers/maru/maru_virtio_hwkey.c b/drivers/maru/maru_virtio_hwkey.c index 937f8601f845..479b01023e74 100644 --- a/drivers/maru/maru_virtio_hwkey.c +++ b/drivers/maru/maru_virtio_hwkey.c @@ -44,20 +44,27 @@ MODULE_AUTHOR("Sungmin Ha "); MODULE_DESCRIPTION("Emulator Virtio Hwkey driver"); #define DEVICE_NAME "virtio-hwkey" +#define MAX_BUF_COUNT 64 +static int vqidx = 0; /* This structure must match the qemu definitions */ typedef struct EmulHwkeyEvent { uint8_t event_type; uint32_t keycode; } EmulHwkeyEvent; -static EmulHwkeyEvent *event; typedef struct virtio_hwkey { struct virtio_device *vdev; struct virtqueue *vq; struct input_dev *idev; + + struct scatterlist sg[MAX_BUF_COUNT]; + struct EmulHwkeyEvent vbuf[MAX_BUF_COUNT]; + + struct mutex event_mutex; } virtio_hwkey; + virtio_hwkey *vh; static struct virtio_device_id id_table[] = { @@ -65,10 +72,6 @@ static struct virtio_device_id id_table[] = { { 0 }, }; -#define MAX_BUF_COUNT 10 -static struct scatterlist sg[MAX_BUF_COUNT]; -static EmulHwkeyEvent vbuf[MAX_BUF_COUNT]; - /* keep it consistent with emulator-skin definition */ enum { KEY_PRESSED = 1, @@ -76,36 +79,28 @@ enum { }; static int err = 0; -static unsigned int len = 0; /* not used */ static unsigned int index = 0; -static unsigned int recv_index = 0; /** * @brief : callback for virtqueue */ static void vq_hwkey_callback(struct virtqueue *vq) { + struct EmulHwkeyEvent hwkey_event; #if 0 printk(KERN_INFO "vq hwkey callback\n"); #endif - - recv_index = (unsigned int)virtqueue_get_buf(vh->vq, &len); - if (recv_index == 0) { - printk(KERN_ERR "failed to get buffer\n"); - return; - } - - do { - event = &vbuf[recv_index - 1]; -#if 0 - printk(KERN_INFO "hwkey event_type=%d, keycodey=%d, recv_index=%d\n", - event->event_type, event->keycode, recv_index); -#endif - if (event->event_type == KEY_PRESSED) { /* pressed */ - input_event(vh->idev, EV_KEY, event->keycode, true); + while (1) { + memcpy(&hwkey_event, &vh->vbuf[vqidx], sizeof(hwkey_event)); + if (hwkey_event.event_type == 0) { + break; } - else if (event->event_type == KEY_RELEASED) { /* released */ - input_event(vh->idev, EV_KEY, event->keycode, false); + printk(KERN_ERR "keycode: %d, event_type: %d, vqidx: %d\n", hwkey_event.keycode, hwkey_event.event_type, vqidx); + if (hwkey_event.event_type == KEY_PRESSED) { + input_event(vh->idev, EV_KEY, hwkey_event.keycode, true); + } + else if (hwkey_event.event_type == KEY_RELEASED) { + input_event(vh->idev, EV_KEY, hwkey_event.keycode, false); } else { printk(KERN_ERR "Unknown event type\n"); @@ -113,20 +108,12 @@ static void vq_hwkey_callback(struct virtqueue *vq) } input_sync(vh->idev); - - /* expose buffer to other end */ - err = virtqueue_add_buf(vh->vq, sg, 0, - recv_index, (void *)recv_index, GFP_ATOMIC); - - if (err < 0) { - printk(KERN_ERR "failed to add buffer!\n"); - } - - recv_index = (unsigned int)virtqueue_get_buf(vh->vq, &len); - if (recv_index == 0) { - break; + memset(&vh->vbuf[vqidx], 0x00, sizeof(hwkey_event)); + vqidx++; + if (vqidx == MAX_BUF_COUNT) { + vqidx = 0; } - } while(true); + } virtqueue_kick(vh->vq); } @@ -163,6 +150,7 @@ struct file_operations virtio_hwkey_fops = { static int virtio_hwkey_probe(struct virtio_device *vdev) { int ret = 0; + vqidx = 0; printk(KERN_INFO "virtio hwkey driver is probed\n"); @@ -171,11 +159,11 @@ static int virtio_hwkey_probe(struct virtio_device *vdev) if (!vh) { return -ENOMEM; } + memset(&vh->vbuf, 0x00, sizeof(vh->vbuf)); vh->vdev = vdev; - vh->vq = virtio_find_single_vq(vh->vdev, - vq_hwkey_callback, "virtio-hwkey-vq"); + vh->vq = virtio_find_single_vq(vh->vdev, vq_hwkey_callback, "virtio-hwkey-vq"); if (IS_ERR(vh->vq)) { ret = PTR_ERR(vh->vq); @@ -187,14 +175,11 @@ static int virtio_hwkey_probe(struct virtio_device *vdev) /* enable callback */ virtqueue_enable_cb(vh->vq); - sg_init_table(sg, MAX_BUF_COUNT); + sg_init_table(vh->sg, MAX_BUF_COUNT); /* prepare the buffers */ for (index = 0; index < MAX_BUF_COUNT; index++) { - sg_set_buf(&sg[index], &vbuf[index], sizeof(EmulHwkeyEvent)); - - err = virtqueue_add_buf(vh->vq, sg, 0, - index + 1, (void *)index + 1, GFP_ATOMIC); + sg_set_buf(&vh->sg[index], &vh->vbuf[index], sizeof(EmulHwkeyEvent)); if (err < 0) { printk(KERN_ERR "failed to add buffer\n"); @@ -205,6 +190,9 @@ static int virtio_hwkey_probe(struct virtio_device *vdev) } } + err = virtqueue_add_buf(vh->vq, vh->sg, 0, + MAX_BUF_COUNT, (void *)MAX_BUF_COUNT, GFP_ATOMIC); + /* register for input device */ vh->idev = input_allocate_device(); if (!vh->idev) { diff --git a/drivers/maru/maru_virtio_touchscreen.c b/drivers/maru/maru_virtio_touchscreen.c index 07656fa346f6..100298cbb4eb 100644 --- a/drivers/maru/maru_virtio_touchscreen.c +++ b/drivers/maru/maru_virtio_touchscreen.c @@ -67,20 +67,20 @@ typedef struct virtio_touchscreen virtio_touchscreen *vt; -#define MAX_TRKID 6 +#define MAX_TRKID 10 #define TOUCHSCREEN_RESOLUTION_X 5040 #define TOUCHSCREEN_RESOLUTION_Y 3780 #define ABS_PRESSURE_MAX 255 +#define MAX_BUF_COUNT MAX_TRKID +struct scatterlist sg[MAX_BUF_COUNT]; +EmulTouchEvent vbuf[MAX_BUF_COUNT]; + static struct virtio_device_id id_table[] = { { VIRTIO_ID_TOUCHSCREEN, VIRTIO_DEV_ANY_ID }, { 0 }, }; -#define MAX_BUF_COUNT 10 -struct scatterlist sg[MAX_BUF_COUNT]; -EmulTouchEvent vbuf[MAX_BUF_COUNT]; - #if 0 /** @@ -192,6 +192,7 @@ static void vq_touchscreen_callback(struct virtqueue *vq) do { event = &vbuf[recv_index - 1]; + #if 0 printk(KERN_INFO "touch x=%d, y=%d, z=%d, state=%d, recv_index=%d\n", event->x, event->y, event->z, event->state, recv_index); diff --git a/package/changelog b/package/changelog index c787674bf2c2..1ce050580092 100644 --- a/package/changelog +++ b/package/changelog @@ -1,6 +1,27 @@ +* 1.4.28 +- added flush buffer routine. +== Kitae Kim 2013-10-18 +* 1.4.27 +- increase the MT slot size +== GiWoong Kim 2013-09-24 +* 1.4.26 +- added brillcodec driver. +== Kitae Kim 2013-09-16 +* 1.4.25 +- applied Smack 'L'mode patch. +== Kitae Kim 2013-07-28 +* 1.4.24 +- modified structure of virtio-hwkey +== Sungmin Ha 2013-07-25 +* 1.4.23 +- fixed one of Smack bugs which is about IP packet access check. +== Kitae Kim 2013-06-28 * 1.4.22 - applied smack patches == Kitae Kim 2013-05-28 +* 1.4.21 +- added initializing vqidx when the host keyboard is turned on. +== Sungmin Ha 2013-05-21 * 1.4.19 - modified process of using virtio keyboard queue == Sungmin Ha 2013-05-14 diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 9e76928681ba..e3b88f9e7469 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,4 +1,4 @@ -Version: 1.4.22 +Version: 1.4.28 Maintainer: Yeong-Kyoon, Lee Source: emulator-kernel