Enable configfs/functionfs for USB gadget 87/218587/3 accepted/tizen/unified/20191127.020257 submit/tizen/20191126.032220
authorHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 26 Nov 2019 02:24:04 +0000 (11:24 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 26 Nov 2019 02:55:04 +0000 (11:55 +0900)
Change-Id: Ie125c11343b391ad957e79c3ca4979b46e91d6ac
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
CMakeLists.txt
hw/usb_cfs_client/CMakeLists.txt [new file with mode: 0644]
hw/usb_cfs_client/usb_cfs_client.c [new file with mode: 0644]
packaging/device-manager-plugin-tw3.spec

index fb224ba..9e699eb 100644 (file)
@@ -9,6 +9,7 @@ ADD_SUBDIRECTORY(hw/external_connection)
 ADD_SUBDIRECTORY(hw/touchscreen)
 ADD_SUBDIRECTORY(hw/usb_gadget)
 ADD_SUBDIRECTORY(hw/usb_client)
+ADD_SUBDIRECTORY(hw/usb_cfs_client)
 ADD_SUBDIRECTORY(hw/thermal)
 ADD_SUBDIRECTORY(hw/bezel)
-ADD_SUBDIRECTORY(hw/touchsensitivity)
\ No newline at end of file
+ADD_SUBDIRECTORY(hw/touchsensitivity)
diff --git a/hw/usb_cfs_client/CMakeLists.txt b/hw/usb_cfs_client/CMakeLists.txt
new file mode 100644 (file)
index 0000000..70b054d
--- /dev/null
@@ -0,0 +1,19 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(usb_cfs_client C)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(usb_cfs_client_pkgs REQUIRED hwcommon dlog glib-2.0 libusbgx)
+
+FOREACH(flag ${usb_cfs_client_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 usb_cfs_client.c)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${usb_cfs_client_pkgs_LDFLAGS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}/hw COMPONENT RuntimeLibraries)
diff --git a/hw/usb_cfs_client/usb_cfs_client.c b/hw/usb_cfs_client/usb_cfs_client.c
new file mode 100644 (file)
index 0000000..36da551
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * 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 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 <hw/usb_client.h>
+
+HARDWARE_MODULE_STRUCTURE = {
+       .magic = HARDWARE_INFO_TAG,
+       .hal_version = HARDWARE_INFO_VERSION,
+       .device_version = USB_CLIENT_HARDWARE_DEVICE_VERSION,
+       .id = USB_CFS_CLIENT_HARDWARE_DEVICE_ID,
+       .name = "cfs-gadget",
+       .open = hw_cfs_gadget_open,
+       .close = hw_cfs_gadget_close,
+};
index f8385e6..5cc7a17 100644 (file)
@@ -10,6 +10,7 @@ BuildRequires:    cmake
 BuildRequires:    pkgconfig(dlog)
 BuildRequires:    pkgconfig(hwcommon)
 BuildRequires:    pkgconfig(glib-2.0)
+BuildRequires:    pkgconfig(libusbgx)
 BuildRequires:    pkgconfig(libudev)
 BuildRequires:    pkgconfig(capi-system-info)
 Requires(post):   /sbin/ldconfig