deviced: Remove unnecessary modules like factory, csc and testmode 62/37662/2
authorJiyoung Yun <jy910.yun@samsung.com>
Thu, 2 Apr 2015 04:21:39 +0000 (13:21 +0900)
committerJiyoung Yun <jy910.yun@samsung.com>
Fri, 3 Apr 2015 04:57:21 +0000 (13:57 +0900)
Change-Id: I566e9a04a4b255e30c24c37e2bb8a047e96ba73b
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
src/battery/power-supply.c
src/core/device-change-handler.c
src/core/device-handler.h
src/display/key-filter.c
src/earjack/earjack.c
src/shared/dbus.h

index eb45968..8a33925 100644 (file)
@@ -485,7 +485,6 @@ static void check_online(void)
                old_online = VCONFKEY_SYSMAN_CHARGER_CONNECTED;
                vconf_set_int(VCONFKEY_SYSMAN_CHARGER_STATUS, old_online);
                power_supply_broadcast(CHARGER_STATUS_SIGNAL, old_online);
-               extcon_set_count(EXTCON_TA);
                check_power_supply(old_online);
        } else if (battery.online <= POWER_SUPPLY_TYPE_BATTERY &&
            old_online == VCONFKEY_SYSMAN_CHARGER_CONNECTED) {
index 9881dcb..781df51 100644 (file)
@@ -156,108 +156,6 @@ static const struct udev_subsystem {
 
 static dd_list *udev_event_list;
 
-static struct extcon_device {
-       const enum extcon_type type;
-       const char *str;
-       int fd;
-       int count;
-} extcon_devices[] = {
-       { EXTCON_TA, "/csa/factory/batt_cable_count", 0, 0},
-       { EXTCON_EARJACK, "/csa/factory/earjack_count", 0, 0},
-};
-
-int extcon_set_count(int index)
-{
-       int r;
-       int ret = 0;
-       char buf[BUFF_MAX];
-
-       extcon_devices[index].count++;
-
-       if (extcon_devices[index].fd < 0) {
-               _E("cannot open file(%s)", extcon_devices[index].str);
-               return -ENOENT;
-       }
-       lseek(extcon_devices[index].fd, 0, SEEK_SET);
-       _I("ext(%d) count %d", index, extcon_devices[index].count);
-       snprintf(buf, sizeof(buf), "%d", extcon_devices[index].count);
-
-       r = write(extcon_devices[index].fd, buf, strlen(buf));
-       if (r < 0)
-               ret = -EIO;
-       return ret;
-}
-
-static int extcon_get_count(int index)
-{
-       int fd;
-       int r;
-       int ret = 0;
-       char buf[BUFF_MAX];
-
-       fd = open(extcon_devices[index].str, O_RDWR);
-       if (fd < 0)
-               return -ENOENT;
-
-       r = read(fd, buf, BUFF_MAX);
-       if ((r >= 0) && (r < BUFF_MAX))
-               buf[r] = '\0';
-       else
-               ret = -EIO;
-
-       if (ret != 0) {
-               close(fd);
-               return ret;
-       }
-       extcon_devices[index].fd = fd;
-       extcon_devices[index].count = atoi(buf);
-       _I("get extcon(%d:%x) count %d",
-               index, extcon_devices[index].fd, extcon_devices[index].count);
-
-       return ret;
-}
-
-static int extcon_create_count(int index)
-{
-       int fd;
-       int r;
-       int ret = 0;
-       char buf[BUFF_MAX];
-       fd = open(extcon_devices[index].str, O_RDWR | O_CREAT, 0644);
-       if (fd < 0) {
-               _E("cannot open file(%s)", extcon_devices[index].str);
-               return -ENOENT;
-       }
-       snprintf(buf, sizeof(buf), "%d", extcon_devices[index].count);
-       r = write(fd, buf, strlen(buf));
-       if (r < 0)
-               ret = -EIO;
-
-       if (ret != 0) {
-               close(fd);
-               _E("cannot write file(%s)", extcon_devices[index].str);
-               return ret;
-       }
-       extcon_devices[index].fd = fd;
-       _I("create extcon(%d:%x) %s",
-               index, extcon_devices[index].fd, extcon_devices[index].str);
-       return ret;
-}
-
-static int extcon_count_init(void)
-{
-       int i;
-       int ret = 0;
-       for (i = 0; i < ARRAY_SIZE(extcon_devices); i++) {
-               if (extcon_get_count(i) >= 0)
-                       continue;
-               ret = extcon_create_count(i);
-               if (ret < 0)
-                       break;
-       }
-       return ret;
-}
-
 int get_usb_state_direct(void)
 {
        FILE *fp;
@@ -1155,8 +1053,6 @@ static void device_change_init(void *data)
 {
        int ret;
 
-       if (extcon_count_init() != 0)
-               _E("fail to init extcon files");
        register_notifier(DEVICE_NOTIFIER_POWEROFF, device_change_poweroff);
        register_notifier(DEVICE_NOTIFIER_BOOTING_DONE, booting_done);
        register_notifier(DEVICE_NOTIFIER_LCD, display_changed);
@@ -1183,16 +1079,9 @@ static void device_change_init(void *data)
 
 static void device_change_exit(void *data)
 {
-       int i;
        unregister_notifier(DEVICE_NOTIFIER_POWEROFF, device_change_poweroff);
        unregister_notifier(DEVICE_NOTIFIER_BOOTING_DONE, booting_done);
        unregister_notifier(DEVICE_NOTIFIER_LCD, display_changed);
-       for (i = 0; i < ARRAY_SIZE(extcon_devices); i++) {
-               if (extcon_devices[i].fd <= 0)
-                       continue;
-               close(extcon_devices[i].fd);
-       }
-
 }
 
 static const struct device_ops change_device_ops = {
index 30d83c5..dcf0e6d 100644 (file)
 
 #include "common.h"
 
-enum extcon_type {
-       EXTCON_TA = 0,
-       EXTCON_EARJACK,
-};
-
 enum dock_type {
        DOCK_NONE       = 0,
        DOCK_SOUND      = 7,
 };
 
-#define CONNECTED(val) ((val) != 0)
-
-int extcon_set_count(int index);
-
 int get_usb_state_direct(void);
 
 void sync_cradle_status(void);
index 23573a1..fa95a5b 100644 (file)
@@ -70,9 +70,6 @@
 #define SIGNAL_LCDON_BY_POWERKEY       "LCDOnByPowerkey"
 #define SIGNAL_LCDOFF_BY_POWERKEY      "LCDOffByPowerkey"
 
-#define NORMAL_POWER(val)              (val == 0)
-#define KEY_TEST_MODE_POWER(val)       (val == 2)
-
 #define TOUCH_RELEASE          (-1)
 
 #ifndef VCONFKEY_SETAPPL_TOUCHKEY_LIGHT_DURATION
@@ -142,17 +139,7 @@ static void longkey_pressed()
                return;
        }
 
-       ret = vconf_get_int(VCONFKEY_TESTMODE_POWER_OFF_POPUP, &val);
-       if (ret != 0 || NORMAL_POWER(val)) {
-               opt = PWROFF_POPUP_ACT;
-               goto entry_call;
-       }
-       if (KEY_TEST_MODE_POWER(val)) {
-               _I("skip power off control during factory key test mode");
-               return;
-       }
        opt = POWEROFF_ACT;
-entry_call:
        power_execute(opt);
 }
 
index c454745..40742d3 100644 (file)
@@ -77,10 +77,8 @@ static void earjack_chgdet_cb(void *data)
        _I("jack - earjack changed %d", val);
        vconf_set_int(VCONFKEY_SYSMAN_EARJACK, val);
        earjack_send_broadcast(val);
-       if (CONNECTED(val)) {
-               extcon_set_count(EXTCON_EARJACK);
+       if (val != 0)
                internal_pm_change_state(LCD_NORMAL);
-       }
 }
 
 static DBusMessage *dbus_get_status(E_DBus_Object *obj, DBusMessage *msg)
@@ -107,11 +105,8 @@ static void earjack_init(void *data)
 {
        int ret, val;
 
-       if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_EARJACK_ONLINE, &val) == 0) {
-               if (CONNECTED(val))
-                       extcon_set_count(EXTCON_EARJACK);
+       if (device_get_property(DEVICE_TYPE_EXTCON, PROP_EXTCON_EARJACK_ONLINE, &val) == 0)
                vconf_set_int(VCONFKEY_SYSMAN_EARJACK, val);
-       }
 
        /* init dbus interface */
        ret = register_edbus_method(DEVICED_PATH_SYSNOTI, edbus_methods, ARRAY_SIZE(edbus_methods));
index f4b04b8..2976cb3 100644 (file)
 /* Time service */
 #define DEVICED_PATH_TIME                DEVICED_OBJECT_PATH"/Time"
 #define DEVICED_INTERFACE_TIME           DEVICED_INTERFACE_NAME".Time"
-/* Board service */
-#define DEVICED_PATH_BOARD                DEVICED_OBJECT_PATH"/Board"
-#define DEVICED_INTERFACE_BOARD           DEVICED_INTERFACE_NAME".Board"
-/* Testmode service */
-#define DEVICED_PATH_TESTMODE               DEVICED_OBJECT_PATH"/Testmode"
-#define DEVICED_INTERFACE_TESTMODE           DEVICED_INTERFACE_NAME".Testmode"
 
 /* Apps service */
 #define DEVICED_PATH_APPS               DEVICED_OBJECT_PATH"/Apps"