/sys/class/lcd/emulator node is created.
authorfredrick.kim <fredrick.kim@samsung.com>
Fri, 12 Aug 2011 06:51:11 +0000 (15:51 +0900)
committerfredrick.kim <fredrick.kim@samsung.com>
Fri, 12 Aug 2011 06:51:11 +0000 (15:51 +0900)
arch/x86/configs/i386_emul_defconfig
drivers/samsung/Kconfig
drivers/samsung/Makefile
drivers/samsung/emul_lcd.c [new file with mode: 0644]

index 1d849b5a412793080ff53e6df3293051eaf60f1e..edffcde1750e50ea80ab35ef041e814743b7bf07 100644 (file)
@@ -1718,6 +1718,7 @@ CONFIG_BACKLIGHT_EMUL=y
 # Display device support
 #
 # CONFIG_DISPLAY_SUPPORT is not set
+CONFIG_EMUL_LCD=y
 
 #
 # Console display driver support
index 400342a93e689f55b169f4e217da42f04a0fdbed..e44331110b125d00ad5803c6b432b9e9d18fafca 100755 (executable)
@@ -3,5 +3,9 @@ menu "Virtual_3D_Accelerator"
 config HW_ACCELERATOR
        tristate "Samsung Virtual 3D Accelerator driver"
        default n
+
+config EMUL_LCD
+       tristate "Samsung emulator LCD driver"
+       default n
 endmenu
 
index a7c9c57efbaa5c69ca70312142310b39e4f7eaa1..61a5227b334b81e245021c14a1f500ef4f65f87f 100755 (executable)
@@ -1,2 +1,3 @@
 obj-$(CONFIG_HW_ACCELERATOR)   += Accelerator.o
+obj-$(CONFIG_EMUL_LCD) += emul_lcd.o
 
diff --git a/drivers/samsung/emul_lcd.c b/drivers/samsung/emul_lcd.c
new file mode 100644 (file)
index 0000000..268032c
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * LCD node
+ *
+ * Copyright (C) 2003,2004 Hewlett-Packard Company
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/notifier.h>
+#include <linux/ctype.h>
+#include <linux/err.h>
+
+#include <asm/uaccess.h>
+
+static struct class *emul_lcd_class;
+static struct device *emul_lcd_dev;
+
+static int __init emul_lcd_class_init(void)
+{
+       int i, ret;
+
+       emul_lcd_class = class_create(THIS_MODULE, "lcd");
+       if (IS_ERR(emul_lcd_class)) {
+               printk(KERN_WARNING "Unable to create backlight class; errno = %ld\n",
+                               PTR_ERR(emul_lcd_class));
+               return PTR_ERR(emul_lcd_class);
+       }
+
+       emul_lcd_dev = device_create(emul_lcd_class, NULL, NULL, NULL, "emulator");
+
+       /*
+       for (i=0; i < ARRAY_SIZE(emul_bl_device_attrib); i++) {
+               ret = device_create_file(emul_backlight_dev, emul_bl_device_attrib[i]);
+               if (ret != 0) {
+                       printk(KERN_ERR "emul_bl: Failed to create attr %d: %d\n", i, ret);
+                       return ret;
+               }
+       }
+       */
+
+       return 0;
+}
+
+static void __exit emul_lcd_class_exit(void)
+{
+       class_destroy(emul_lcd_class);
+}
+
+/*
+ * if this is compiled into the kernel, we need to ensure that the
+ * class is registered before users of the class try to register lcd's
+ */
+module_init(emul_lcd_class_init);
+module_exit(emul_lcd_class_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("s-core");
+MODULE_DESCRIPTION("Emulator LCD driver for x86");