diff options
author | Youngjae Cho <y0.cho@samsung.com> | 2022-04-13 14:16:53 +0900 |
---|---|---|
committer | Youngjae Cho <y0.cho@samsung.com> | 2022-04-13 14:21:19 +0900 |
commit | 89692646e567c8d4b224131a638ccfd787743c21 (patch) | |
tree | 9d0a166d9ec0ad9f7e7ce0d45d1e8177beea88eb | |
parent | fcd74b5c503da2091a9d68580b7d0f66c6c6f963 (diff) | |
download | device-generic-tizen_7.0_hotfix.tar.gz device-generic-tizen_7.0_hotfix.tar.bz2 device-generic-tizen_7.0_hotfix.zip |
usb-gadget: move usb-gadget to devicedtizen_8.0_m2_releasetizen_7.0_m2_releasesubmit/tizen/20220525.001052accepted/tizen/unified/20220526.144203accepted/tizen/8.0/unified/20231005.094447accepted/tizen/7.0/unified/hotfix/20221116.110401accepted/tizen/7.0/unified/20221110.060429tizen_8.0tizen_7.0_hotfixtizen_7.0accepted/tizen_8.0_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unified
Change-Id: I93a83c1ceba137030a0a450cda1a68d042a3de8f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | hw/usb_gadget/CMakeLists.txt | 21 | ||||
-rw-r--r-- | hw/usb_gadget/usb_gadget.c | 81 | ||||
-rw-r--r-- | packaging/hal-backend-device-generic.spec | 1 |
4 files changed, 0 insertions, 105 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e3d4ba..14c1604 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,5 +10,3 @@ IF(ENABLE_DLOG STREQUAL on) ENDIF() INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.Apache-2.0 DESTINATION ${HAL_LICENSE_DIR}/${PROJECT_NAME}) - -ADD_SUBDIRECTORY(hw/usb_gadget) diff --git a/hw/usb_gadget/CMakeLists.txt b/hw/usb_gadget/CMakeLists.txt deleted file mode 100644 index 9e6b6fa..0000000 --- a/hw/usb_gadget/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(hal-backend-device-usb-gadget C) - -SET(PREFIX ${CMAKE_INSTALL_PREFIX}) - -INCLUDE(FindPkgConfig) -pkg_check_modules(hal-backend-device-usb-gadget_pkgs REQUIRED - hal-api-common - hal-api-device - hal-backend-device-common) - -FOREACH(flag ${hal-backend-device-usb-gadget_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_gadget.c) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-usb-gadget_pkgs_LDFLAGS}) -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries) diff --git a/hw/usb_gadget/usb_gadget.c b/hw/usb_gadget/usb_gadget.c deleted file mode 100644 index b2f5ce1..0000000 --- a/hw/usb_gadget/usb_gadget.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2022 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 <errno.h> -#include <stdlib.h> - -#include <hal/hal-common-interface.h> -#include <hal/device/hal-usb_gadget-interface.h> - -#include </hal/include/device/hal-backend-common-usb_gadget.h> -#include </hal/include/device/hal-backend-common.h> - -static int usb_gadget_init(void **data) -{ - hal_backend_usb_gadget_funcs *usb_gadget_funcs; - - if (!data) - return -EINVAL; - - usb_gadget_funcs = calloc(1, sizeof(hal_backend_usb_gadget_funcs)); - if (!usb_gadget_funcs) - return -ENOMEM; - - // usb_gadget_translator - if (simple_translator_open(usb_gadget_funcs)) { - _E("No USB gadget translator"); - goto error_translator_open; - } - - // usb_client - if (hw_cfs_gadget_open(usb_gadget_funcs)) { - _I("No USB client"); - goto error_gadget_open; - } - - *data = (void *)usb_gadget_funcs; - - return 0; - -error_gadget_open: - simple_translator_close(usb_gadget_funcs); - -error_translator_open: - free(usb_gadget_funcs); - - return -ENODEV; -} - -static int usb_gadget_exit(void *data) -{ - hal_backend_usb_gadget_funcs *usb_gadget_funcs = (hal_backend_usb_gadget_funcs *)data; - - if (usb_gadget_funcs) { - hw_cfs_gadget_close(usb_gadget_funcs); - simple_translator_close(usb_gadget_funcs); - free(usb_gadget_funcs); - } - - return 0; -} - -hal_backend EXPORT hal_backend_device_usb_gadget_data = { - .name = "usb_gadget", - .vendor = "Generic", - .abi_version = HAL_ABI_VERSION_TIZEN_7_0, - .init = usb_gadget_init, - .exit = usb_gadget_exit, -}; diff --git a/packaging/hal-backend-device-generic.spec b/packaging/hal-backend-device-generic.spec index 82cba51..25318a5 100644 --- a/packaging/hal-backend-device-generic.spec +++ b/packaging/hal-backend-device-generic.spec @@ -37,6 +37,5 @@ make %{?jobs:-j%jobs} /sbin/ldconfig %files -%{_hal_libdir}/*.so* %manifest %{name}.manifest %{_hal_licensedir}/%{name}/LICENSE.Apache-2.0 |