summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorINSUN PYO <insun.pyo@samsung.com>2018-02-22 16:31:34 +0900
committerINSUN PYO <insun.pyo@samsung.com>2018-02-22 16:33:45 +0900
commit83e5a7f3d004f48850d08510622840e5e3776ac7 (patch)
tree7920a9ed289de0ae53f0d3ecbc6eb4a2556d0f27
parent8e9553eb8f68f7bb6670b157ae68cb8ec7b93fd2 (diff)
downloaddevice-manager-plugin-odroid-83e5a7f3d004f48850d08510622840e5e3776ac7.tar.gz
device-manager-plugin-odroid-83e5a7f3d004f48850d08510622840e5e3776ac7.tar.bz2
device-manager-plugin-odroid-83e5a7f3d004f48850d08510622840e5e3776ac7.zip
Signed-off-by: INSUN PYO <insun.pyo@samsung.com> Change-Id: I0822e7be4015f96429e04c06b78fcf23a45665f8
-rw-r--r--CMakeLists.txt1
-rwxr-xr-xhw/display/CMakeLists.txt19
-rwxr-xr-xhw/display/display.c49
3 files changed, 69 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 14ad48e..4858e21 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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
index 0000000..ebccfbe
--- /dev/null
+++ b/hw/display/CMakeLists.txt
@@ -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
index 0000000..8869ec9
--- /dev/null
+++ b/hw/display/display.c
@@ -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,
+};