Move common macro to device-common
authorlokilee73 <changjoo.lee@samsung.com>
Wed, 10 Feb 2021 07:36:51 +0000 (16:36 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Mon, 15 Feb 2021 01:52:51 +0000 (10:52 +0900)
Change-Id: Ic4d75bb9a108499193a812202e3987a7fc95bc96
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
23 files changed:
hw/battery/CMakeLists.txt
hw/battery/battery.c
hw/board/CMakeLists.txt
hw/board/board.c
hw/common/common.h [deleted file]
hw/display/CMakeLists.txt
hw/display/display.c
hw/external_connection/CMakeLists.txt
hw/external_connection/external_connection.c
hw/haptic/CMakeLists.txt
hw/haptic/standard.c
hw/ir/CMakeLists.txt
hw/ir/ir.c
hw/led/CMakeLists.txt
hw/led/led.c
hw/thermal/CMakeLists.txt
hw/thermal/thermal.c
hw/touchscreen/CMakeLists.txt
hw/touchscreen/touchscreen.c
hw/udev.c
hw/usb_gadget/CMakeLists.txt
hw/usb_gadget/usb_gadget.c
packaging/device-manager-plugin-sc7730.spec

index 3649f142afec1a065b90585a12541e44851573ac..5a9f80cf39d7a505b99da9614abbfda31d5c4c78 100644 (file)
@@ -3,10 +3,8 @@ PROJECT(hal-backend-device-battery C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-INCLUDE_DIRECTORIES(../common)
-
 INCLUDE(FindPkgConfig)
-pkg_check_modules(hal-backend-device-battery_pkgs REQUIRED dlog glib-2.0 libudev)
+pkg_check_modules(hal-backend-device-battery_pkgs REQUIRED hal-backend-device-common glib-2.0 libudev)
 
 FOREACH(flag ${hal-backend-device-battery_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 7dde825f088fc604fd34bae161900c056db2fe1e..525add28f46903c8177ff0c8364ffb568ea8c0cb 100644 (file)
@@ -28,7 +28,8 @@
 #include <hal/hal-common-interface.h>
 #include <libsyscommon/file.h>
 
-#include "common.h"
+#include </hal/include/device/hal-backend-common.h>
+
 #include "../udev.h"
 
 #define BATTERY_ROOT_PATH "/sys/class/power_supply"
index b18358f5672835f99f207f1a9015d8996eda6955..de3acea9a55e024e5347a8976cd50844d2d0f119 100644 (file)
@@ -3,10 +3,8 @@ PROJECT(hal-backend-device-board C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-INCLUDE_DIRECTORIES(../common)
-
 INCLUDE(FindPkgConfig)
-pkg_check_modules(hal-backend-device-board_pkgs REQUIRED dlog)
+pkg_check_modules(hal-backend-device-board_pkgs REQUIRED hal-backend-device-common)
 
 FOREACH(flag ${hal-backend-device-board_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 8e0a8e35a0a4f39e040d4114643cf8ab764f54d5..7b1c384ff70aee95536a34bea1be91dc2e4e1a3d 100644 (file)
@@ -23,7 +23,7 @@
 #include <errno.h>
 #include <string.h>
 
-#include "common.h"
+#include </hal/include/device/hal-backend-common.h>
 
 #define DATA_BUFF_MAX  256
 
diff --git a/hw/common/common.h b/hw/common/common.h
deleted file mode 100644 (file)
index 37ce972..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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 __HAL_BACKEND_COMMON_H__
-#define __HAL_BACKEND_COMMON_H__
-
-#ifdef FEATURE_DLOG
-    #define LOG_TAG "HAL_BACKEND_DEVICE"
-    #include <dlog.h>
-    #define _D(fmt, args...)    SLOGD(fmt, ##args)
-    #define _I(fmt, args...)    SLOGI(fmt, ##args)
-    #define _W(fmt, args...)    SLOGW(fmt, ##args)
-    #define _E(fmt, args...)    SLOGE(fmt, ##args)
-#else
-    #define _D(x, ...)
-    #define _I(x, ...)
-    #define _W(x, ...)
-    #define _E(x, ...)
-#endif
-
-#define EXPORT __attribute__ ((visibility("default")))
-
-#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
-
-#endif /* __HAL_BACKEND_COMMON_H__ */
index 49eee926ff8c00fc8ad4ddebcda8c4f0a670cd20..116adfa1e95c2b97f26190ec0593c7c799b956a4 100644 (file)
@@ -3,10 +3,8 @@ PROJECT(hal-backend-device-display C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-INCLUDE_DIRECTORIES(../common)
-
 INCLUDE(FindPkgConfig)
-pkg_check_modules(hal-backend-device-display_pkgs REQUIRED dlog)
+pkg_check_modules(hal-backend-device-display_pkgs REQUIRED hal-backend-device-common)
 
 FOREACH(flag ${hal-backend-device-display_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 2ad1f537b18d38d9211f5f9b9365529f52238d56..108b8a7537723c39d5470e6178d9a679c004b278 100644 (file)
@@ -26,7 +26,8 @@
 #include <hal/device/hal-display-interface.h>
 #include <hal/hal-common-interface.h>
 #include <libsyscommon/file.h>
-#include "common.h"
+
+#include </hal/include/device/hal-backend-common.h>
 
 #ifndef BACKLIGHT_PATH
 #define BACKLIGHT_PATH  "/sys/class/backlight/panel"
index 6f3c189e21fb75f2ab747bccc04916fda597dcd1..de0c5e8603695468b10fa375effd33f2c076728a 100644 (file)
@@ -3,10 +3,8 @@ PROJECT(hal-backend-device-external-connection C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-INCLUDE_DIRECTORIES(../common)
-
 INCLUDE(FindPkgConfig)
-pkg_check_modules(hal-backend-device-external-connection_pkgs REQUIRED dlog glib-2.0 libudev)
+pkg_check_modules(hal-backend-device-external-connection_pkgs REQUIRED hal-backend-device-common glib-2.0 libudev)
 
 FOREACH(flag ${hal-backend-device-external-connection_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 5acee31b55ca73c8db21d7674427abb2bf46bda0..ffcc7a54f74e6fd5d5668de8815392473c5c1500 100644 (file)
@@ -27,7 +27,8 @@
 #include <hal/device/hal-external_connection-interface.h>
 #include <hal/hal-common-interface.h>
 
-#include "common.h"
+#include </hal/include/device/hal-backend-common.h>
+
 #include "../udev.h"
 
 #define SWITCH_ROOT_PATH "/sys/devices/virtual/switch"
index 3fb9057e72ad00bf79db2e280c64a05ba2521f11..2f2812a6180e0e2078f8707304fe810eff07214c 100644 (file)
@@ -3,11 +3,9 @@ PROJECT(hal-backend-device-haptic C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-INCLUDE_DIRECTORIES(../common)
-
 INCLUDE(FindPkgConfig)
 pkg_check_modules(haptic_pkgs REQUIRED
-               dlog
+               hal-backend-device-common
                glib-2.0
                libsyscommon)
 
index 123ae6c028a9986b06ceffb5bf3ca45349fb71c8..5e4f2935b6efcb8a38f8f7c8641a474f6df48c95 100644 (file)
@@ -31,7 +31,7 @@
 #include <libsyscommon/list.h>
 #include <hal/device/hal-haptic-interface.h>
 
-#include "common.h"
+#include </hal/include/device/hal-backend-common.h>
 
 #define MAX_MAGNITUDE                  0xFFFF
 #define PERIODIC_MAX_MAGNITUDE 0x7FFF  /* 0.5 * MAX_MAGNITUDE */
index 4478493be9170fd5950d53321c7c874e642b9699..d7f70f5d5d1273253845a945920d7e69ab3dc14a 100644 (file)
@@ -1,10 +1,8 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(hal-backend-device-ir C)
 
-INCLUDE_DIRECTORIES(../common)
-
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED dlog)
+pkg_check_modules(pkgs REQUIRED hal-backend-device-common)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 3442fb82f253332d6739376231884b2627502f9c..79d9d6526ab5ce56e11cf330b8f6891573a1a553 100644 (file)
@@ -29,7 +29,7 @@
 #include <hal/hal-common-interface.h>
 #include <libsyscommon/file.h>
 
-#include "common.h"
+#include </hal/include/device/hal-backend-common.h>
 
 #define IRLED_CONTROL_PATH "/sys/class/sec/sec_ir/ir_send"
 
index 9457c9af9eb2b1f0543b9fbce88bc89e8218d4db..f3ab22dfa0b4a991e47b0c96236aca7d8b749f17 100644 (file)
@@ -1,10 +1,8 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(hal-backend-device-led C)
 
-INCLUDE_DIRECTORIES(../common)
-
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED dlog)
+pkg_check_modules(pkgs REQUIRED hal-backend-device-common)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index e8c65492f05f1f9a1f2d5c2c13b2cc51acfcf23b..f41a07f7f49053668f0c87e17ac46c65dbd42304 100644 (file)
@@ -27,7 +27,7 @@
 #include <hal/hal-common-interface.h>
 #include <libsyscommon/file.h>
 
-#include "common.h"
+#include </hal/include/device/hal-backend-common.h>
 
 #ifndef CAMERA_BACK_PATH
 #define CAMERA_BACK_PATH    "/sys/class/leds/torch-sec1"
index 990ebdd96aeead9285878c2623098ee6549d4502..197833c7642af091298ca5b19a502be99ccd17ff 100644 (file)
@@ -3,10 +3,8 @@ PROJECT(hal-backend-device-thermal C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-INCLUDE_DIRECTORIES(../common)
-
 INCLUDE(FindPkgConfig)
-pkg_check_modules(hal-backend-device-thermal_pkgs REQUIRED dlog glib-2.0)
+pkg_check_modules(hal-backend-device-thermal_pkgs REQUIRED hal-backend-device-common glib-2.0)
 
 FOREACH(flag ${hal-backend-device-thermal_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 294a3bb2ea7eb036d1ed1220b85d8bc36577eb30..65c276944701fb105126a27fc7c7b7b01036501b 100644 (file)
@@ -26,7 +26,7 @@
 #include <hal/device/hal-thermal-interface.h>
 #include <hal/hal-common-interface.h>
 
-#include "common.h"
+#include </hal/include/device/hal-backend-common.h>
 
 #define AP_PATH "/sys/class/sec/temperature/ap_therm"
 #define BATTERY_PATH "/sys/class/sec/temperature/batt_therm"
index dbfa733af16532ed1d1878fdf04302a0d7027c3f..e18741e41a34ca43efcbe27317e45ec742f92366 100644 (file)
@@ -3,10 +3,8 @@ PROJECT(hal-backend-device-touchscreen C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-INCLUDE_DIRECTORIES(../common)
-
 INCLUDE(FindPkgConfig)
-pkg_check_modules(hal-backend-device-touchscreen_pkgs REQUIRED dlog)
+pkg_check_modules(hal-backend-device-touchscreen_pkgs REQUIRED hal-backend-device-common)
 
 FOREACH(flag ${hal-backend-device-touchscreen_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index af45ab04abc7b753b029d9d08d384ecd59be8574..319c37c61d743bb9e6472c6c62909c608d109d9a 100644 (file)
@@ -28,7 +28,7 @@
 #include <hal/hal-common-interface.h>
 #include <libsyscommon/file.h>
 
-#include "common.h"
+#include </hal/include/device/hal-backend-common.h>
 
 #define INPUT_PATH      "/sys/class/input/"
 #define KEY_CAPABILITIES_PATH  "/device/capabilities/key"
index 91d1aa2e2a107c23a7346b07a2d1ccb98dc0646b..b843b3183b2a3d11961c6670051640d4f7b9f778 100644 (file)
--- a/hw/udev.c
+++ b/hw/udev.c
 #include <libudev.h>
 #include <glib.h>
 #include <string.h>
-#include "common.h"
 #include "udev.h"
 
+#include </hal/include/device/hal-backend-common.h>
+
 #define EVENT_KERNEL       "kernel"
 #define EVENT_UDEV         "udev"
 
index 35e615ed7b7c081e7212c5540b463a8ea2d1a6f2..7146f9274aec0423e685fc811f867d2dd81b01f6 100644 (file)
@@ -3,10 +3,8 @@ PROJECT(hal-backend-device-usb-gadget C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-INCLUDE_DIRECTORIES(../common)
-
 INCLUDE(FindPkgConfig)
-pkg_check_modules(hal-backend-device-usb-gadget_pkgs REQUIRED dlog hal-backend-device-common)
+pkg_check_modules(hal-backend-device-usb-gadget_pkgs REQUIRED hal-backend-device-common)
 
 FOREACH(flag ${hal-backend-device-usb-gadget_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index f3089dca83af83612e0ee718b4f11aaa367a68f9..67c91a1f717a900427c750f64f29a98d5d5e0c7e 100644 (file)
@@ -21,8 +21,7 @@
 #include <hal/device/hal-usb_gadget-interface.h>
 
 #include </hal/include/device/hal-backend-common-usb_gadget.h>
-
-#include "common.h"
+#include </hal/include/device/hal-backend-common.h>
 
 static int usb_gadget_init(void **data)
 {
index db7e9cd3e7c70a56d3e725e5ed653b7cf2e56679..0c7e67bddeab898f787bb624ca8d1c1735035096 100644 (file)
@@ -9,7 +9,6 @@ Source1:    %{name}.manifest
 Requires(post):   /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 BuildRequires:  cmake
-BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(libudev)
 BuildRequires:  pkgconfig(hal-api-common)