[Title]modified for change directory and name of drivers to maru
authorsungmin82.ha <sungmin82.ha@samsung.com>
Fri, 17 Feb 2012 05:40:34 +0000 (14:40 +0900)
committersungmin82.ha <sungmin82.ha@samsung.com>
Fri, 17 Feb 2012 05:43:59 +0000 (14:43 +0900)
[Type]Enhancement
[Module]emulator-kernel drivers(jack,power_supply,usb_mass_storage,usb_mode)
[Priority]Major
[Jira#] // Jira Issue Number
[Redmine#]  // Redmine Isuue Number
[Problem]  // Problem Description
[Cause]  // Cause Description
[Solution] // Solution Description
[TestCase]  // Executed the test-target (How to)

Change-Id: I66c13bb99de06f71d10590324d4ade5302dca8ed

20 files changed:
arch/x86/configs/i386_emul_defconfig
drivers/Makefile
drivers/jack/Kconfig [deleted file]
drivers/jack/Makefile [deleted file]
drivers/jack/mod_jack.c [deleted file]
drivers/maru/Kconfig
drivers/maru/Makefile
drivers/maru/maru_jack.c [new file with mode: 0644]
drivers/maru/maru_power_supply.c [new file with mode: 0644]
drivers/maru/maru_usb_mass_storage.c [new file with mode: 0644]
drivers/maru/maru_usb_mode.c [new file with mode: 0644]
drivers/power_supply/Kconfig [deleted file]
drivers/power_supply/Makefile [deleted file]
drivers/power_supply/mod_power_supply.c [deleted file]
drivers/usb_mass_storage/Kconfig [deleted file]
drivers/usb_mass_storage/Makefile [deleted file]
drivers/usb_mass_storage/mod_usb_mass_storage.c [deleted file]
drivers/usb_mode/Kconfig [deleted file]
drivers/usb_mode/Makefile [deleted file]
drivers/usb_mode/mod_usb_mode.c [deleted file]

index abe4c093b1485b2718a7f6e6dfee4047125f4ee5..aaf2385743a06c65bfc5488cdc2486b972c22207 100644 (file)
@@ -1354,7 +1354,6 @@ CONFIG_I2C_I801=y
 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
 # CONFIG_GPIOLIB is not set
 # CONFIG_W1 is not set
-CONFIG_POWER_SUPPLY=y
 # CONFIG_POWER_SUPPLY_DEBUG is not set
 # CONFIG_PDA_POWER is not set
 # CONFIG_BATTERY_DS2760 is not set
@@ -2170,6 +2169,10 @@ CONFIG_MARU_TOUCHSCREEN=y
 CONFIG_MARU_FB=y
 CONFIG_MARU_CAMERA=y
 CONFIG_MARU_BACKLIGHT=y
+CONFIG_MARU_JACK=y
+CONFIG_MARU_POWER_SUPPLY=y
+CONFIG_MARU_USB_MASS_STORAGE=y
+CONFIG_MARU_USB_MODE=y
 CONFIG_X86_PLATFORM_DEVICES=y
 # CONFIG_ACER_WMI is not set
 # CONFIG_ASUS_LAPTOP is not set
index ace2231bfd344c79454a2f7139c4e3fcbb5c087e..1d672be39c88e75879b9b03e17c1d7ee21d3675e 100644 (file)
@@ -75,7 +75,6 @@ obj-$(CONFIG_RTC_LIB)         += rtc/
 obj-y                          += i2c/ media/
 obj-$(CONFIG_PPS)              += pps/
 obj-$(CONFIG_W1)               += w1/
-obj-$(CONFIG_POWER_SUPPLY)     += power_supply/
 obj-$(CONFIG_HWMON)            += hwmon/
 obj-$(CONFIG_THERMAL)          += thermal/
 obj-$(CONFIG_WATCHDOG)         += watchdog/
@@ -111,8 +110,5 @@ obj-$(CONFIG_VLYNQ)         += vlynq/
 obj-$(CONFIG_STAGING)          += staging/
 obj-y                          += platform/
 obj-y                          += ieee802154/
-obj-y                          += jack/
-obj-y                          += usb_mode/
-obj-y                          += usb_mass_storage/
 
 obj-$(CONFIG_MARU)             += maru/
diff --git a/drivers/jack/Kconfig b/drivers/jack/Kconfig
deleted file mode 100644 (file)
index a3c5b97..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Character device configuration
-#
-
-menu "Character devices"
-
-source "drivers/jack/Kconfig"
-
-config JACK
-       "jack"
-
-
-endmenu
diff --git a/drivers/jack/Makefile b/drivers/jack/Makefile
deleted file mode 100644 (file)
index 27636fa..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y += mod_jack.o
diff --git a/drivers/jack/mod_jack.c b/drivers/jack/mod_jack.c
deleted file mode 100644 (file)
index ff64c4c..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*\r
- * Virtual device node for event injector of emulator\r
- *\r
- * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact:\r
- * Sungmin Ha <sungmin82.ha@samsung.com>\r
- *\r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
- *\r
- * Contributors:\r
- * - S-Core Co., Ltd\r
- */\r
-\r
-#include <linux/kernel.h>\r
-#include <linux/module.h>\r
-#include <linux/device.h>\r
-#include <linux/platform_device.h>\r
-\r
-int charger_online = 0;\r
-int earjack_online = 0;\r
-int earkey_online = 0;\r
-int hdmi_online = 0;\r
-int usb_online = 0;\r
-\r
-struct my_data {\r
-       int no;\r
-       char test[50];\r
-};\r
-\r
-static ssize_t show_charger_online(struct device *dev, \r
-               struct device_attribute *attr, char *buf) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       return snprintf(buf, PAGE_SIZE, "%d", charger_online);\r
-}\r
-\r
-static ssize_t store_charger_online(struct device *dev, \r
-               struct device_attribute *attr, const char *buf, size_t count) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       sscanf(buf, "%d", &charger_online);\r
-       return strnlen(buf, PAGE_SIZE);\r
-}\r
-\r
-static ssize_t show_earjack_online(struct device *dev, \r
-               struct device_attribute *attr, char *buf) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       return snprintf(buf, PAGE_SIZE, "%d", earjack_online);\r
-}\r
-\r
-static ssize_t store_earjack_online(struct device *dev, \r
-               struct device_attribute *attr, const char *buf, size_t count) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       sscanf(buf, "%d", &earjack_online);\r
-       return strnlen(buf, PAGE_SIZE);\r
-}\r
-\r
-static ssize_t show_earkey_online(struct device *dev, \r
-               struct device_attribute *attr, char *buf) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       return snprintf(buf, PAGE_SIZE, "%d", earkey_online);\r
-}\r
-\r
-static ssize_t store_earkey_online(struct device *dev, \r
-               struct device_attribute *attr, const char *buf, size_t count) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       sscanf(buf, "%d", &earkey_online);\r
-       return strnlen(buf, PAGE_SIZE);\r
-}\r
-\r
-static ssize_t show_hdmi_online(struct device *dev, \r
-               struct device_attribute *attr, char *buf) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       return snprintf(buf, PAGE_SIZE, "%d", hdmi_online);\r
-}\r
-\r
-static ssize_t store_hdmi_online(struct device *dev, \r
-               struct device_attribute *attr, const char *buf, size_t count) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       sscanf(buf, "%d", &hdmi_online);\r
-       return strnlen(buf, PAGE_SIZE);\r
-}\r
-\r
-static ssize_t show_usb_online(struct device *dev, \r
-               struct device_attribute *attr, char *buf) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       return snprintf(buf, PAGE_SIZE, "%d", usb_online);\r
-}\r
-\r
-static ssize_t store_usb_online(struct device *dev, \r
-               struct device_attribute *attr, const char *buf, size_t count) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       sscanf(buf, "%d", &usb_online);\r
-       return strnlen(buf, PAGE_SIZE);\r
-}\r
-static DEVICE_ATTR(charger_online, S_IRUGO | S_IWUSR, show_charger_online, store_charger_online);\r
-static DEVICE_ATTR(earjack_online, S_IRUGO | S_IWUSR, show_earjack_online, store_earjack_online);\r
-static DEVICE_ATTR(earkey_online, S_IRUGO | S_IWUSR, show_earkey_online, store_earkey_online);\r
-static DEVICE_ATTR(hdmi_online, S_IRUGO | S_IWUSR, show_hdmi_online, store_hdmi_online);\r
-static DEVICE_ATTR(usb_online, S_IRUGO | S_IWUSR, show_usb_online, store_usb_online);\r
-\r
-static int sysfs_test_create_file(struct device *dev) \r
-{\r
-       int result = 0;\r
-\r
-       printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
-\r
-       result = device_create_file(dev, &dev_attr_charger_online);\r
-       if (result){\r
-               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
-               return result;\r
-       }\r
-\r
-       result = device_create_file(dev, &dev_attr_earjack_online);\r
-       if (result){\r
-               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
-               return result;\r
-       }\r
-\r
-       result = device_create_file(dev, &dev_attr_earkey_online);\r
-       if (result){\r
-               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
-               return result;\r
-       }\r
-\r
-       result = device_create_file(dev, &dev_attr_hdmi_online);\r
-       if (result){\r
-               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
-               return result;\r
-       }\r
-\r
-       result = device_create_file(dev, &dev_attr_usb_online);\r
-       if (result){\r
-               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
-               return result;\r
-       }\r
-\r
-       return 0;\r
-}\r
-\r
-\r
-static void sysfs_test_remove_file(struct device *dev) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       device_remove_file(dev, &dev_attr_charger_online);\r
-       device_remove_file(dev, &dev_attr_earjack_online);\r
-       device_remove_file(dev, &dev_attr_earkey_online);\r
-       device_remove_file(dev, &dev_attr_hdmi_online);\r
-       device_remove_file(dev, &dev_attr_usb_online);\r
-}\r
-\r
-static void sysfs_test_dev_release(struct device *dev) {}\r
-\r
-static struct platform_device the_pdev = {\r
-       .name = "jack",\r
-       .id = -1,\r
-       .dev = {\r
-               .release = sysfs_test_dev_release,\r
-       }\r
-};\r
-\r
-static int __init sysfs_test_init(void) \r
-{\r
-       int err = 0;\r
-       struct my_data *data;\r
-\r
-       printk("[%s] \n", __FUNCTION__);\r
-\r
-       err = platform_device_register(&the_pdev);\r
-       if (err) {\r
-               printk("platform_device_register error\n");\r
-               return err;\r
-       }\r
-\r
-       data = kzalloc(sizeof(struct my_data), GFP_KERNEL);\r
-       if (!data) {\r
-               printk("[%s] kzalloc error\n", __FUNCTION__);\r
-               err = -ENOMEM;\r
-               goto alloc_err;\r
-       }\r
-\r
-       dev_set_drvdata(&the_pdev.dev, (void*)data);\r
-\r
-       err = sysfs_test_create_file(&the_pdev.dev);\r
-       if (err) {\r
-               printk("sysfs_create_file error\n");\r
-               goto sysfs_err;\r
-       }\r
-\r
-       return 0;\r
-\r
-sysfs_err:\r
-       kfree(data);\r
-\r
-alloc_err:\r
-       platform_device_unregister(&the_pdev);\r
-       return err;\r
-}\r
-\r
-static void __exit sysfs_test_exit(void) \r
-{\r
-       void *data = dev_get_drvdata(&the_pdev.dev);\r
-\r
-       printk("[%s] \n", __FUNCTION__);\r
-\r
-       kfree(data);\r
-       sysfs_test_remove_file(&the_pdev.dev);\r
-       platform_device_unregister(&the_pdev);\r
-}\r
-\r
-module_init(sysfs_test_init);\r
-module_exit(sysfs_test_exit);\r
-\r
-\r
-MODULE_LICENSE("GPL");\r
-\r
-\r
index 1743c1d3cf5e4af22ac760096b7b43db72d6976e..e92ae35e40a4960a6a0900b09b6bf7f3f1edbdbc 100644 (file)
@@ -31,3 +31,18 @@ config MARU_BACKLIGHT
         help
           Say Y to enable the backlight driver of MARU.
 
