CONFIG_MARU_CODEC=y
CONFIG_MARU_TOUCHSCREEN=y
CONFIG_MARU_VIRTIO_TOUCHSCREEN=y
+CONFIG_MARU_VIRTIO_HWKEY=y
CONFIG_MARU_FB=y
CONFIG_MARU_CAMERA=y
CONFIG_MARU_BACKLIGHT=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
-# CONFIG_EXT4_FS is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_USE_FOR_EXT23=y
+CONFIG_EXT4_FS_XATTR=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
+# CONFIG_EXT4_DEBUG is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
CONFIG_GENERIC_IOMAP=y
CONFIG_GENERIC_IO=y
# CONFIG_CRC_CCITT is not set
-# CONFIG_CRC16 is not set
+CONFIG_CRC16=y
CONFIG_CRC_T10DIF=y
# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
* Copyright (c) 2009 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
+ * DongKyun Yun <dk77.yun@samsung.com>
* YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
#include <linux/module.h>
#include <linux/moduleparam.h>
+#include <linux/types.h>
#include <linux/kernel.h> /* printk(), min() */
#include <linux/slab.h> /* kmalloc() */
#include <linux/fs.h> /* everything... */
#include <linux/fcntl.h>
#include <linux/poll.h>
#include <linux/cdev.h>
+#include <linux/device.h>
#include <linux/sched.h>
#include <asm/uaccess.h>
static struct vdpram_dev *vdpram_devices;
static struct buffer_t *buffer;
static struct queue_t *queue;
+static struct class *vdpram_class;
static int vdpram_fasync(int fd, struct file *filp, int mode);
static int spacefree(struct vdpram_dev *dev);
*/
static void vdpram_setup_cdev(struct vdpram_dev *dev, int index)
{
- int err, devno = vdpram_devno + index;
-
- if (index % 2 ==0) {
- dev->flag = 1;
- cdev_init(&dev->cdev, &vdpram_even_fops);
- dev->cdev.owner = THIS_MODULE;
- err = cdev_add (&dev->cdev, devno, 1);
- dev->index = index;
- }
- else {
- dev->flag = 0;
- cdev_init(&dev->cdev, &vdpram_odd_fops);
- dev->cdev.owner = THIS_MODULE;
- err = cdev_add (&dev->cdev, devno, 1);
- dev->index = index;
- }
+ dev_t node = MKDEV(vdpram_major, index);
+ int err;
+ int is_odd = index & 1; // "index % 2" equivalent
+
+ dev->flag = !is_odd;
+ cdev_init(&dev->cdev, is_odd ? &vdpram_odd_fops : &vdpram_even_fops);
+ dev->cdev.owner = THIS_MODULE;
+ err = cdev_add (&dev->cdev, node, 1);
+ dev->index = index;
/* Fail gracefully if need be */
if (err)
- printk(KERN_NOTICE "Error %d adding deive%d\n", err, index);
+ printk(KERN_NOTICE "Error %d adding device%d\n", err, index);
}
-
+static char *vdpram_devnode(struct device *dev, umode_t *mode)
+{
+ return kasprintf(GFP_KERNEL, "%s", dev_name(dev));
+}
/* Initialize the devs; return how many we did */
int vdpram_init(void)
{
int i, result;
-// dev_t dev;
dev_t dev = MKDEV(vdpram_major, 0);
printk("Initializing vdpram device driver ...\n");
result = register_chrdev_region(dev, vdpram_nr_devs, "vdpram");
-// result = alloc_chrdev_region(&dev, 0, vdpram_nr_devs, "vdpram");
if (result < 0) {
printk("Unable to get vdpram region, error %d\n", result);
- return 0;
+ goto err_out;
}
-// vdpram_major = MAJOR( dev );
- printk( " vdpram device major num = %d \n", vdpram_major );
+
+ printk("vdpram device major num = %d \n", vdpram_major);
vdpram_devno = dev;
+
vdpram_devices = kmalloc(vdpram_nr_devs * sizeof(struct vdpram_dev), GFP_KERNEL);
- if (vdpram_devices == NULL) {
- unregister_chrdev_region(dev, vdpram_nr_devs);
- return 0;
+ buffer = kmalloc(vdpram_nr_devs * sizeof(struct buffer_t), GFP_KERNEL);
+ queue = kmalloc(vdpram_nr_devs * sizeof(struct queue_t), GFP_KERNEL);
+ if (!vdpram_devices || !buffer || !queue) {
+ result = -ENOMEM;
+ goto err_alloc;
+ }
+
+ vdpram_class = class_create(THIS_MODULE, "vdpram");
+ if (IS_ERR(vdpram_class)) {
+ result = PTR_ERR(vdpram_class);
+ goto err_alloc;
}
+ vdpram_class->devnode = vdpram_devnode;
+
memset(vdpram_devices, 0, vdpram_nr_devs * sizeof(struct vdpram_dev));
for (i = 0; i < vdpram_nr_devs; i++) {
if (i% 2 ==1) {
vdpram_setup_cdev(vdpram_devices + i, i);
}
- buffer = kmalloc(vdpram_nr_devs * sizeof(struct buffer_t) , GFP_KERNEL);
memset(buffer, 0, vdpram_nr_devs * sizeof(struct buffer_t));
- queue = kmalloc(vdpram_nr_devs * sizeof(struct queue_t) , GFP_KERNEL);
// hwjang fix buffer -> queue
memset(queue, 0, vdpram_nr_devs * sizeof(struct queue_t));
for (i = 0; i < vdpram_nr_devs; i++) {
//printk("%s buffer[%x].begin =%x\n", __FUNCTION__, i, buffer[i].begin );
//printk("%s buffer[%x].buffersize =%x\n", __FUNCTION__, i, buffer[i].buffersize );
//printk("%s buffer[%x].end =%x\n", __FUNCTION__, i, buffer[i].end );
- }
+ }
+
+ for (i = 0; i < vdpram_nr_devs; i++)
+ device_create(vdpram_class, NULL, MKDEV(vdpram_major, i), NULL,
+ kasprintf(GFP_KERNEL, "vdpram%d", i));
return 0;
+
+err_alloc:
+ kfree(vdpram_devices);
+ kfree(buffer);
+ kfree(queue);
+
+ unregister_chrdev_region(dev, vdpram_nr_devs);
+
+err_out:
+ return result;
}
/*
return; /* nothing else to release */
for (i = 0; i < vdpram_nr_devs; i++) {
+ device_destroy(vdpram_class, MKDEV(vdpram_major, i));
cdev_del(&vdpram_devices[i].cdev);
}
+ class_destroy(vdpram_class);
kfree(vdpram_devices);
for (i= 0;i < vdpram_nr_devs ; i++) {
return 0;\r
}\r
\r
-// FIX ME : fsync parameter 2,3 parameter missing\r
-static int glmem_fsync(struct file *filp, int datasync)\r
+static int glmem_fsync(struct file *filp, loff_t start, loff_t end, int datasync)\r
{\r
struct virtio_gl_data *gldata = to_virtio_gl_data(filp);\r
\r
tristate "MARU Virtio Touchscreen Driver"
depends on MARU != n
+config MARU_VIRTIO_HWKEY
+ tristate "MARU Virtio Hwkey Driver"
+ depends on MARU != n
+
config MARU_FB
tristate "MARU framebuffer driver"
depends on MARU != n
obj-$(CONFIG_MARU_CODEC) += maru_codec.o
obj-$(CONFIG_MARU_TOUCHSCREEN) += maru_usb_touchscreen.o
obj-$(CONFIG_MARU_VIRTIO_TOUCHSCREEN) += maru_virtio_touchscreen.o
+obj-$(CONFIG_MARU_VIRTIO_HWKEY) += maru_virtio_hwkey.o
obj-$(CONFIG_MARU_FB) += maru_fb.o
obj-$(CONFIG_MARU_CAMERA) += maru_camera.o
obj-$(CONFIG_MARU_BACKLIGHT) += maru_bl.o
/*
* MARU Virtual Backlight Driver
*
- * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
* Jinhyung Jo <jinhyung.jo@samsung.com>
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
*
* Contributors:
* - S-Core Co., Ltd
#include <linux/fb.h>
#include <linux/backlight.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
-#define MARUBL_DRIVER_NAME "svb"
-#define PCI_DEVICE_ID_VIRTUAL_BRIGHTNESS 0x1014
+#define MARUBL_DRIVER_NAME "maru_backlight"
-static struct pci_device_id marubl_pci_table[] __devinitdata =
-{
+#define MIN_BRIGHTNESS 0
+#define MAX_BRIGHTNESS 100
+
+static struct pci_device_id marubl_pci_table[] __devinitdata = {
{
.vendor = PCI_VENDOR_ID_TIZEN,
- .device = PCI_DEVICE_ID_VIRTUAL_BRIGHTNESS,
+ .device = PCI_DEVICE_ID_VIRTUAL_BRIGHTNESS,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
},
/* MARU virtual brightness(backlight) device structure */
struct marubl {
- struct backlight_device *bl_dev;
- unsigned int brightness;
- resource_size_t reg_start, reg_size;
- unsigned char __iomem *marubl_mmreg; /* marubl: memory mapped registers */
+ struct backlight_device *bl_dev;
+ unsigned int brightness;
+ resource_size_t reg_start, reg_size;
+ /* memory mapped registers */
+ unsigned char __iomem *marubl_mmreg;
};
-/* ============================================================================== */
+/* ========================================================================== */
static struct marubl *marubl_device;
-/* ============================================================================== */
+/* ========================================================================== */
-static int min_brightness = 0;
-static int max_brightness = 100;
+static int min_brightness = MIN_BRIGHTNESS;
+static int max_brightness = MAX_BRIGHTNESS;
static int marubl_get_intensity(struct backlight_device *bd)
{
return 0;
}
-static struct backlight_ops marubl_ops = {
- .options = BL_CORE_SUSPENDRESUME,
- .get_brightness = marubl_get_intensity,
- .update_status = marubl_send_intensity,
+static const struct backlight_ops marubl_ops = {
+ .options = BL_CORE_SUSPENDRESUME,
+ .get_brightness = marubl_get_intensity,
+ .update_status = marubl_send_intensity,
};
/* pci probe function
*/
static int __devinit marubl_probe(struct pci_dev *pci_dev,
- const struct pci_device_id *ent)
+ const struct pci_device_id *ent)
{
int ret;
struct backlight_device *bd;
}
ret = -EIO;
-
+
/* 1 : IORESOURCE_MEM */
marubl_device->reg_start = pci_resource_start(pci_dev, 1);
marubl_device->reg_size = pci_resource_len(pci_dev, 1);
}
/* memory areas mapped kernel space */
- marubl_device->marubl_mmreg = ioremap(marubl_device->reg_start, marubl_device->reg_size);
+ marubl_device->marubl_mmreg = ioremap(marubl_device->reg_start,
+ marubl_device->reg_size);
if (!marubl_device->marubl_mmreg) {
- release_mem_region(marubl_device->reg_start, marubl_device->reg_size);
+ release_mem_region(marubl_device->reg_start,
+ marubl_device->reg_size);
pci_disable_device(pci_dev);
kfree(marubl_device);
marubl_device = NULL;
props.min_brightness = min_brightness;
props.max_brightness = max_brightness;
props.type = BACKLIGHT_PLATFORM;
- bd = backlight_device_register ("emulator", &pci_dev->dev, NULL, &marubl_ops, &props);
+ bd = backlight_device_register("emulator",
+ &pci_dev->dev,
+ NULL,
+ &marubl_ops,
+ &props);
if (IS_ERR(bd)) {
ret = PTR_ERR(bd);
iounmap(marubl_device->marubl_mmreg);
- release_mem_region(marubl_device->reg_start, marubl_device->reg_size);
+ release_mem_region(marubl_device->reg_start,
+ marubl_device->reg_size);
pci_disable_device(pci_dev);
kfree(marubl_device);
marubl_device = NULL;
return ret;
}
- bd->props.brightness = (unsigned int)readl(marubl_device->marubl_mmreg);;
+ bd->props.brightness = (unsigned int)readl(marubl_device->marubl_mmreg);
bd->props.power = FB_BLANK_UNBLANK;
backlight_update_status(bd);
marubl_device->bl_dev = bd;
- printk(KERN_INFO "marubl: MARU Virtual Backlight driver.\n");
+ printk(KERN_INFO "marubl: MARU Virtual Backlight driver is loaded.\n");
return 0;
}
* register pci driver
*/
static struct pci_driver marubl_pci_driver = {
- .name = MARUBL_DRIVER_NAME,
- .id_table = marubl_pci_table,
- .probe = marubl_probe,
- .remove = __devexit_p(marubl_exit),
+ .name = MARUBL_DRIVER_NAME,
+ .id_table = marubl_pci_table,
+ .probe = marubl_probe,
+ .remove = __devexit_p(marubl_exit),
#ifdef CONFIG_PM
- //.suspend = marubl_suspend,
- //.resume = marubl_resume,
+ /* .suspend = marubl_suspend, */
+ /* .resume = marubl_resume, */
#endif
};
* Copyright (c) 2011-2012 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Kitae Kim <kt920.kim@samsung.com>
+ * Kitae KIM <kt920.kim@samsung.com>
* SeokYeon Hwang <syeon.hwang@samsung.com>
+ * DongKyun Yun <dk77.yun@samsung.com>
* YeongKyoon Lee <yeongkyoon.lee@samsung.com>
*
* This program is free software; you can redistribute it and/or
} else if (cmd == CODEC_CMD_GET_MMAP_OFFSET) {
value = readl(svcodec->ioaddr + cmd);
CODEC_LOG(KERN_DEBUG,
- "ioctl: get mmap offset: %d.\n", value);
+ "ioctl: get mmap offset: %ld.\n", value);
} else {
CODEC_LOG(KERN_INFO,
"ioctl: no command available.\n");
* Copyright (C) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
+ * Hyunjun Son <hj79.son@samsung.com>
* GiWoong Kim <giwoong.kim@samsung.com>
* YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * Hyunjun Son
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* Copyright (C) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
+ * Hyunjun Son <hj79.son@samsung.com>
* GiWoong Kim <giwoong.kim@samsung.com>
* YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * Hyunjun Son
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* Copyright (c) 2011-2012 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
- * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * Hyunjun Son <hj79.son@samsung.com>
+ * DongKyun Yun <dk77.yun@samsung.com>
* YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * Hyunjun Son
- * DongKyun Yun
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
module_exit(emul_lcd_class_exit);
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Jinhyung Jo <jinhyung.jo@samsung.com>");
+MODULE_AUTHOR("s-core");
MODULE_DESCRIPTION("Emulator LCD driver for x86");
/*
* Maru Virtual Overlay Driver
*
- * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
* Jinhyung Jo <jinhyung.jo@samsung.com>
+ * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
+ * Boston, MA 02110-1301, USA.
*
* Contributors:
* - S-Core Co., Ltd
return ret;
}
- printk(KERN_INFO "svo: Tizen Virtual Overlay Driver v%d.%d\n",
+ printk(KERN_INFO "svo: MARU Virtual Overlay Driver v%d.%d is loaded\n",
SVO_DRIVER_MAJORVERSION, SVO_DRIVER_MINORVERSION);
return 0;
static int __init svo_init(void)
{
- printk(KERN_INFO "svo: Maru overlay driver version %d.%d loaded\n",
- SVO_DRIVER_MAJORVERSION, SVO_DRIVER_MINORVERSION);
-
return pci_register_driver(&svo_pci_driver);
}
*
* Contact:
* GiWoong Kim <giwoong.kim@samsung.com>
+ * HyunJun Son <hj79.son@samsung.com>
+ * DongKyun Yun <dk77.yun@samsung.com>
* YeongKyoon Lee <yeongkyoon.lee@samsung.com>
*
* This program is free software; you can redistribute it and/or
return 0;
}
-static ssize_t esm_write(struct inode *i, const char __user *ubuf, size_t len, loff_t *off)
+static ssize_t esm_write(struct file *f, const char __user *ubuf, size_t len, loff_t *off)
{
int err = 0;
ssize_t ret = 0;
}
buf[len - 1] = '\0';
- kstrtou16(buf, 10, &vesm->progress.percentage);
+ ret = kstrtou16(buf, 10, &vesm->progress.percentage);
+ if (ret < 0) {
+ VESM_LOG(KERN_ERR, "failed to convert string to integer.\n");
+ return ret;
+ }
VESM_LOG(KERN_DEBUG, "boot up progress is [%u] percent done.\n", vesm->progress.percentage);
--- /dev/null
+/*
+ * Maru Virtio Hwkey Device Driver
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * Sangjin Kim <sangjin3.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/fs.h>
+#include <linux/input.h>
+#include <linux/miscdevice.h>
+#include <linux/slab.h>
+#include <linux/virtio.h>
+#include <linux/virtio_ids.h>
+#include <linux/virtio_config.h>
+#include <linux/kthread.h>
+
+MODULE_LICENSE("GPL2");
+MODULE_AUTHOR("Sungmin Ha <sungmin82.ha@samsung.com>");
+MODULE_DESCRIPTION("Emulator Virtio Hwkey driver");
+
+#define DEVICE_NAME "virtio-hwkey"
+
+/* 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;
+} virtio_hwkey;
+virtio_hwkey *vh;
+
+static struct virtio_device_id id_table[] = {
+ { VIRTIO_ID_HWKEY, VIRTIO_DEV_ANY_ID },
+ { 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,
+ KEY_RELEASED = 2,
+};
+
+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)
+{
+#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);
+ }
+ else if (event->event_type == KEY_RELEASED) { /* released */
+ input_event(vh->idev, EV_KEY, event->keycode, false);
+ }
+ else {
+ printk(KERN_ERR "Unknown event type\n");
+ return;
+ }
+
+ 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;
+ }
+ } while(true);
+
+ virtqueue_kick(vh->vq);
+}
+
+static int virtio_hwkey_open(struct inode *inode, struct file *file)
+{
+ printk(KERN_INFO "virtio hwkey device is opened\n");
+ return 0;
+}
+
+static int virtio_hwkey_release(struct inode *inode, struct file *file)
+{
+ printk(KERN_INFO "virtio hwkey device is closed\n");
+ return 0;
+}
+
+static int input_hwkey_open(struct input_dev *dev)
+{
+ printk(KERN_INFO "input hwkey device is opened\n");
+ return 0;
+}
+
+static void input_hwkey_close(struct input_dev *dev)
+{
+ printk(KERN_INFO "input hwkey device is closed\n");
+}
+
+struct file_operations virtio_hwkey_fops = {
+ .owner = THIS_MODULE,
+ .open = virtio_hwkey_open,
+ .release = virtio_hwkey_release,
+};
+
+static int virtio_hwkey_probe(struct virtio_device *vdev)
+{
+ int ret = 0;
+
+ printk(KERN_INFO "virtio hwkey driver is probed\n");
+
+ /* init virtio */
+ vdev->priv = vh = kmalloc(sizeof(*vh), GFP_KERNEL);
+ if (!vh) {
+ return -ENOMEM;
+ }
+
+ vh->vdev = vdev;
+
+ vh->vq = virtio_find_single_vq(vh->vdev,
+ vq_hwkey_callback, "virtio-hwkey-vq");
+ if (IS_ERR(vh->vq)) {
+ ret = PTR_ERR(vh->vq);
+
+ kfree(vh);
+ vdev->priv = NULL;
+ return ret;
+ }
+
+ /* enable callback */
+ virtqueue_enable_cb(vh->vq);
+
+ sg_init_table(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);
+
+ if (err < 0) {
+ printk(KERN_ERR "failed to add buffer\n");
+
+ kfree(vh);
+ vdev->priv = NULL;
+ return ret;
+ }
+ }
+
+ /* register for input device */
+ vh->idev = input_allocate_device();
+ if (!vh->idev) {
+ printk(KERN_ERR "failed to allocate a input hwkey device\n");
+ ret = -1;
+
+ kfree(vh);
+ vdev->priv = NULL;
+ return ret;
+ }
+
+ vh->idev->name = "Maru Virtio Hwkey";
+ vh->idev->dev.parent = &(vdev->dev);
+
+ input_set_drvdata(vh->idev, vh);
+ vh->idev->open = input_hwkey_open;
+ vh->idev->close = input_hwkey_close;
+
+ vh->idev->evbit[0] = BIT_MASK(EV_KEY);
+ /* to support any keycode */
+ memset(vh->idev->keybit, 0xffffffff, sizeof(unsigned long) * BITS_TO_LONGS(KEY_CNT));
+
+ ret = input_register_device(vh->idev);
+ if (ret) {
+ printk(KERN_ERR "input hwkey driver cannot registered\n");
+ ret = -1;
+
+ input_free_device(vh->idev);
+ kfree(vh);
+ vdev->priv = NULL;
+ return ret;
+ }
+
+ virtqueue_kick(vh->vq);
+ index = 0;
+
+ return 0;
+}
+
+static void __devexit virtio_hwkey_remove(struct virtio_device *vdev)
+{
+ virtio_hwkey *vhk = NULL;
+
+ printk(KERN_INFO "virtio hwkey driver is removed\n");
+
+ vhk = vdev->priv;
+
+ vdev->config->reset(vdev); /* reset device */
+ vdev->config->del_vqs(vdev); /* clean up the queues */
+
+ input_unregister_device(vhk->idev);
+
+ kfree(vhk);
+}
+
+MODULE_DEVICE_TABLE(virtio, id_table);
+
+static struct virtio_driver virtio_hwkey_driver = {
+ .driver.name = KBUILD_MODNAME,
+ .driver.owner = THIS_MODULE,
+ .id_table = id_table,
+ .probe = virtio_hwkey_probe,
+ .remove = __devexit_p(virtio_hwkey_remove),
+};
+
+static int __init virtio_hwkey_init(void)
+{
+ printk(KERN_INFO "virtio hwkey device is initialized\n");
+ return register_virtio_driver(&virtio_hwkey_driver);
+}
+
+static void __exit virtio_hwkey_exit(void)
+{
+ printk(KERN_INFO "virtio hwkey device is destroyed\n");
+ unregister_virtio_driver(&virtio_hwkey_driver);
+}
+
+module_init(virtio_hwkey_init);
+module_exit(virtio_hwkey_exit);
+
sizeof(struct EmulKbdEvent));
}
- ret = virtqueue_add_buf(vkbd->vq, &vkbd->sg, 0, 10, (void *)(10), GFP_ATOMIC);
+ ret = virtqueue_add_buf(vkbd->vq, vkbd->sg, 0, 10, (void *)(10), GFP_ATOMIC);
if (ret < 0) {
VKBD_LOG(KERN_ERR, "failed to add buffer to virtqueue.\n");
kfree(vkbd);
#define VIRTIO_ID_TOUCHSCREEN 11 /* virtio touchscreen */
#define VIRTIO_ID_KEYBOARD 12 /* virtio keyboard */
#define VIRTIO_ID_ESM 13 /* virtio ESM */
+#define VIRTIO_ID_HWKEY 14 /* virtio hwkey */
#endif
#endif /* _LINUX_VIRTIO_IDS_H */
-* 2.0.0
-- Tizen 2.0 release.
-== Kitae Kim <kt920.kim@samsung.com> 2013-01-11
+* 1.4.17
+- added virtio hwkey driver and improved hwkey mapping
+== Sungmin Ha <sungmin82.ha@samsung.com> 2013-03-20
+* 1.4.15
+- source clean-up for overlay and backlight module.
+== Kitae Kim <kt920.kim@samsung.com> 2013-03-08
+* 1.4.14
+- enable BLK_DEV_CRYPTOLOOP.
+== Kitae Kim <kt920.kim@samsung.com> 2013-02-01
+* 1.4.13
+- modified block device name for sdcard
+== Sungmin Ha <sungmin82.ha@samsung.com> 2013-01-21
+* 1.4.12
+- Fixed a bug does not close when the device has been shut down with no streaming data.
+== Jinhyung Jo <jinhyung.jo@samsung.com> 2013-01-14
+* 1.4.11
+- Fixed a bug when audio some codecs are decoded simultaneously.
+- Source cleanup and codec driver can get and set offset of device memory for audio type.
+== Kitae Kim <kt920.kim@samsung.com> 2012-12-18
+* 1.4.10
+- Added virtio-esm driver.
+- This driver is for displaying boot status of emulator.
+== Kitae Kim <kt920.kim@samsung.com> 2012-12-17
+* 1.4.4
+- Modified touchscreen range
+== GiWoong Kim <giwoong.kim@samsung.com> 2012-11-27
+* 1.4.3
+- Removed an invalid symbolic-link in init script
+- touchscreen0, keyboard0, smotion node
+== GiWoong Kim <giwoong.kim@samsung.com> 2012-11-12
+* 1.4.2
+- Do not ignore a touch event on emulator
+- The current touch event may be same as the previous coordinate data.
+== GiWoong Kim <giwoong.kim@samsung.com> 2012-10-23
+* 1.4.0
+- Merge develop into release branch.
+- Some features or bug fixes are merged from develop.
+== Kitae Kim <kt920.kim@samsung.com> 2012-11-02
+* 1.3.24
+- The range of brightness level has been changed.(1 ~ 24 => 0 ~ 100)
+== Jinhyung.jo <jinhyung.jo@samsung.com> 2012-10-31
+* 1.3.23
+- Modify dibs build script for arm package.
+- Since arm toolchain has been installed on build environment, kernel source can support arm package.
+== Kitae Kim <kt920.kim@samsung.com> 2012-10-31
+* 1.3.22
+- Merge tizen_arm branch into develop branch.
+- Merge arm kernel source for emulator into x86 kernel source.
+== Kitae Kim <kt920.kim@samsung.com> 2012-10-30
+* 1.3.20
+- Change kernel keycode of KEY_MENU.
+- Since X key mapping has been changed, kernel keycode has to be changed.
+== GiWoong Kim <giwoong.kim@samsung.com> 2012-10-23
+* 1.3.19
+- Enable devtmpfs config.
+- Since udev module has been updated kernel need to enable devtmfs config.
+== Kitae Kim <kt920.kim@samsung.com> 2012-10-23
-Package: emulator-kernel-x86
-Version: 2.0.0
-Maintainer: Yeong-Kyoon Lee <yeongkyoon.lee@samsung.com>
+Version: 1.4.17
+Maintainer: Yeong-Kyoon, Lee <yeongkyoon.lee@samsung.com>
Source: emulator-kernel
+
+Package: emulator-kernel-x86
OS: ubuntu-32, ubuntu-64, windows-32, windows-64, macos-64
Build-host-os: ubuntu-32
Description: Tizen x86 Emulator Kernel
+
+#Package: emulator-kernel-arm
+#OS: ubuntu-32, ubuntu-64, windows-32, windows-64, macos-64
+#Build-host-os: ubuntu-32
+#Description: Tizen ARM Emulator Kernel
# create device filesystem
/bin/mkdir -p /new_root/dev
-/bin/mount -t ramfs ramfs /new_root/dev
-
-/bin/mknod /new_root/dev/ram0 c 1 0
-/bin/mknod /new_root/dev/mem c 1 1
-/bin/mknod /new_root/dev/kmem c 1 2
-/bin/mknod /new_root/dev/null c 1 3
-/bin/mknod /new_root/dev/zero c 1 5
-/bin/mknod /new_root/dev/random c 1 8
-/bin/mknod /new_root/dev/urandom c 1 9
-
-#/bin/mknod /new_root/dev/hda b 3 0
-#/bin/mknod /new_root/dev/hdb b 3 64
-
-#filesystem in userspace
-/bin/mknod /new_root/dev/fuse c 10 229
-
-/bin/mknod /new_root/dev/tty0 c 4 0
-/bin/mknod /new_root/dev/tty1 c 4 1
-/bin/mknod /new_root/dev/tty2 c 4 2
-/bin/mknod /new_root/dev/tty3 c 4 3
-/bin/mknod /new_root/dev/tty4 c 4 4
-/bin/mknod /new_root/dev/tty5 c 4 5
-/bin/mknod /new_root/dev/tty6 c 4 6
-/bin/mknod /new_root/dev/tty7 c 4 7
-
-/bin/mknod /new_root/dev/ttyS0 c 4 64
-/bin/mknod /new_root/dev/ttyS1 c 4 65
-/bin/mknod /new_root/dev/ttyS2 c 4 66
-
-/bin/mknod /new_root/dev/tty c 5 0
-/bin/mknod /new_root/dev/console c 5 1
-/bin/mknod /new_root/dev/ptmx c 5 2
-
-/bin/mknod /new_root/dev/sda b 8 0
-/bin/mknod /new_root/dev/sda1 b 8 1
-
-#/bin/mknod /new_root/dev/log_radio c 10 60
-#/bin/mknod /new_root/dev/log_events c 10 61
-#/bin/mknod /new_root/dev/log_main c 10 62
-#/bin/mknod /new_root/dev/log_system c 10 59
-
-/bin/mkdir -p /new_root/dev/input
-/bin/mknod /new_root/dev/input/mouse0 c 13 32
-/bin/mknod /new_root/dev/input/mouse1 c 13 33
-/bin/mknod /new_root/dev/input/event0 c 13 64
-/bin/mknod /new_root/dev/input/event1 c 13 65
-/bin/mknod /new_root/dev/input/event2 c 13 66
-/bin/mknod /new_root/dev/input/event3 c 13 67
-/bin/mknod /new_root/dev/input/event4 c 13 68
-#(cd /new_root/dev/input && /bin/ln -s event1 touchscreen0)
-#(cd /new_root/dev/input && /bin/ln -s event2 keyboard0)
-#(cd /new_root/dev && /bin/ln -s input/event3 smotion)
-
-/bin/mknod /new_root/dev/mixer c 14 0
-/bin/mknod /new_root/dev/sequencer c 14 1
-/bin/mknod /new_root/dev/midi00 c 14 2
-/bin/mknod /new_root/dev/dsp c 14 3
-/bin/mknod /new_root/dev/sndstat c 14 6
-/bin/mknod /new_root/dev/mixer1 c 14 16
-/bin/mknod /new_root/dev/midi01 c 14 18
-/bin/mknod /new_root/dev/dsp1 c 14 19
-/bin/mknod /new_root/dev/mixer2 c 14 32
-/bin/mknod /new_root/dev/midi02 c 14 34
-/bin/mknod /new_root/dev/dsp2 c 14 35
-/bin/mknod /new_root/dev/mixer3 c 14 48
-/bin/mknod /new_root/dev/midi03 c 14 50
-/bin/mknod /new_root/dev/dsp3 c 14 51
-
-/bin/mknod /new_root/dev/hdc b 22 0
-/bin/mknod /new_root/dev/hdd b 22 64
-
-/bin/mknod /new_root/dev/fb0 c 29 0
-/bin/mknod /new_root/dev/fb1 c 29 1
-/bin/mknod /new_root/dev/fb2 c 29 2
-/bin/mknod /new_root/dev/fb3 c 29 3
-
-/bin/mknod /new_root/dev/mtdblock0 b 31 0
-/bin/mknod /new_root/dev/mtdblock1 b 31 1
-/bin/mknod /new_root/dev/mtdblock2 b 31 2
-/bin/mknod /new_root/dev/mtdblock3 b 31 3
-/bin/mknod /new_root/dev/mtdblock4 b 31 4
-
-/bin/mknod /new_root/dev/video0 c 81 0
-/bin/mknod /new_root/dev/video1 c 81 1
-/bin/mknod /new_root/dev/video2 c 81 2
-
-/bin/mknod /new_root/dev/mtd0 b 90 0
-/bin/mknod /new_root/dev/mtd1 b 90 2
-/bin/mknod /new_root/dev/mtd2 b 90 4
-/bin/mknod /new_root/dev/mtd3 b 90 6
-/bin/mknod /new_root/dev/mtd4 b 90 8
-
-/bin/mknod /new_root/dev/ttygs c 127 0
-
-/bin/mkdir -p /new_root/dev/pts
-/bin/mknod /new_root/dev/pts/0 c 136 0
-/bin/mknod /new_root/dev/pts/1 c 136 1
-/bin/mknod /new_root/dev/pts/2 c 136 2
-/bin/mknod /new_root/dev/pts/3 c 136 3
-/bin/mknod /new_root/dev/pts/4 c 136 4
-
-/bin/mkdir -p /new_root/dev/dpram
-/bin/mknod /new_root/dev/dpram/0 c 249 0
-/bin/mknod /new_root/dev/vdpram1 c 249 1
-
-/bin/mkdir -p /new_root/dev/input
-
-# commented out by caramis...
-#/bin/mkdir -p /new_root/dev/snd
-#/bin/mknod -m 660 /new_root/dev/snd/controlC0 c 116 7
-#/bin/mknod -m 660 /new_root/dev/snd/pcmC0D0c c 116 6
-#/bin/mknod -m 660 /new_root/dev/snd/pcmC0D0p c 116 5
-#/bin/mknod -m 660 /new_root/dev/snd/pcmC0D1p c 116 4
-#/bin/mknod -m 660 /new_root/dev/snd/timer c 116 2
-
-/bin/mknod /new_root/dev/vda b 254 0
-/bin/mknod /new_root/dev/vdb b 254 16
-(cd /new_root/dev && /bin/ln -sf vdb mmcblk0)
-(cd /new_root/dev && /bin/ln -sf vdb1 mmcblk0p1)
-(cd /new_root/dev && /bin/ln -sf vdb2 mmcblk0p2)
-(cd /new_root/dev && /bin/ln -sf vdb3 mmcblk0p3)
-
-#echo "Create sys"
+/bin/mount -t devtmpfs devtmpfs /new_root/dev
/bin/mkdir -p /new_root/sys
-#/bin/mknod /new_root/dev/opengl c 240 0
-
-
>${CONSOLE} <${CONSOLE} 2>&1
echo "Switching root"