--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(usb_gadget C)
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(usb_gadget_pkgs REQUIRED hwcommon)
+
+FOREACH(flag ${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 ../shared.c)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${usb_gadget_pkgs_LDFLAGS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}/hw COMPONENT RuntimeLibraries)
--- /dev/null
+/*
+ * libdevice-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.
+ */
+
+#ifndef __HW_USB_GADGET_SIMPLE_TRANSLATOR_H__
+
+#include <hw/usb_gadget.h>
+
+#include <stdlib.h>
+#include <errno.h>
+
+#define zalloc(amount) calloc(1, amount)
+
+static void simple_cleanup_gadget(struct usb_gadget *gadget)
+{
+}
+
+static int simple_id_to_gadget(struct usb_gadget_id *gadget_id,
+ struct usb_gadget **_gadget)
+{
+ return -ENOTSUP;
+}
+
+static int simple_translator_open(struct hw_info *info,
+ const char *id, struct hw_common **common)
+{
+ struct usb_gadget_translator *simple_translator;
+
+ if (!info || !common)
+ return -EINVAL;
+
+ simple_translator = zalloc(sizeof(*simple_translator));
+ if (!simple_translator)
+ return -ENOMEM;
+
+ simple_translator->common.info = info;
+ simple_translator->id_to_gadget = simple_id_to_gadget;
+ simple_translator->cleanup_gadget = simple_cleanup_gadget;
+
+ *common = &simple_translator->common;
+ return 0;
+}
+
+static int simple_translator_close(struct hw_common *common)
+{
+ struct usb_gadget_translator *simple_translator;
+
+ if (!common)
+ return -EINVAL;
+
+ simple_translator = container_of(common, struct usb_gadget_translator,
+ common);
+
+ free(simple_translator);
+ return 0;
+}
+
+HARDWARE_MODULE_STRUCTURE = {
+ .magic = HARDWARE_INFO_TAG,
+ .hal_version = HARDWARE_INFO_VERSION,
+ .device_version = USB_GADGET_DEVICE_VERSION,
+ .id = USB_GADGET_DEVICE_ID,
+ .name = "simple_translator",
+ .open = simple_translator_open,
+ .close = simple_translator_close,
+};
+
+#endif