+config MARU_JACK
+       tristate "MARU Jack Driver"
+       depends on MARU != n
+
+config MARU_POWER_SUPPLY
+       tristate "MARU Power supply Driver"
+       depends on MARU != n
+
+config MARU_USB_MASS_STORAGE
+       tristate "MARU Usb mass storage Driver"
+       depends on MARU != n
+
+config MARU_USB_MODE
+       tristate "MARU Usb mode Driver"
+       depends on MARU != n
index 531bfb306e3bb48f721a25a0db7bc58b718474a3..491e496edbf5c3e09ff03ff258a27d2baa16e4cd 100644 (file)
@@ -4,3 +4,7 @@ obj-$(CONFIG_MARU_TOUCHSCREEN) += maru_touchscreen.o
 obj-$(CONFIG_MARU_FB) += maru_fb.o
 obj-$(CONFIG_MARU_CAMERA) += maru_camera.o
 obj-$(CONFIG_MARU_CAMERA) += maru_bl.o
+obj-$(CONFIG_MARU_JACK) += maru_jack.o
+obj-$(CONFIG_MARU_POWER_SUPPLY) += maru_power_supply.o
+obj-$(CONFIG_MARU_USB_MASS_STORAGE) += maru_usb_mass_storage.o
+obj-$(CONFIG_MARU_USB_MODE) += maru_usb_mode.o
diff --git a/drivers/maru/maru_jack.c b/drivers/maru/maru_jack.c
new file mode 100644 (file)
index 0000000..ff64c4c
--- /dev/null
@@ -0,0 +1,238 @@
+/*\r
+ * Virtual device node for event injector of emulator\r
+ *\r
+ * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact:\r
+ * Sungmin Ha <sungmin82.ha@samsung.com>\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
+ *\r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ */\r
+\r
+#include <linux/kernel.h>\r
+#include <linux/module.h>\r
+#include <linux/device.h>\r
+#include <linux/platform_device.h>\r
+\r
+int charger_online = 0;\r
+int earjack_online = 0;\r
+int earkey_online = 0;\r
+int hdmi_online = 0;\r
+int usb_online = 0;\r
+\r
+struct my_data {\r
+       int no;\r
+       char test[50];\r
+};\r
+\r
+static ssize_t show_charger_online(struct device *dev, \r
+               struct device_attribute *attr, char *buf) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       return snprintf(buf, PAGE_SIZE, "%d", charger_online);\r
+}\r
+\r
+static ssize_t store_charger_online(struct device *dev, \r
+               struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       sscanf(buf, "%d", &charger_online);\r
+       return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_earjack_online(struct device *dev, \r
+               struct device_attribute *attr, char *buf) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       return snprintf(buf, PAGE_SIZE, "%d", earjack_online);\r
+}\r
+\r
+static ssize_t store_earjack_online(struct device *dev, \r
+               struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       sscanf(buf, "%d", &earjack_online);\r
+       return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_earkey_online(struct device *dev, \r
+               struct device_attribute *attr, char *buf) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       return snprintf(buf, PAGE_SIZE, "%d", earkey_online);\r
+}\r
+\r
+static ssize_t store_earkey_online(struct device *dev, \r
+               struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       sscanf(buf, "%d", &earkey_online);\r
+       return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_hdmi_online(struct device *dev, \r
+               struct device_attribute *attr, char *buf) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       return snprintf(buf, PAGE_SIZE, "%d", hdmi_online);\r
+}\r
+\r
+static ssize_t store_hdmi_online(struct device *dev, \r
+               struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       sscanf(buf, "%d", &hdmi_online);\r
+       return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_usb_online(struct device *dev, \r
+               struct device_attribute *attr, char *buf) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       return snprintf(buf, PAGE_SIZE, "%d", usb_online);\r
+}\r
+\r
+static ssize_t store_usb_online(struct device *dev, \r
+               struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       sscanf(buf, "%d", &usb_online);\r
+       return strnlen(buf, PAGE_SIZE);\r
+}\r
+static DEVICE_ATTR(charger_online, S_IRUGO | S_IWUSR, show_charger_online, store_charger_online);\r
+static DEVICE_ATTR(earjack_online, S_IRUGO | S_IWUSR, show_earjack_online, store_earjack_online);\r
+static DEVICE_ATTR(earkey_online, S_IRUGO | S_IWUSR, show_earkey_online, store_earkey_online);\r
+static DEVICE_ATTR(hdmi_online, S_IRUGO | S_IWUSR, show_hdmi_online, store_hdmi_online);\r
+static DEVICE_ATTR(usb_online, S_IRUGO | S_IWUSR, show_usb_online, store_usb_online);\r
+\r
+static int sysfs_test_create_file(struct device *dev) \r
+{\r
+       int result = 0;\r
+\r
+       printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
+\r
+       result = device_create_file(dev, &dev_attr_charger_online);\r
+       if (result){\r
+               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+               return result;\r
+       }\r
+\r
+       result = device_create_file(dev, &dev_attr_earjack_online);\r
+       if (result){\r
+               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+               return result;\r
+       }\r
+\r
+       result = device_create_file(dev, &dev_attr_earkey_online);\r
+       if (result){\r
+               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+               return result;\r
+       }\r
+\r
+       result = device_create_file(dev, &dev_attr_hdmi_online);\r
+       if (result){\r
+               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+               return result;\r
+       }\r
+\r
+       result = device_create_file(dev, &dev_attr_usb_online);\r
+       if (result){\r
+               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+               return result;\r
+       }\r
+\r
+       return 0;\r
+}\r
+\r
+\r
+static void sysfs_test_remove_file(struct device *dev) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       device_remove_file(dev, &dev_attr_charger_online);\r
+       device_remove_file(dev, &dev_attr_earjack_online);\r
+       device_remove_file(dev, &dev_attr_earkey_online);\r
+       device_remove_file(dev, &dev_attr_hdmi_online);\r
+       device_remove_file(dev, &dev_attr_usb_online);\r
+}\r
+\r
+static void sysfs_test_dev_release(struct device *dev) {}\r
+\r
+static struct platform_device the_pdev = {\r
+       .name = "jack",\r
+       .id = -1,\r
+       .dev = {\r
+               .release = sysfs_test_dev_release,\r
+       }\r
+};\r
+\r
+static int __init sysfs_test_init(void) \r
+{\r
+       int err = 0;\r
+       struct my_data *data;\r
+\r
+       printk("[%s] \n", __FUNCTION__);\r
+\r
+       err = platform_device_register(&the_pdev);\r
+       if (err) {\r
+               printk("platform_device_register error\n");\r
+               return err;\r
+       }\r
+\r
+       data = kzalloc(sizeof(struct my_data), GFP_KERNEL);\r
+       if (!data) {\r
+               printk("[%s] kzalloc error\n", __FUNCTION__);\r
+               err = -ENOMEM;\r
+               goto alloc_err;\r
+       }\r
+\r
+       dev_set_drvdata(&the_pdev.dev, (void*)data);\r
+\r
+       err = sysfs_test_create_file(&the_pdev.dev);\r
+       if (err) {\r
+               printk("sysfs_create_file error\n");\r
+               goto sysfs_err;\r
+       }\r
+\r
+       return 0;\r
+\r
+sysfs_err:\r
+       kfree(data);\r
+\r
+alloc_err:\r
+       platform_device_unregister(&the_pdev);\r
+       return err;\r
+}\r
+\r
+static void __exit sysfs_test_exit(void) \r
+{\r
+       void *data = dev_get_drvdata(&the_pdev.dev);\r
+\r
+       printk("[%s] \n", __FUNCTION__);\r
+\r
+       kfree(data);\r
+       sysfs_test_remove_file(&the_pdev.dev);\r
+       platform_device_unregister(&the_pdev);\r
+}\r
+\r
+module_init(sysfs_test_init);\r
+module_exit(sysfs_test_exit);\r
+\r
+\r
+MODULE_LICENSE("GPL");\r
+\r
+\r
diff --git a/drivers/maru/maru_power_supply.c b/drivers/maru/maru_power_supply.c
new file mode 100644 (file)
index 0000000..54ab5b4
--- /dev/null
@@ -0,0 +1,113 @@
+/*\r
+ * Virtual device node for event injector of emulator\r
+ *\r
+ * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact:\r
+ * Sungmin Ha <sungmin82.ha@samsung.com>\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
+ *\r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ */\r
+\r
+#include <linux/kernel.h>\r
+#include <linux/module.h>\r
+#include <linux/device.h>\r
+#include <linux/platform_device.h>\r
+\r
+static struct class *mtd_class;\r
+static struct device* mtd_device;\r
+\r
+static int capacity = 100;\r
+static int charge_full = 1;\r
+static int charge_now = 0;\r
+\r
+static ssize_t show_capacity(struct device *dev, struct device_attribute *attr, char *buf) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       return snprintf(buf, PAGE_SIZE, "%d", capacity);\r
+}\r
+\r
+static ssize_t store_capacity(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       sscanf(buf, "%d", &capacity);\r
+       return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_charge_full(struct device *dev, struct device_attribute *attr, char *buf) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       return snprintf(buf, PAGE_SIZE, "%d", charge_full);\r
+}\r
+\r
+static ssize_t store_charge_full(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       sscanf(buf, "%d", &charge_full);\r
+       return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_charge_now(struct device *dev, struct device_attribute *attr, char *buf) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       return snprintf(buf, PAGE_SIZE, "%d", charge_now);\r
+}\r
+\r
+static ssize_t store_charge_now(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       sscanf(buf, "%d", &charge_now);\r
+       return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static struct device_attribute ps_device_attributes[] = {\r
+       __ATTR(capacity, 0644, show_capacity, store_capacity),\r
+       __ATTR(charge_full, 0644, show_charge_full, store_charge_full),\r
+       __ATTR(charge_now, 0644, show_charge_now, store_charge_now),\r
+};\r
+\r
+struct device new_device_dev;\r
+\r
+static int __init sysfs_test_init(void) \r
+{\r
+       int err;\r
+       printk("[%s] \n", __FUNCTION__);\r
+\r
+       mtd_class = class_create(THIS_MODULE, "power_supply");\r
+       mtd_device = device_create(mtd_class, NULL, (dev_t)NULL, NULL, "battery");\r
+       \r
+       err = device_create_file(mtd_device, &ps_device_attributes[0]);\r
+       err = device_create_file(mtd_device, &ps_device_attributes[1]);\r
+       err = device_create_file(mtd_device, &ps_device_attributes[2]);\r
+\r
+       return 0;\r
+}\r
+\r
+static void __exit sysfs_test_exit(void) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       class_destroy(mtd_class);\r
+}\r
+\r
+module_init(sysfs_test_init);\r
+module_exit(sysfs_test_exit);\r
+\r
+\r
+MODULE_LICENSE("GPL");\r
+\r
+\r
diff --git a/drivers/maru/maru_usb_mass_storage.c b/drivers/maru/maru_usb_mass_storage.c
new file mode 100644 (file)
index 0000000..6a83b9f
--- /dev/null
@@ -0,0 +1,239 @@
+/*\r
+ * Virtual device node for event injector of emulator\r
+ *\r
+ * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact:\r
+ * Sungmin Ha <sungmin82.ha@samsung.com>\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
+ *\r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ */\r
+\r
+#include <linux/kernel.h>\r
+#include <linux/module.h>\r
+#include <linux/device.h>\r
+#include <linux/platform_device.h>\r
+\r
+static char mode[1024];\r
+static char file0[1024];\r
+static char file1[1024];\r
+\r
+u64 file0_mask = 0x0000000000000000;\r
+u64 file1_mask = 0x0000000000000001;\r
+\r
+struct my_data {\r
+       int no;\r
+       char test[50];\r
+};\r
+\r
+static ssize_t show_mode(struct device *dev, \r
+               struct device_attribute *attr, char *buf) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       return snprintf(buf, PAGE_SIZE, "%s", mode);\r
+}\r
+\r
+static ssize_t store_mode(struct device *dev, \r
+               struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       sscanf(buf, "%s", mode);\r
+       return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_file(struct device *dev, \r
+               struct device_attribute *attr, char *buf) \r
+{\r
+       ssize_t ret = 0;\r
+       printk("[%s] \n", __FUNCTION__);\r
+       if(*(dev->dma_mask) == file0_mask)\r
+               ret = snprintf(buf, PAGE_SIZE, "%s", file0);\r
+       else\r
+               ret = snprintf(buf, PAGE_SIZE, "%s", file1);\r
+\r
+       return ret;\r
+}\r
+\r
+static ssize_t store_file(struct device *dev, \r
+               struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+       size_t ret;\r
+       printk("[%s]\n", __FUNCTION__);\r
+       if(*(dev->dma_mask) == file0_mask)\r
+               sscanf(buf, "%s", file0);\r
+       else\r
+               sscanf(buf, "%s", file1);\r
+       \r
+       ret = strnlen(buf, PAGE_SIZE);\r
+       if(ret == 0)\r
+               return 1;\r
+       else\r
+               return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, show_mode, store_mode);\r
+static DEVICE_ATTR(file, S_IRUGO | S_IWUSR, show_file, store_file);\r
+\r
+static int sysfs_lun0_create_file(struct device *dev) \r
+{\r
+       int result = 0;\r
+\r
+       printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
+\r
+       result = device_create_file(dev, &dev_attr_mode);\r
+       if (result){\r
+               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+               return result;\r
+       }\r
+\r
+       result = device_create_file(dev, &dev_attr_file);\r
+       if (result){\r
+               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+               return result;\r
+       }\r
+\r
+       return 0;\r
+}\r
+\r
+static int sysfs_lun1_create_file(struct device *dev) \r
+{\r
+       int result = 0;\r
+\r
+       printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
+\r
+       result = device_create_file(dev, &dev_attr_file);\r
+       if (result){\r
+               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+               return result;\r
+       }\r
+\r
+       return 0;\r
+}\r
+\r
+static void sysfs_test_dev_release(struct device *dev) {}\r
+static void sysfs_test_dev_release_lun0(struct device *dev) {}\r
+\r
+static struct platform_device the_pdev = {\r
+       .name = "usb_mass_storage",\r
+       .id = -1,\r
+       .dev = {\r
+               .release = sysfs_test_dev_release,\r
+       }\r
+};\r
+\r
+static struct platform_device the_pdev_sub1 = {\r
+       .name = "lun0",\r
+       .id = -1,       \r
+       .dev = {\r
+               .release = sysfs_test_dev_release_lun0,\r
+               .parent = &the_pdev.dev,\r
+               .dma_mask = &file0_mask,\r
+       }\r
+};\r
+\r
+static struct platform_device the_pdev_sub2 = {\r
+       .name = "lun1",\r
+       .id = -1,       \r
+       .dev = {\r
+               .release = sysfs_test_dev_release_lun0,\r
+               .parent = &the_pdev.dev,\r
+               .dma_mask = &file1_mask,\r
+       }\r
+};\r
+\r
+static int __init sysfs_test_init(void) \r
+{\r
+       int err = 0;\r
+       struct my_data *data;\r
+\r
+       printk("[%s] \n", __FUNCTION__);\r
+\r
+       memset(mode, 0, sizeof(mode));\r
+       memset(file0, 0, sizeof(file0));\r
+       memset(file1, 0, sizeof(file1));\r
+\r
+       err = platform_device_register(&the_pdev);\r
+       if (err) {\r
+               printk("platform_device_register error\n");\r
+               return err;\r
+       }\r
+\r
+       err = platform_device_register(&the_pdev_sub1);\r
+       if (err) {\r
+               printk("platform_device_register error\n");\r
+               return err;\r
+       }\r
+\r
+       err = platform_device_register(&the_pdev_sub2);\r
+       if (err) {\r
+               printk("platform_device_register error\n");\r
+               return err;\r
+       }\r
+\r
+       data = kzalloc(sizeof(struct my_data), GFP_KERNEL);\r
+       if (!data) {\r
+               printk("[%s] kzalloc error\n", __FUNCTION__);\r
+               err = -ENOMEM;\r
+               goto alloc_err;\r
+       }\r
+\r
+       dev_set_drvdata(&the_pdev.dev, (void*)data);\r
+       dev_set_drvdata(&the_pdev_sub1.dev, (void*)data);\r
+       dev_set_drvdata(&the_pdev_sub2.dev, (void*)data);\r
+\r
+       err = sysfs_lun0_create_file(&the_pdev_sub1.dev);\r
+       if (err) {\r
+               printk("sysfs_create_file error\n");\r
+               goto sysfs_err;\r
+       }\r
+       \r
+       err = sysfs_lun1_create_file(&the_pdev_sub2.dev);\r
+       if (err) {\r
+               printk("sysfs_create_file error\n");\r
+               goto sysfs_err;\r
+       }\r
+\r
+       return 0;\r
+\r
+sysfs_err:\r
+       kfree(data);\r
+\r
+alloc_err:\r
+       platform_device_unregister(&the_pdev);\r
+       return err;\r
+}\r
+\r
+static void __exit sysfs_test_exit(void) \r
+{\r
+       void *data = dev_get_drvdata(&the_pdev.dev);\r
+\r
+       printk("[%s] \n", __FUNCTION__);\r
+\r
+       kfree(data);\r
+       platform_device_unregister(&the_pdev_sub2);\r
+       platform_device_unregister(&the_pdev_sub1);\r
+       platform_device_unregister(&the_pdev);\r
+}\r
+\r
+module_init(sysfs_test_init);\r
+module_exit(sysfs_test_exit);\r
+\r
+\r
+MODULE_LICENSE("GPL");\r
+\r
+\r
diff --git a/drivers/maru/maru_usb_mode.c b/drivers/maru/maru_usb_mode.c
new file mode 100644 (file)
index 0000000..c2a3520
--- /dev/null
@@ -0,0 +1,143 @@
+/*\r
+ * Virtual device node for event injector of emulator\r
+ *\r
+ * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact:\r
+ * Sungmin Ha <sungmin82.ha@samsung.com>\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
+ *\r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ */\r
+\r
+#include <linux/kernel.h>\r
+#include <linux/module.h>\r
+#include <linux/device.h>\r
+#include <linux/platform_device.h>\r
+\r
+int UsbMenuSel = 0;\r
+\r
+struct my_data {\r
+       int no;\r
+       char test[50];\r
+};\r
+\r
+static ssize_t show_UsbMenuSel(struct device *dev, \r
+               struct device_attribute *attr, char *buf) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       return snprintf(buf, PAGE_SIZE, "%d", UsbMenuSel);\r
+}\r
+\r
+static ssize_t store_UsbMenuSel(struct device *dev, \r
+               struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       sscanf(buf, "%d", &UsbMenuSel);\r
+       return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static DEVICE_ATTR(UsbMenuSel, S_IRUGO | S_IWUSR, show_UsbMenuSel, store_UsbMenuSel);\r
+\r
+static int sysfs_test_create_file(struct device *dev) \r
+{\r
+       int result = 0;\r
+\r
+       printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
+\r
+       result = device_create_file(dev, &dev_attr_UsbMenuSel);\r
+       if (result){\r
+               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+               return result;\r
+       }\r
+\r
+       return 0;\r
+}\r
+\r
+\r
+static void sysfs_test_remove_file(struct device *dev) \r
+{\r
+       printk("[%s] \n", __FUNCTION__);\r
+       device_remove_file(dev, &dev_attr_UsbMenuSel);\r
+}\r
+\r
+static void sysfs_test_dev_release(struct device *dev) {}\r
+\r
+static struct platform_device the_pdev = {\r
+       .name = "usb_mode",\r
+       .id = -1,\r
+       .dev = {\r
+               .release = sysfs_test_dev_release,\r
+       }\r
+};\r
+\r
+static int __init sysfs_test_init(void) \r
+{\r
+       int err = 0;\r
+       struct my_data *data;\r
+\r
+       printk("[%s] \n", __FUNCTION__);\r
+\r
+       err = platform_device_register(&the_pdev);\r
+       if (err) {\r
+               printk("platform_device_register error\n");\r
+               return err;\r
+       }\r
+\r
+       data = kzalloc(sizeof(struct my_data), GFP_KERNEL);\r
+       if (!data) {\r
+               printk("[%s] kzalloc error\n", __FUNCTION__);\r
+               err = -ENOMEM;\r
+               goto alloc_err;\r
+       }\r
+\r
+       dev_set_drvdata(&the_pdev.dev, (void*)data);\r
+\r
+       err = sysfs_test_create_file(&the_pdev.dev);\r
+       if (err) {\r
+               printk("sysfs_create_file error\n");\r
+               goto sysfs_err;\r
+       }\r
+\r
+       return 0;\r
+\r
+sysfs_err:\r
+       kfree(data);\r
+\r
+alloc_err:\r
+       platform_device_unregister(&the_pdev);\r
+       return err;\r
+}\r
+\r
+static void __exit sysfs_test_exit(void) \r
+{\r
+       void *data = dev_get_drvdata(&the_pdev.dev);\r
+\r
+       printk("[%s] \n", __FUNCTION__);\r
+\r
+       kfree(data);\r
+       sysfs_test_remove_file(&the_pdev.dev);\r
+       platform_device_unregister(&the_pdev);\r
+}\r
+\r
+module_init(sysfs_test_init);\r
+module_exit(sysfs_test_exit);\r
+\r
+\r
+MODULE_LICENSE("GPL");\r
+\r
+\r
diff --git a/drivers/power_supply/Kconfig b/drivers/power_supply/Kconfig
deleted file mode 100644 (file)
index 6e49e2a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Character device configuration
-#
-
-menu "Character devices"
-
-source "drivers/power_supply/Kconfig"
-
-config POWER_SUPPLY
-       "power supply"
-
-
-endmenu
-
diff --git a/drivers/power_supply/Makefile b/drivers/power_supply/Makefile
deleted file mode 100644 (file)
index e8ed866..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-$(CONFIG_POWER_SUPPLY)     += mod_power_supply.o
diff --git a/drivers/power_supply/mod_power_supply.c b/drivers/power_supply/mod_power_supply.c
deleted file mode 100644 (file)
index 54ab5b4..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*\r
- * Virtual device node for event injector of emulator\r
- *\r
- * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact:\r
- * Sungmin Ha <sungmin82.ha@samsung.com>\r
- *\r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
- *\r
- * Contributors:\r
- * - S-Core Co., Ltd\r
- */\r
-\r
-#include <linux/kernel.h>\r
-#include <linux/module.h>\r
-#include <linux/device.h>\r
-#include <linux/platform_device.h>\r
-\r
-static struct class *mtd_class;\r
-static struct device* mtd_device;\r
-\r
-static int capacity = 100;\r
-static int charge_full = 1;\r
-static int charge_now = 0;\r
-\r
-static ssize_t show_capacity(struct device *dev, struct device_attribute *attr, char *buf) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       return snprintf(buf, PAGE_SIZE, "%d", capacity);\r
-}\r
-\r
-static ssize_t store_capacity(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       sscanf(buf, "%d", &capacity);\r
-       return strnlen(buf, PAGE_SIZE);\r
-}\r
-\r
-static ssize_t show_charge_full(struct device *dev, struct device_attribute *attr, char *buf) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       return snprintf(buf, PAGE_SIZE, "%d", charge_full);\r
-}\r
-\r
-static ssize_t store_charge_full(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       sscanf(buf, "%d", &charge_full);\r
-       return strnlen(buf, PAGE_SIZE);\r
-}\r
-\r
-static ssize_t show_charge_now(struct device *dev, struct device_attribute *attr, char *buf) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       return snprintf(buf, PAGE_SIZE, "%d", charge_now);\r
-}\r
-\r
-static ssize_t store_charge_now(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       sscanf(buf, "%d", &charge_now);\r
-       return strnlen(buf, PAGE_SIZE);\r
-}\r
-\r
-static struct device_attribute ps_device_attributes[] = {\r
-       __ATTR(capacity, 0644, show_capacity, store_capacity),\r
-       __ATTR(charge_full, 0644, show_charge_full, store_charge_full),\r
-       __ATTR(charge_now, 0644, show_charge_now, store_charge_now),\r
-};\r
-\r
-struct device new_device_dev;\r
-\r
-static int __init sysfs_test_init(void) \r
-{\r
-       int err;\r
-       printk("[%s] \n", __FUNCTION__);\r
-\r
-       mtd_class = class_create(THIS_MODULE, "power_supply");\r
-       mtd_device = device_create(mtd_class, NULL, (dev_t)NULL, NULL, "battery");\r
-       \r
-       err = device_create_file(mtd_device, &ps_device_attributes[0]);\r
-       err = device_create_file(mtd_device, &ps_device_attributes[1]);\r
-       err = device_create_file(mtd_device, &ps_device_attributes[2]);\r
-\r
-       return 0;\r
-}\r
-\r
-static void __exit sysfs_test_exit(void) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       class_destroy(mtd_class);\r
-}\r
-\r
-module_init(sysfs_test_init);\r
-module_exit(sysfs_test_exit);\r
-\r
-\r
-MODULE_LICENSE("GPL");\r
-\r
-\r
diff --git a/drivers/usb_mass_storage/Kconfig b/drivers/usb_mass_storage/Kconfig
deleted file mode 100644 (file)
index a9e26ad..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Character device configuration
-#
-
-menu "Character devices"
-
-source "drivers/usb_mass_storage/Kconfig"
-
-config USB_MASS_STORAGE
-       "usb mass storage"
-
-
-endmenu
diff --git a/drivers/usb_mass_storage/Makefile b/drivers/usb_mass_storage/Makefile
deleted file mode 100644 (file)
index 026cbbd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y += mod_usb_mass_storage.o
diff --git a/drivers/usb_mass_storage/mod_usb_mass_storage.c b/drivers/usb_mass_storage/mod_usb_mass_storage.c
deleted file mode 100644 (file)
index 6a83b9f..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-/*\r
- * Virtual device node for event injector of emulator\r
- *\r
- * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact:\r
- * Sungmin Ha <sungmin82.ha@samsung.com>\r
- *\r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
- *\r
- * Contributors:\r
- * - S-Core Co., Ltd\r
- */\r
-\r
-#include <linux/kernel.h>\r
-#include <linux/module.h>\r
-#include <linux/device.h>\r
-#include <linux/platform_device.h>\r
-\r
-static char mode[1024];\r
-static char file0[1024];\r
-static char file1[1024];\r
-\r
-u64 file0_mask = 0x0000000000000000;\r
-u64 file1_mask = 0x0000000000000001;\r
-\r
-struct my_data {\r
-       int no;\r
-       char test[50];\r
-};\r
-\r
-static ssize_t show_mode(struct device *dev, \r
-               struct device_attribute *attr, char *buf) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       return snprintf(buf, PAGE_SIZE, "%s", mode);\r
-}\r
-\r
-static ssize_t store_mode(struct device *dev, \r
-               struct device_attribute *attr, const char *buf, size_t count) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       sscanf(buf, "%s", mode);\r
-       return strnlen(buf, PAGE_SIZE);\r
-}\r
-\r
-static ssize_t show_file(struct device *dev, \r
-               struct device_attribute *attr, char *buf) \r
-{\r
-       ssize_t ret = 0;\r
-       printk("[%s] \n", __FUNCTION__);\r
-       if(*(dev->dma_mask) == file0_mask)\r
-               ret = snprintf(buf, PAGE_SIZE, "%s", file0);\r
-       else\r
-               ret = snprintf(buf, PAGE_SIZE, "%s", file1);\r
-\r
-       return ret;\r
-}\r
-\r
-static ssize_t store_file(struct device *dev, \r
-               struct device_attribute *attr, const char *buf, size_t count) \r
-{\r
-       size_t ret;\r
-       printk("[%s]\n", __FUNCTION__);\r
-       if(*(dev->dma_mask) == file0_mask)\r
-               sscanf(buf, "%s", file0);\r
-       else\r
-               sscanf(buf, "%s", file1);\r
-       \r
-       ret = strnlen(buf, PAGE_SIZE);\r
-       if(ret == 0)\r
-               return 1;\r
-       else\r
-               return strnlen(buf, PAGE_SIZE);\r
-}\r
-\r
-static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, show_mode, store_mode);\r
-static DEVICE_ATTR(file, S_IRUGO | S_IWUSR, show_file, store_file);\r
-\r
-static int sysfs_lun0_create_file(struct device *dev) \r
-{\r
-       int result = 0;\r
-\r
-       printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
-\r
-       result = device_create_file(dev, &dev_attr_mode);\r
-       if (result){\r
-               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
-               return result;\r
-       }\r
-\r
-       result = device_create_file(dev, &dev_attr_file);\r
-       if (result){\r
-               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
-               return result;\r
-       }\r
-\r
-       return 0;\r
-}\r
-\r
-static int sysfs_lun1_create_file(struct device *dev) \r
-{\r
-       int result = 0;\r
-\r
-       printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
-\r
-       result = device_create_file(dev, &dev_attr_file);\r
-       if (result){\r
-               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
-               return result;\r
-       }\r
-\r
-       return 0;\r
-}\r
-\r
-static void sysfs_test_dev_release(struct device *dev) {}\r
-static void sysfs_test_dev_release_lun0(struct device *dev) {}\r
-\r
-static struct platform_device the_pdev = {\r
-       .name = "usb_mass_storage",\r
-       .id = -1,\r
-       .dev = {\r
-               .release = sysfs_test_dev_release,\r
-       }\r
-};\r
-\r
-static struct platform_device the_pdev_sub1 = {\r
-       .name = "lun0",\r
-       .id = -1,       \r
-       .dev = {\r
-               .release = sysfs_test_dev_release_lun0,\r
-               .parent = &the_pdev.dev,\r
-               .dma_mask = &file0_mask,\r
-       }\r
-};\r
-\r
-static struct platform_device the_pdev_sub2 = {\r
-       .name = "lun1",\r
-       .id = -1,       \r
-       .dev = {\r
-               .release = sysfs_test_dev_release_lun0,\r
-               .parent = &the_pdev.dev,\r
-               .dma_mask = &file1_mask,\r
-       }\r
-};\r
-\r
-static int __init sysfs_test_init(void) \r
-{\r
-       int err = 0;\r
-       struct my_data *data;\r
-\r
-       printk("[%s] \n", __FUNCTION__);\r
-\r
-       memset(mode, 0, sizeof(mode));\r
-       memset(file0, 0, sizeof(file0));\r
-       memset(file1, 0, sizeof(file1));\r
-\r
-       err = platform_device_register(&the_pdev);\r
-       if (err) {\r
-               printk("platform_device_register error\n");\r
-               return err;\r
-       }\r
-\r
-       err = platform_device_register(&the_pdev_sub1);\r
-       if (err) {\r
-               printk("platform_device_register error\n");\r
-               return err;\r
-       }\r
-\r
-       err = platform_device_register(&the_pdev_sub2);\r
-       if (err) {\r
-               printk("platform_device_register error\n");\r
-               return err;\r
-       }\r
-\r
-       data = kzalloc(sizeof(struct my_data), GFP_KERNEL);\r
-       if (!data) {\r
-               printk("[%s] kzalloc error\n", __FUNCTION__);\r
-               err = -ENOMEM;\r
-               goto alloc_err;\r
-       }\r
-\r
-       dev_set_drvdata(&the_pdev.dev, (void*)data);\r
-       dev_set_drvdata(&the_pdev_sub1.dev, (void*)data);\r
-       dev_set_drvdata(&the_pdev_sub2.dev, (void*)data);\r
-\r
-       err = sysfs_lun0_create_file(&the_pdev_sub1.dev);\r
-       if (err) {\r
-               printk("sysfs_create_file error\n");\r
-               goto sysfs_err;\r
-       }\r
-       \r
-       err = sysfs_lun1_create_file(&the_pdev_sub2.dev);\r
-       if (err) {\r
-               printk("sysfs_create_file error\n");\r
-               goto sysfs_err;\r
-       }\r
-\r
-       return 0;\r
-\r
-sysfs_err:\r
-       kfree(data);\r
-\r
-alloc_err:\r
-       platform_device_unregister(&the_pdev);\r
-       return err;\r
-}\r
-\r
-static void __exit sysfs_test_exit(void) \r
-{\r
-       void *data = dev_get_drvdata(&the_pdev.dev);\r
-\r
-       printk("[%s] \n", __FUNCTION__);\r
-\r
-       kfree(data);\r
-       platform_device_unregister(&the_pdev_sub2);\r
-       platform_device_unregister(&the_pdev_sub1);\r
-       platform_device_unregister(&the_pdev);\r
-}\r
-\r
-module_init(sysfs_test_init);\r
-module_exit(sysfs_test_exit);\r
-\r
-\r
-MODULE_LICENSE("GPL");\r
-\r
-\r
diff --git a/drivers/usb_mode/Kconfig b/drivers/usb_mode/Kconfig
deleted file mode 100644 (file)
index 20670eb..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Character device configuration
-#
-
-menu "Character devices"
-
-source "drivers/usb_mode/Kconfig"
-
-config USB_MODE
-       "usb_mode"
-
-
-endmenu
diff --git a/drivers/usb_mode/Makefile b/drivers/usb_mode/Makefile
deleted file mode 100644 (file)
index e2917a4..0000000
+++ /dev/null
@@ -1 +0,0 @@
-obj-y += mod_usb_mode.o
diff --git a/drivers/usb_mode/mod_usb_mode.c b/drivers/usb_mode/mod_usb_mode.c
deleted file mode 100644 (file)
index c2a3520..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*\r
- * Virtual device node for event injector of emulator\r
- *\r
- * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact:\r
- * Sungmin Ha <sungmin82.ha@samsung.com>\r
- *\r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
- *\r
- * Contributors:\r
- * - S-Core Co., Ltd\r
- */\r
-\r
-#include <linux/kernel.h>\r
-#include <linux/module.h>\r
-#include <linux/device.h>\r
-#include <linux/platform_device.h>\r
-\r
-int UsbMenuSel = 0;\r
-\r
-struct my_data {\r
-       int no;\r
-       char test[50];\r
-};\r
-\r
-static ssize_t show_UsbMenuSel(struct device *dev, \r
-               struct device_attribute *attr, char *buf) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       return snprintf(buf, PAGE_SIZE, "%d", UsbMenuSel);\r
-}\r
-\r
-static ssize_t store_UsbMenuSel(struct device *dev, \r
-               struct device_attribute *attr, const char *buf, size_t count) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       sscanf(buf, "%d", &UsbMenuSel);\r
-       return strnlen(buf, PAGE_SIZE);\r
-}\r
-\r
-static DEVICE_ATTR(UsbMenuSel, S_IRUGO | S_IWUSR, show_UsbMenuSel, store_UsbMenuSel);\r
-\r
-static int sysfs_test_create_file(struct device *dev) \r
-{\r
-       int result = 0;\r
-\r
-       printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
-\r
-       result = device_create_file(dev, &dev_attr_UsbMenuSel);\r
-       if (result){\r
-               printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
-               return result;\r
-       }\r
-\r
-       return 0;\r
-}\r
-\r
-\r
-static void sysfs_test_remove_file(struct device *dev) \r
-{\r
-       printk("[%s] \n", __FUNCTION__);\r
-       device_remove_file(dev, &dev_attr_UsbMenuSel);\r
-}\r
-\r
-static void sysfs_test_dev_release(struct device *dev) {}\r
-\r
-static struct platform_device the_pdev = {\r
-       .name = "usb_mode",\r
-       .id = -1,\r
-       .dev = {\r
-               .release = sysfs_test_dev_release,\r
-       }\r
-};\r
-\r
-static int __init sysfs_test_init(void) \r
-{\r
-       int err = 0;\r
-       struct my_data *data;\r
-\r
-       printk("[%s] \n", __FUNCTION__);\r
-\r
-       err = platform_device_register(&the_pdev);\r
-       if (err) {\r
-               printk("platform_device_register error\n");\r
-               return err;\r
-       }\r
-\r
-       data = kzalloc(sizeof(struct my_data), GFP_KERNEL);\r
-       if (!data) {\r
-               printk("[%s] kzalloc error\n", __FUNCTION__);\r
-               err = -ENOMEM;\r
-               goto alloc_err;\r
-       }\r
-\r
-       dev_set_drvdata(&the_pdev.dev, (void*)data);\r
-\r
-       err = sysfs_test_create_file(&the_pdev.dev);\r
-       if (err) {\r
-               printk("sysfs_create_file error\n");\r
-               goto sysfs_err;\r
-       }\r
-\r
-       return 0;\r
-\r
-sysfs_err:\r
-       kfree(data);\r
-\r
-alloc_err:\r
-       platform_device_unregister(&the_pdev);\r
-       return err;\r
-}\r
-\r
-static void __exit sysfs_test_exit(void) \r
-{\r
-       void *data = dev_get_drvdata(&the_pdev.dev);\r
-\r
-       printk("[%s] \n", __FUNCTION__);\r
-\r
-       kfree(data);\r
-       sysfs_test_remove_file(&the_pdev.dev);\r
-       platform_device_unregister(&the_pdev);\r
-}\r
-\r
-module_init(sysfs_test_init);\r
-module_exit(sysfs_test_exit);\r
-\r
-\r
-MODULE_LICENSE("GPL");\r
-\r
-\r