CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(slp_devman_plugin C)
-
-SET(SRCS
- src/device_manager_io.c
- src/device_manager_TRM.c
- src/device_manager_siop.c
- src/device_manager_plugin_sc7727.c)
-
-SET(DUMP_FILES
- dump/dump_power.sh)
-
-SET(SRC_TEST
- src/test_devices.c
- src/device_manager_io.c
- src/device_manager_siop.c)
-
-IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
- SET(CMAKE_BUILD_TYPE "Release")
-ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
-
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-SET(CMAKE_C_FLAGS_RELEASE "-O2")
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED devman_plugin)
-
-FOREACH(flag ${pkgs_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-
-ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
-
-ADD_EXECUTABLE(sys_oal_test ${SRC_TEST})
-TARGET_LINK_LIBRARIES(sys_oal_test ${pkgs_LDFLAGS})
+PROJECT(device-manager-sc7730 C)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT RuntimeLibraries)
-INSTALL(PROGRAMS ${DUMP_FILES} DESTINATION /opt/etc/dump.d/module.d)
-INSTALL(TARGETS sys_oal_test DESTINATION bin)
+ADD_SUBDIRECTORY(hw/display)
+ADD_SUBDIRECTORY(hw/led)
--- /dev/null
+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)
--- /dev/null
+/*
+ * 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 <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <linux/limits.h>
+
+#include <hw/display.h>
+#include "../shared.h"
+
+static int display_open(struct hw_info *info,
+ const char *id, struct hw_common **common)
+{
+ return 0;
+}
+
+static int display_close(struct hw_common *common)
+{
+ 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,
+};
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(led C)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED dlog hwcommon)
+
+FOREACH(flag ${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 led.c ../shared.c)
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES PREFIX "")
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}/hw COMPONENT RuntimeLibraries)
--- /dev/null
+/*
+ * 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 <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <linux/limits.h>
+
+#include <hw/led.h>
+#include "../shared.h"
+
+static int led_open(struct hw_info *info,
+ const char *id, struct hw_common **common)
+{
+ return 0;
+}
+
+static int led_close(struct hw_common *common)
+{
+ return 0;
+}
+
+HARDWARE_MODULE_STRUCTURE = {
+ .magic = HARDWARE_INFO_TAG,
+ .hal_version = HARDWARE_INFO_VERSION,
+ .device_version = LED_HARDWARE_DEVICE_VERSION,
+ .id = LED_HARDWARE_DEVICE_ID,
+ .name = "Default LED",
+ .author = "Jiyoung Yun <jy910.yun@samsung.com>",
+ .open = led_open,
+ .close = led_close,
+};
--- /dev/null
+/*
+ * 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 <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#define BUF_MAX 255
+
+static int sys_read_buf(char *file, char *buf, int len)
+{
+ int fd, r;
+
+ if (!file || !buf || len < 0)
+ return -EINVAL;
+
+ fd = open(file, O_RDONLY);
+ if (fd == -1)
+ return -ENOENT;
+
+ r = read(fd, buf, len);
+ close(fd);
+ if ((r >= 0) && (r < len))
+ buf[r] = '\0';
+ else
+ return -EIO;
+
+ return 0;
+}
+
+static int sys_write_buf(char *file, char *buf)
+{
+ int fd, r;
+
+ if (!file || !buf)
+ return -EINVAL;
+
+ fd = open(file, O_WRONLY);
+ if (fd == -1)
+ return -EPERM;
+
+ r = write(fd, buf, strlen(buf));
+ close(fd);
+ if (r < 0)
+ return -EIO;
+
+ return 0;
+}
+
+int sys_get_int(char *fname, int *val)
+{
+ char buf[BUF_MAX];
+ int r;
+
+ if (!fname || !val)
+ return -EINVAL;
+
+ r = sys_read_buf(fname, buf, sizeof(buf));
+ if (r < 0)
+ return r;
+
+ *val = atoi(buf);
+ return 0;
+}
+
+int sys_get_str(char *fname, char *str, int len)
+{
+ int r;
+
+ if (!fname || !str || len < 0)
+ return -EINVAL;
+
+ r = sys_read_buf(fname, str, len);
+ if (r < 0)
+ return r;
+
+ return 0;
+}
+
+int sys_set_int(char *fname, int val)
+{
+ char buf[BUF_MAX];
+ int r;
+
+ if (!fname)
+ return -EINVAL;
+
+ snprintf(buf, sizeof(buf), "%d", val);
+ r = sys_write_buf(fname, buf);
+ if (r < 0)
+ return r;
+
+ return 0;
+}
+
+int sys_set_str(char *fname, char *val)
+{
+ int r;
+
+ if (!fname || !val)
+ return -EINVAL;
+
+ r = sys_write_buf(fname, val);
+ if (r < 0)
+ return r;
+
+ return 0;
+}
--- /dev/null
+/*
+ * libdevice-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.
+ */
+
+
+#ifndef __HW_DEFAULT_SHARED_H__
+#define __HW_DEFAULT_SHARED_H__
+
+#define FEATURE_HARDWARE_DLOG
+#ifdef FEATURE_HARDWARE_DLOG
+#define LOG_TAG "HARDWARE"
+#include <dlog.h>
+#define _I(fmt, args...) SLOGI(fmt, ##args)
+#define _D(fmt, args...) SLOGD(fmt, ##args)
+#define _E(fmt, args...) SLOGE(fmt, ##args)
+#else
+#define _I(x, ...) do { } while (0)
+#define _D(x, ...) do { } while (0)
+#define _E(x, ...) do { } while (0)
+#endif
+
+#define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))
+
+int sys_get_int(char *fname, int *val);
+int sys_get_str(char *fname, char *str, int len);
+int sys_set_int(char *fname, int val);
+int sys_set_str(char *fname, char *val);
+
+#endif
+++ /dev/null
-#sbs-git:slp/pkgs/d/device-manager-plugin-sc7727 device-manager-plugin-sc7727 0.0.1 5bf2e95e0bb15c43ff928f7375e1978b0accb0f8
-Name: device-manager-plugin-sc7730
-Summary: Device manager plugin sc7730
-Version: 0.0.03
-Release: 0
-Group: TO_BE/FILLED_IN
-License: Apache-2.0
-Source0: %{name}-%{version}.tar.gz
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
-BuildRequires: cmake
-BuildRequires: pkgconfig(devman_plugin)
-BuildRequires: pkgconfig(dlog)
-
-%if "%{tizen_target_name}" != "Z300H"
-ExcludeArch: %{arm}
-%endif
-
-%description
-Device manager plugin sc7730
-
-
-%prep
-%setup -q
-
-%build
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
-
-make %{?jobs:-j%jobs}
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}/usr/share/license
-cp -a apache-2.0.txt %{buildroot}/usr/share/license/%{name}
-mkdir -p %{buildroot}/usr/lib/udev/rules.d
-cp -a 61-tizen-video-device.rules %{buildroot}/usr/lib/udev/rules.d
-
-%make_install
-
-%post
-/sbin/ldconfig
-mkdir -p /lib/firmware/modem
-
-%postun
-/sbin/ldconfig
-
-%files
-%manifest device-manager-plugin-sc7727.manifest
-/usr/share/license/device-manager-plugin-sc7730
-/usr/lib/libslp_devman_plugin.so
-/usr/lib/udev/rules.d/61-tizen-video-device.rules
-/opt/etc/dump.d/module.d/
-%exclude /usr/bin/sys_oal_test
-<manifest>\r
- <request>\r
- <domain name="_" />\r
- </request>\r
-</manifest>\r
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
--- /dev/null
+Name: device-manager-plugin-sc7730
+Summary: Device manager plugin sc7730
+Version: 0.0.1
+Release: 0
+Group: System/Hardware Adaptation
+License: Apache-2.0
+Source0: %{name}-%{version}.tar.gz
+Source1: %{name}.manifest
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+BuildRequires: cmake
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(hwcommon)
+
+%description
+Device manager plugin sc7730
+
+
+%prep
+%setup -q
+cp %{SOURCE1} .
+
+%build
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+
+%make_install
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%{_libdir}/hw/*.so
+%manifest %{name}.manifest
+%license LICENSE