--- /dev/null
+/*
+ * deviced
+ *
+ * Copyright (c) 2024 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 <stdint.h>
+
+#include <libsyscommon/resource-manager.h>
+#include <libsyscommon/resource-type.h>
+#include <system/syscommon-plugin-deviced-common-interface.h>
+#include <system/syscommon-plugin-deviced-touchled-interface.h>
+
+#include "shared/common.h"
+#include "touch-key.h"
+
+typedef union {
+ int32_t i32;
+ int64_t i64;
+ uint32_t u32;
+ uint64_t u64;
+ double d;
+ void* p;
+ bool b;
+} resource_attr_data_t;
+
+static int set_touchled_attr_data(int resource_id,
+ const struct syscommon_resman_resource_attribute *attr,
+ const void *data, int count)
+{
+ if (!data)
+ return -EINVAL;
+
+ switch (attr->id) {
+ case DEVICED_TOUCHLED_ATTR_INT_BACKLIGHT:
+ {
+ enum syscommon_deviced_touchled_option_type touchled_opt = *(enum syscommon_deviced_touchled_option_type *) data;
+ return touchled_control_backlight(touchled_opt);
+ }
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static const struct syscommon_resman_resource_attribute touchled_attrs[] = {
+ {
+ .name = "DEVICED_TOUCHLED_ATTR_INT_BACKLIGHT",
+ .id = DEVICED_TOUCHLED_ATTR_INT_BACKLIGHT,
+ .type = SYSCOMMON_RESMAN_DATA_TYPE_INT,
+ .flag = SYSCOMMON_RESMAN_RESOURCE_FLAG_PUBLIC,
+ .ops = {
+ .set = set_touchled_attr_data,
+ .is_supported = syscommon_resman_resource_attr_supported_always,
+ },
+ }
+};
+
+static const struct syscommon_resman_resource_driver deviced_touchled_driver = {
+ .name = "touchled",
+ .type = DEVICED_RESOURCE_TYPE_TOUCHLED,
+ .flag = SYSCOMMON_RESMAN_RESOURCE_DRIVER_FLAG_COUNT_ONLY_ONE,
+ .attrs = touchled_attrs,
+ .num_attrs = ARRAY_SIZE(touchled_attrs),
+};
+SYSCOMMON_RESMAN_RESOURCE_DRIVER_REGISTER(&deviced_touchled_driver);
\ No newline at end of file