extcon: remove unused extcon count 38/276738/1
authorYoungjae Cho <y0.cho@samsung.com>
Fri, 24 Jun 2022 01:05:40 +0000 (10:05 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Fri, 24 Jun 2022 01:05:40 +0000 (10:05 +0900)
Change-Id: I8d666e031338dd05db478b033ecf757a23971785
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/battery/power-supply.c
src/extcon/earjack.c
src/extcon/extcon-count.h [deleted file]
src/extcon/extcon.c
src/extcon/extcon.h
src/shared/device-notifier.c
src/shared/device-notifier.h

index dea6007e35a63990b49456c286dc08d7d5168336..672410e92414eaf3ea5419d5faafb7ef013ca833 100644 (file)
@@ -655,45 +655,6 @@ static void check_temperature_status(const char *env_value)
        battery.temperature = atoi(env_value) / 10;
 }
 
-static void update_capacity_full(void)
-{
-       static int old;
-       int delta;
-
-       if (battery.charger_connected == 0 ||
-               old == 0 ||
-           old >= battery.capacity) {
-               old = battery.capacity;
-               return;
-       }
-       delta = battery.capacity - old;
-       old = battery.capacity;
-       extcon_update_count(EXTCON_BATTERY_FULL, delta);
-}
-
-static void update_battery_cycle(void)
-{
-       static int first = 1;
-       static int old;
-       int delta;
-
-       if (first) {
-               first = 0;
-               extcon_update_count(EXTCON_BATTERY_CYCLE, 0);
-               return;
-       }
-
-       if (battery.charger_connected == 1 ||
-           old == 0 ||
-           old <= battery.capacity) {
-               old = battery.capacity;
-               return;
-       }
-       delta = old - battery.capacity;
-       old = battery.capacity;
-       extcon_update_count(EXTCON_BATTERY_CYCLE, delta);
-}
-
 static void process_power_supply(void *data)
 {
        bool broadcasted = true;
@@ -809,8 +770,6 @@ static void process_power_supply(void *data)
                device_notify(DEVICE_NOTIFIER_BATTERY_CHARGING, &battery.charge_now);
                old_battery.charge_now = battery.charge_now;
        }
-       update_capacity_full();
-       update_battery_cycle();
 
        if (disp_plgn->pm_unlock_internal) {
                if (ret_lock == 0) {
index adce49331d1092658aeccb6fc2b6687c0e014dda..bc154cb36b73f6ab068f2a0a7eb76a1deb52f1e1 100644 (file)
@@ -81,8 +81,6 @@ static int earjack_update(const char *index, int status)
        if (status != EARJACK_DICONNECTED) {
                if (disp_plgn->pm_change_internal)
                        disp_plgn->pm_change_internal(INTERNAL_LOCK_EARJACK, LCD_NORMAL);
-
-               extcon_update_count(EXTCON_EARJACK, 1);
        }
 
        return 0;
diff --git a/src/extcon/extcon-count.h b/src/extcon/extcon-count.h
deleted file mode 100644 (file)
index 74d28d1..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * deviced
- *
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __EXTCON_COUNT_H__
-#define __EXTCON_COUNT_H__
-
-#include "shared/common.h"
-
-typedef enum {
-       EXTCON_TA                       = 0,
-       EXTCON_EARJACK,
-       EXTCON_BATTERY_FULL,
-       EXTCON_BATTERY_CYCLE,
-} extcon_index_type_e;
-
-struct extcon_notifier {
-       extcon_index_type_e index;
-       unsigned long count;
-};
-
-#endif /* __EXTCON_COUNT_H__ */
index 5e163deab3c2aae9c4ba55a743ef97ec2100c0aa..2da37b4e66a627a39d3ce1cb19a22e36234c578f 100644 (file)
@@ -86,15 +86,6 @@ int extcon_get_status(const char *name)
        return dev->status;
 }
 
-void extcon_update_count(extcon_index_type_e index, unsigned long count)
-{
-       struct extcon_notifier extcon;
-       extcon.index = index;
-       extcon.count = count;
-
-       device_notify(DEVICE_NOTIFIER_EXTCON_COUNT, (void *)&extcon);
-}
-
 static int extcon_update(const char *name, const char *index, const char *value)
 {
        struct extcon_ops *dev;
index 4747d0cac288c6b72ac5038f1de7aa0c7a97b74a..77247b020bf1aba4af21062a788134db950580d1 100644 (file)
@@ -23,7 +23,6 @@
 #include "shared/common.h"
 #include <libsyscommon/list.h>
 #include <hal/device/hal-external_connection.h>
-#include "extcon-count.h"
 
 /**
  * Extcon cable name is shared with kernel extcon class.
@@ -94,5 +93,4 @@ void remove_extcon(struct extcon_ops *dev);
 int extcon_get_status(const char *name);
 int extcon_enable_device(const char *name);
 int extcon_disable_device(const char *name);
-void extcon_update_count(extcon_index_type_e index, unsigned long count);
 #endif /* __EXTCON_H__ */
index 61cd1c2a974cf52d4ba4d38db5a1fb4cabafae7e..e2ea3c1d82b696a4684dff8d29eb95a682017dca 100644 (file)
@@ -90,7 +90,6 @@ static const char *device_notifier_type_str[DEVICE_NOTIFIER_MAX] = {
        NOTIFY_STR(DEVICE_NOTIFIER_BEZEL_WAKEUP),
        NOTIFY_STR(DEVICE_NOTIFIER_DISPLAY_BRIGHTNESS),
        NOTIFY_STR(DEVICE_NOTIFIER_ULTRAPOWERSAVING),
-       NOTIFY_STR(DEVICE_NOTIFIER_EXTCON_COUNT),
        NOTIFY_STR(DEVICE_NOTIFIER_KEY_PRESS),
        NOTIFY_STR(DEVICE_NOTIFIER_KEY_RELEASE),
        NOTIFY_STR(DEVICE_NOTIFIER_EVENT_ACQUIRE_WAKELOCK),
index bd1880a9da31c8aacdeef2feb8f4e067f05ffa8d..2dabc45803b21aa6b419870f767f87f00d02b8bd 100644 (file)
@@ -63,7 +63,6 @@ enum device_notifier_type {
        DEVICE_NOTIFIER_BEZEL_WAKEUP,
        DEVICE_NOTIFIER_DISPLAY_BRIGHTNESS,
        DEVICE_NOTIFIER_ULTRAPOWERSAVING,
-       DEVICE_NOTIFIER_EXTCON_COUNT,
        DEVICE_NOTIFIER_KEY_PRESS,
        DEVICE_NOTIFIER_KEY_RELEASE,
        DEVICE_NOTIFIER_EVENT_ACQUIRE_WAKELOCK,