The display device is now added to the deviced core translation unit.
The existing display plugin devices are changed not to be initialized
by default. Instead its initialization is triggered by display core
device.
Change-Id: I864b8f7aa594c56076286e2d7d7516bee11f2245
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/time/time-handler.c
)
+IF(DISPLAY_MODULE STREQUAL on)
+ ADD_SOURCE(src/display DISPLAY_SRCS)
+ SET(SRCS ${SRCS} ${DISPLAY_SRCS})
+ENDIF()
+
IF(BATTERY_MODULE STREQUAL on)
ADD_SOURCE(src/battery BATTERY_SRCS)
SET(SRCS ${SRCS} ${BATTERY_SRCS})
return status;
}
-static const struct device_ops display_device_ops = {
- .priority = DEVICE_PRIORITY_HIGH,
- DECLARE_NAME_LEN("display"),
+static const struct device_ops display_plugin_device_ops = {
+ .disable_auto_init = true,
+ DECLARE_NAME_LEN("display-plugin"),
.probe = display_probe,
.init = display_init,
.exit = display_exit,
.status = display_status,
};
-DEVICE_OPS_REGISTER(&display_device_ops)
+DEVICE_OPS_REGISTER(&display_plugin_device_ops)
static void __CONSTRUCTOR__ initialize(void)
{
_W("Failed to init plugin iot-headless display dbus interface(%d)", ret);
}
-static const struct device_ops display_device_ops = {
- .priority = DEVICE_PRIORITY_HIGH,
- DECLARE_NAME_LEN("display"),
+static const struct device_ops display_plugin_device_ops = {
+ .disable_auto_init = true,
+ DECLARE_NAME_LEN("display-plugin"),
.init = display_init,
};
-DEVICE_OPS_REGISTER(&display_device_ops)
+DEVICE_OPS_REGISTER(&display_plugin_device_ops)
return status;
}
-static const struct device_ops display_device_ops = {
- .priority = DEVICE_PRIORITY_HIGH,
- DECLARE_NAME_LEN("display"),
+static const struct device_ops display_plugin_device_ops = {
+ .disable_auto_init = true,
+ DECLARE_NAME_LEN("display-plugin"),
.probe = display_probe,
.init = display_init,
.exit = display_exit,
.status = display_status,
};
-DEVICE_OPS_REGISTER(&display_device_ops)
+DEVICE_OPS_REGISTER(&display_plugin_device_ops)
static void __CONSTRUCTOR__ initialize(void)
{
return status;
}
-static const struct device_ops display_device_ops = {
- .priority = DEVICE_PRIORITY_HIGH,
- DECLARE_NAME_LEN("display"),
+static const struct device_ops display_plugin_device_ops = {
+ .disable_auto_init = true,
+ DECLARE_NAME_LEN("display-plugin"),
.probe = display_probe,
.init = display_init,
.exit = display_exit,
.status = display_status,
};
-DEVICE_OPS_REGISTER(&display_device_ops)
+DEVICE_OPS_REGISTER(&display_plugin_device_ops)
static void __CONSTRUCTOR__ initialize(void)
{
return status;
}
-static const struct device_ops display_device_ops = {
- .priority = DEVICE_PRIORITY_HIGH,
- DECLARE_NAME_LEN("display"),
+static const struct device_ops display_plugin_device_ops = {
+ .disable_auto_init = true,
+ DECLARE_NAME_LEN("display-plugin"),
.probe = display_probe,
.init = display_init,
.exit = display_exit,
.status = display_status,
};
-DEVICE_OPS_REGISTER(&display_device_ops)
+DEVICE_OPS_REGISTER(&display_plugin_device_ops)
static void __CONSTRUCTOR__ initialize(void)
{
--- /dev/null
+/*
+ * deviced
+ *
+ * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * 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 <shared/devices.h>
+
+static const struct device_ops *display_plugin_device_ops;
+
+static int display_probe(void *data)
+{
+ display_plugin_device_ops = find_device("display-plugin");
+ if (!display_plugin_device_ops || !display_plugin_device_ops->probe)
+ return 0;
+
+ return display_plugin_device_ops->probe(data);
+}
+
+static void display_init(void *data)
+{
+ if (!display_plugin_device_ops || !display_plugin_device_ops->init)
+ return;
+
+ display_plugin_device_ops->init(data);
+}
+
+static void display_exit(void *data)
+{
+ if (!display_plugin_device_ops || !display_plugin_device_ops->exit)
+ return;
+
+ display_plugin_device_ops->exit(data);
+}
+
+static int display_start(enum device_flags flags)
+{
+ if (!display_plugin_device_ops || !display_plugin_device_ops->start)
+ return 0;
+
+ return display_plugin_device_ops->start(flags);
+}
+
+static int display_stop(enum device_flags flags)
+{
+ if (!display_plugin_device_ops || !display_plugin_device_ops->stop)
+ return 0;
+
+ return display_plugin_device_ops->stop(flags);
+}
+
+static int display_status(void)
+{
+ if (!display_plugin_device_ops || !display_plugin_device_ops->status)
+ return 0;
+
+ return display_plugin_device_ops->status();
+}
+
+static const struct device_ops display_device_ops = {
+ .priority = DEVICE_PRIORITY_HIGH,
+ DECLARE_NAME_LEN("display"),
+ .probe = display_probe,
+ .init = display_init,
+ .exit = display_exit,
+ .start = display_start,
+ .stop = display_stop,
+ .status = display_status,
+};
+
+DEVICE_OPS_REGISTER(&display_device_ops)