display: add dummy HAL for unified deviced 01/170801/1 accepted/tizen/unified/20180223.062113 submit/tizen/20180223.015425
authorINSUN PYO <insun.pyo@samsung.com>
Thu, 22 Feb 2018 07:31:34 +0000 (16:31 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Thu, 22 Feb 2018 07:33:45 +0000 (16:33 +0900)
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I0822e7be4015f96429e04c06b78fcf23a45665f8

CMakeLists.txt
hw/display/CMakeLists.txt [new file with mode: 0755]
hw/display/display.c [new file with mode: 0755]

index 14ad48e1732e872fe00d89b322d8ccb51c3c05cd..4858e216b3b1581b044191b35902e7713d93af59 100644 (file)
@@ -3,5 +3,6 @@ PROJECT(device-manager-odroid C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
+ADD_SUBDIRECTORY(hw/display)
 ADD_SUBDIRECTORY(hw/usb_gadget)
 ADD_SUBDIRECTORY(hw/usb_client)
diff --git a/hw/display/CMakeLists.txt b/hw/display/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..ebccfbe
--- /dev/null
@@ -0,0 +1,19 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(display C)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(display_pkgs REQUIRED hwcommon dlog)
+
+FOREACH(flag ${display_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 display.c ../shared.c)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${display_pkgs_LDFLAGS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}/hw COMPONENT RuntimeLibraries)
diff --git a/hw/display/display.c b/hw/display/display.c
new file mode 100755 (executable)
index 0000000..8869ec9
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * device-node
+ *
+ * Copyright (c) 2015 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.
+ */
+
+#include <stdio.h>
+#include <errno.h>
+#include <hw/display.h>
+
+static int display_open(struct hw_info *info,
+               const char *id, struct hw_common **common)
+{
+       if (!info || !common)
+               return -EINVAL;
+
+       *common = NULL;
+       return 0;
+}
+
+static int display_close(struct hw_common *common)
+{
+       if (common) /* we use NULL display_dev */
+               return -EINVAL;
+
+       return 0;
+}
+
+HARDWARE_MODULE_STRUCTURE = {
+       .magic = HARDWARE_INFO_TAG,
+       .hal_version = HARDWARE_INFO_VERSION,
+       .device_version = DISPLAY_HARDWARE_DEVICE_VERSION,
+       .id = DISPLAY_HARDWARE_DEVICE_ID,
+       .name = "Display",
+       .open = display_open,
+       .close = display_close,
+};