Sync up with tizen 2.2
authorjinhyung.jo <jinhyung.jo@samsung.com>
Thu, 24 Oct 2013 11:19:59 +0000 (20:19 +0900)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Thu, 24 Oct 2013 11:19:59 +0000 (20:19 +0900)
Change-Id: Ic2f4801957564061b6f2891b6f414cb3b7033f86
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
arch/x86/configs/i386_tizen_emul_defconfig
drivers/maru/Kconfig
drivers/maru/Makefile
drivers/maru/maru_virtio_hwkey.c
drivers/maru/maru_virtio_touchscreen.c
package/changelog
package/pkginfo.manifest

index 2b774cddc96a7eff0ed135acb4ea3109eae21a33..09067ee62a827ded2dec30db33fbfcf5ab9664c2 100644 (file)
@@ -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
index 6f959334ea812eaab56e81154d353ed68e98b003..21f72ee8159e0c9a5741c2900c9e5da81708d8a6 100644 (file)
@@ -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
index 01700ce335f9f837f545f3e03b5ffa282d314839..e482cf0155b4bbe4cedafeb4fac8afab2df6a0ad 100644 (file)
@@ -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
index 937f8601f845dc97c8ca20aede976c8535fc442b..479b01023e74a91ad60324a53d747ab8bb333288 100644 (file)
@@ -44,20 +44,27 @@ MODULE_AUTHOR("Sungmin Ha <sungmin82.ha@samsung.com>");
 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) {
index 07656fa346f6649adefab1be2a87e9e9b83dea4f..100298cbb4eb7cd2fcc7137fa1a1132d058ea4a0 100644 (file)
@@ -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);
index c787674bf2c21206c297b78454fa68f88894a76e..1ce050580092efcd096a306f751d3bc404c39e81 100644 (file)
@@ -1,6 +1,27 @@
+* 1.4.28
+- added flush buffer routine. 
+== Kitae Kim <kt920.kim@samsung.com> 2013-10-18
+* 1.4.27
+- increase the MT slot size
+== GiWoong Kim <giwoong.kim@samsung.com> 2013-09-24
+* 1.4.26
+- added brillcodec driver. 
+== Kitae Kim <kt920.kim@samsung.com> 2013-09-16
+* 1.4.25
+- applied Smack 'L'mode patch.
+== Kitae Kim <kt920.kim@samsung.com> 2013-07-28
+* 1.4.24
+- modified structure of virtio-hwkey
+== Sungmin Ha <sungmin82.ha@samsung.com> 2013-07-25
+* 1.4.23
+- fixed one of Smack bugs which is about IP packet access check.
+== Kitae Kim <kt920.kim@samsung.com> 2013-06-28
 * 1.4.22
 - applied smack patches
 == Kitae Kim <kt920.kim@samsung.com> 2013-05-28
+* 1.4.21
+- added initializing vqidx when the host keyboard is turned on.
+== Sungmin Ha <sungmin82.ha@samsung.com> 2013-05-21
 * 1.4.19
 - modified process of using virtio keyboard queue
 == Sungmin Ha <sungmin82.ha@samsung.com> 2013-05-14
index 9e76928681ba2d0e053c793c1f59172a71caa6ae..e3b88f9e746977e23427199ee9fc8bbfefbed5c7 100644 (file)
@@ -1,4 +1,4 @@
-Version: 1.4.22
+Version: 1.4.28
 Maintainer: Yeong-Kyoon, Lee <yeongkyoon.lee@samsung.com>
 Source: emulator-kernel