Remove cpu
authorlokilee73 <changjoo.lee@samsung.com>
Mon, 18 Jan 2021 10:05:00 +0000 (19:05 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Mon, 18 Jan 2021 10:05:05 +0000 (19:05 +0900)
Change-Id: Ie762ac7347869ce9cb0f9ab0032db112b24d5512
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
CMakeLists.txt
hw/cpu/CMakeLists.txt [deleted file]
hw/cpu/cpu.c [deleted file]

index 6e928e8..7617286 100644 (file)
@@ -12,7 +12,6 @@ IF(ENABLE_DLOG STREQUAL on)
 ENDIF()
 
 ADD_SUBDIRECTORY(hw/battery)
-ADD_SUBDIRECTORY(hw/cpu)
 ADD_SUBDIRECTORY(hw/display)
 ADD_SUBDIRECTORY(hw/led)
 ADD_SUBDIRECTORY(hw/external_connection)
diff --git a/hw/cpu/CMakeLists.txt b/hw/cpu/CMakeLists.txt
deleted file mode 100644 (file)
index 5d80083..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(cpu C)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED dlog hwcommon)
-
-FOREACH(flag ${pkgs_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-
-ADD_LIBRARY(${PROJECT_NAME} MODULE cpu.c)
-SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}/hw COMPONENT RuntimeLibraries)
diff --git a/hw/cpu/cpu.c b/hw/cpu/cpu.c
deleted file mode 100644 (file)
index d98117e..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * device-node
- *
- * Copyright (c) 2016 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 requcpued 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.
- */
-
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <pthread.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <linux/types.h>
-#include <linux/un.h>
-
-#include <hw/cpu.h>
-#include <hw/shared.h>
-
-#define CPU_BOOST_SOCKET_FOR_SCENARIO    "/dev/socket/scenario_info"
-#define BUF_MAX 128
-
-static int cpu_boost_send_socket(char *write_buf)
-{
-       int socket_fd = 0;
-       int ret = 0;
-       struct sockaddr_un addr;
-
-       if (access(CPU_BOOST_SOCKET_FOR_SCENARIO, F_OK) != 0) {
-               _E("CPU boot socket does not exist");
-               return -ENOTSUP;
-       }
-
-       socket_fd = socket(AF_LOCAL, SOCK_STREAM, 0);
-       if (socket_fd < 0) {
-               _E("Failed to get socket fd");
-               return -ENOMEM;
-       }
-
-       memset(&addr, 0, sizeof(addr));
-       snprintf(addr.sun_path, UNIX_PATH_MAX, "%s", CPU_BOOST_SOCKET_FOR_SCENARIO);
-       addr.sun_family = AF_LOCAL;
-
-       ret = connect(socket_fd, (struct sockaddr *)&addr,
-                       sizeof(sa_family_t) + sizeof(CPU_BOOST_SOCKET_FOR_SCENARIO) );
-       if (ret != 0) {
-               ret = -errno;
-               _E("Failed to connect to socket(%d)", ret);
-               close(socket_fd);
-               return ret;
-       }
-
-       ret = send(socket_fd, write_buf, strlen(write_buf), MSG_NOSIGNAL);
-       close(socket_fd);
-       if (ret < 0) {
-               ret = -errno;
-               _E("Failed to send scenario (%s) (%d)", write_buf, ret);
-               return ret;
-       }
-
-       return 0;
-}
-
-static int cpu_start_boost(void *data)
-{
-       char *scenario = data;
-       char buf[BUF_MAX];
-
-       snprintf(buf, sizeof(buf), "%sLock", scenario);
-       return cpu_boost_send_socket(buf);
-}
-
-static int cpu_stop_boost(void *data)
-{
-       char *scenario = data;
-       char buf[BUF_MAX];
-
-       snprintf(buf, sizeof(buf), "%sUnlock", scenario);
-       return cpu_boost_send_socket(buf);
-}
-
-static int cpu_open(struct hw_info *info,
-               const char *id, struct hw_common **common)
-{
-       struct cpu_device *cpu_dev;
-
-       if (!info || !common)
-               return -EINVAL;
-
-       cpu_dev = calloc(1, sizeof(struct cpu_device));
-       if (!cpu_dev)
-               return -ENOMEM;
-
-       cpu_dev->common.info = info;
-       cpu_dev->start_boost = cpu_start_boost;
-       cpu_dev->stop_boost = cpu_stop_boost;
-
-       *common = (struct hw_common *)cpu_dev;
-       return 0;
-}
-
-static int cpu_close(struct hw_common *common)
-{
-       if (!common)
-               return -EINVAL;
-
-       free(common);
-       return 0;
-}
-
-HARDWARE_MODULE_STRUCTURE = {
-       .magic = HARDWARE_INFO_TAG,
-       .hal_version = HARDWARE_INFO_VERSION,
-       .device_version = CPU_HARDWARE_DEVICE_VERSION,
-       .id = CPU_HARDWARE_DEVICE_ID,
-       .name = "cpu",
-       .open = cpu_open,
-       .close = cpu_close,
-};