From d400a894320f5bd83fdc8c34935ba4c334d4be6f Mon Sep 17 00:00:00 2001 From: lokilee73 Date: Wed, 10 Feb 2021 20:31:30 +0900 Subject: Move common macro to device-common Change-Id: I9f3265c8b99d8fe2cd2d937292bcf0418204cb57 Signed-off-by: lokilee73 --- hw/battery/CMakeLists.txt | 4 +-- hw/battery/battery.c | 3 ++- hw/bezel/CMakeLists.txt | 4 +-- hw/bezel/bezel.c | 2 +- hw/common/common.h | 38 ---------------------------- hw/display/CMakeLists.txt | 4 +-- hw/display/display.c | 2 +- hw/external_connection/CMakeLists.txt | 4 +-- hw/external_connection/external_connection.c | 3 ++- hw/haptic/CMakeLists.txt | 6 ++--- hw/haptic/standard.c | 2 +- hw/thermal/CMakeLists.txt | 4 +-- hw/thermal/thermal.c | 2 +- hw/touchscreen/CMakeLists.txt | 4 +-- hw/touchscreen/touchscreen.c | 2 +- hw/udev.c | 4 ++- hw/usb_gadget/CMakeLists.txt | 4 +-- hw/usb_gadget/usb_gadget.c | 2 +- packaging/device-manager-plugin-tw3.spec | 1 - 19 files changed, 22 insertions(+), 73 deletions(-) delete mode 100644 hw/common/common.h diff --git a/hw/battery/CMakeLists.txt b/hw/battery/CMakeLists.txt index 3649f14..60387df 100644 --- a/hw/battery/CMakeLists.txt +++ b/hw/battery/CMakeLists.txt @@ -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 glib-2.0 libudev hal-backend-device-common) FOREACH(flag ${hal-backend-device-battery_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") diff --git a/hw/battery/battery.c b/hw/battery/battery.c index e573bd1..64987fe 100644 --- a/hw/battery/battery.c +++ b/hw/battery/battery.c @@ -28,7 +28,8 @@ #include #include -#include "common.h" +#include + #include "../udev.h" #define BATTERY_ROOT_PATH "/sys/class/power_supply" diff --git a/hw/bezel/CMakeLists.txt b/hw/bezel/CMakeLists.txt index ab190af..d09ef4c 100644 --- a/hw/bezel/CMakeLists.txt +++ b/hw/bezel/CMakeLists.txt @@ -3,10 +3,8 @@ PROJECT(hal-backend-device-bezel C) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -INCLUDE_DIRECTORIES(../common) - INCLUDE(FindPkgConfig) -pkg_check_modules(hal-backend-device-bezel_pkgs REQUIRED dlog) +pkg_check_modules(hal-backend-device-bezel_pkgs REQUIRED hal-backend-device-common) FOREACH(flag ${hal-backend-device-bezel_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") diff --git a/hw/bezel/bezel.c b/hw/bezel/bezel.c index 5cbc2f7..a6f32f5 100644 --- a/hw/bezel/bezel.c +++ b/hw/bezel/bezel.c @@ -28,7 +28,7 @@ #include #include -#include "common.h" +#include #define INPUT_PATH "/sys/class/input/" #define KEY_CAPABILITIES_PATH "/device/capabilities/key" diff --git a/hw/common/common.h b/hw/common/common.h deleted file mode 100644 index 37ce972..0000000 --- a/hw/common/common.h +++ /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 - #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__ */ diff --git a/hw/display/CMakeLists.txt b/hw/display/CMakeLists.txt index df86ec5..c10dfdd 100644 --- a/hw/display/CMakeLists.txt +++ b/hw/display/CMakeLists.txt @@ -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 capi-system-info) +pkg_check_modules(hal-backend-device-display_pkgs REQUIRED capi-system-info hal-backend-device-common) FOREACH(flag ${hal-backend-device-display_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") diff --git a/hw/display/display.c b/hw/display/display.c index e39d38b..77f3348 100644 --- a/hw/display/display.c +++ b/hw/display/display.c @@ -28,7 +28,7 @@ #include #include -#include "common.h" +#include #define MODEL_NAME "http://tizen.org/system/model_name" diff --git a/hw/external_connection/CMakeLists.txt b/hw/external_connection/CMakeLists.txt index 6f3c189..7366aee 100644 --- a/hw/external_connection/CMakeLists.txt +++ b/hw/external_connection/CMakeLists.txt @@ -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 glib-2.0 libudev hal-backend-device-common) FOREACH(flag ${hal-backend-device-external-connection_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") diff --git a/hw/external_connection/external_connection.c b/hw/external_connection/external_connection.c index c22d1aa..925f8da 100644 --- a/hw/external_connection/external_connection.c +++ b/hw/external_connection/external_connection.c @@ -27,7 +27,8 @@ #include #include -#include "common.h" +#include + #include "../udev.h" #define SWITCH_ROOT_PATH "/sys/devices/virtual/switch" diff --git a/hw/haptic/CMakeLists.txt b/hw/haptic/CMakeLists.txt index 3fb9057..a1a21dc 100644 --- a/hw/haptic/CMakeLists.txt +++ b/hw/haptic/CMakeLists.txt @@ -3,13 +3,11 @@ PROJECT(hal-backend-device-haptic C) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -INCLUDE_DIRECTORIES(../common) - INCLUDE(FindPkgConfig) pkg_check_modules(haptic_pkgs REQUIRED - dlog glib-2.0 - libsyscommon) + libsyscommon + hal-backend-device-common) FOREACH(flag ${haptic_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") diff --git a/hw/haptic/standard.c b/hw/haptic/standard.c index d30b12b..23f5f3b 100644 --- a/hw/haptic/standard.c +++ b/hw/haptic/standard.c @@ -31,7 +31,7 @@ #include #include -#include "common.h" +#include #define MAX_MAGNITUDE 0xFFFF #define PERIODIC_MAX_MAGNITUDE 0x7FFF /* 0.5 * MAX_MAGNITUDE */ diff --git a/hw/thermal/CMakeLists.txt b/hw/thermal/CMakeLists.txt index 990ebdd..2db3ea4 100644 --- a/hw/thermal/CMakeLists.txt +++ b/hw/thermal/CMakeLists.txt @@ -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 glib-2.0 hal-backend-device-common) FOREACH(flag ${hal-backend-device-thermal_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") diff --git a/hw/thermal/thermal.c b/hw/thermal/thermal.c index 279ce1e..0daf0a7 100644 --- a/hw/thermal/thermal.c +++ b/hw/thermal/thermal.c @@ -26,7 +26,7 @@ #include #include -#include "common.h" +#include #define AP_PATH "/sys/class/sec/temperature/ap_therm" #define BATTERY_PATH "/sys/class/sec/temperature/batt_therm" diff --git a/hw/touchscreen/CMakeLists.txt b/hw/touchscreen/CMakeLists.txt index dbfa733..e18741e 100644 --- a/hw/touchscreen/CMakeLists.txt +++ b/hw/touchscreen/CMakeLists.txt @@ -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}") diff --git a/hw/touchscreen/touchscreen.c b/hw/touchscreen/touchscreen.c index 73a3597..c8e46c9 100644 --- a/hw/touchscreen/touchscreen.c +++ b/hw/touchscreen/touchscreen.c @@ -28,7 +28,7 @@ #include #include -#include "common.h" +#include #define INPUT_PATH "/sys/class/input/" #define KEY_CAPABILITIES_PATH "/device/capabilities/key" diff --git a/hw/udev.c b/hw/udev.c index 91d1aa2..099f4d1 100644 --- a/hw/udev.c +++ b/hw/udev.c @@ -23,9 +23,11 @@ #include #include #include -#include "common.h" + #include "udev.h" +#include + #define EVENT_KERNEL "kernel" #define EVENT_UDEV "udev" diff --git a/hw/usb_gadget/CMakeLists.txt b/hw/usb_gadget/CMakeLists.txt index 35e615e..7146f92 100644 --- a/hw/usb_gadget/CMakeLists.txt +++ b/hw/usb_gadget/CMakeLists.txt @@ -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}") diff --git a/hw/usb_gadget/usb_gadget.c b/hw/usb_gadget/usb_gadget.c index f54eddf..bcaa2ae 100644 --- a/hw/usb_gadget/usb_gadget.c +++ b/hw/usb_gadget/usb_gadget.c @@ -22,7 +22,7 @@ #include -#include "common.h" +#include static int usb_gadget_init(void **data) { diff --git a/packaging/device-manager-plugin-tw3.spec b/packaging/device-manager-plugin-tw3.spec index 3760dbf..73cd5c7 100644 --- a/packaging/device-manager-plugin-tw3.spec +++ b/packaging/device-manager-plugin-tw3.spec @@ -7,7 +7,6 @@ License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Source1: %{name}.manifest BuildRequires: cmake -BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(libusbgx) BuildRequires: pkgconfig(libudev) -- cgit v1.2.3