* @{
*/
-static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
-
static struct syscommon_deviced_display_state_info states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
{ SYSCOMMON_DEVICED_DISPLAY_STATE_START, "SYSCOMMON_DEVICED_DISPLAY_STATE_START", NULL, NULL, NULL, NULL },
{ SYSCOMMON_DEVICED_DISPLAY_STATE_ON, "SYSCOMMON_DEVICED_DISPLAY_STATE_ON", NULL, NULL, NULL, NULL },
return;
}
-static int display_start(enum device_flags flags)
-{
- /* NORMAL MODE */
- if (flags & NORMAL_MODE) {
- if (flags & LCD_PANEL_OFF_MODE)
- /* standby on */
- syscommon_resman_set_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
- DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, SYSCOMMON_DEVICED_DPMS_STANDBY);
- else
- /* normal lcd on */
- syscommon_resman_set_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
- DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, SYSCOMMON_DEVICED_DPMS_ON);
-
- return 0;
- }
-
- /* CORE LOGIC MODE */
- if (!(flags & CORE_LOGIC_MODE))
- return 0;
-
- display_get_display_ops_status(&status);
- if (status == DEVICE_OPS_STATUS_START)
- return -EALREADY;
-
- if (display_probe(NULL) < 0)
- return -EPERM;
-
- display_init(NULL);
-
- return 0;
-}
-
-static int display_stop(enum device_flags flags)
-{
- /* NORMAL MODE */
- if (flags & NORMAL_MODE) {
- syscommon_resman_set_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
- DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, SYSCOMMON_DEVICED_DPMS_OFF);
- return 0;
- } else if (flags & FORCE_OFF_MODE) {
- syscommon_resman_set_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
- DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, SYSCOMMON_DEVICED_DPMS_FORCE_OFF);
- return 0;
- }
-
- /* CORE LOGIC MODE */
- if (!(flags & CORE_LOGIC_MODE))
- return 0;
-
- display_get_display_ops_status(&status);
- if (status == DEVICE_OPS_STATUS_STOP)
- return -EALREADY;
-
- display_exit(NULL);
-
- return 0;
-}
-
-static int display_status(void)
-{
- return status;
-}
-
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,
- .start = display_start,
- .stop = display_stop,
- .status = display_status,
};
DEVICE_OPS_REGISTER(&display_plugin_device_ops)
static struct display_plugin *disp_plgn;
static struct display_backlight_ops *backlight_ops;
-static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
-
static struct syscommon_deviced_display_state_info states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
{ SYSCOMMON_DEVICED_DISPLAY_STATE_START, "SYSCOMMON_DEVICED_DISPLAY_STATE_START", NULL, NULL, NULL, NULL },
{ SYSCOMMON_DEVICED_DISPLAY_STATE_ON, "SYSCOMMON_DEVICED_DISPLAY_STATE_ON", NULL, NULL, NULL, NULL },
return;
}
-static int display_start(enum device_flags flags)
-{
- /* NORMAL MODE */
- if (flags & NORMAL_MODE) {
- if (flags & LCD_PANEL_OFF_MODE)
- /* standby on */
- display_panel_set_panel_state_by_standby_state(true);
- else
- /* normal lcd on */
- display_panel_set_panel_state_by_on_state(flags);
- return 0;
- }
-
- /* CORE LOGIC MODE */
- if (!(flags & CORE_LOGIC_MODE))
- return 0;
-
- display_get_display_ops_status(&status);
- if (status == DEVICE_OPS_STATUS_START)
- return -EALREADY;
-
- if (display_probe(NULL) < 0)
- return -EPERM;
-
- display_init(NULL);
-
- return 0;
-}
-
-static int display_stop(enum device_flags flags)
-{
- /* NORMAL MODE */
- if (flags & NORMAL_MODE || flags & FORCE_OFF_MODE) {
- display_panel_set_panel_state_by_off_state(flags);
- return 0;
- }
-
- /* CORE LOGIC MODE */
- if (!(flags & CORE_LOGIC_MODE))
- return 0;
-
- display_get_display_ops_status(&status);
- if (status == DEVICE_OPS_STATUS_STOP)
- return -EALREADY;
-
- display_exit(NULL);
-
- return 0;
-}
-
-static int display_status(void)
-{
- return status;
-}
-
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,
- .start = display_start,
- .stop = display_stop,
- .status = display_status,
};
DEVICE_OPS_REGISTER(&display_plugin_device_ops)
static struct display_plugin *disp_plgn;
static struct display_backlight_ops *backlight_ops;
-static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
-
static struct syscommon_deviced_display_state_info states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
{ SYSCOMMON_DEVICED_DISPLAY_STATE_START, "SYSCOMMON_DEVICED_DISPLAY_STATE_START", NULL, NULL, NULL, NULL },
{ SYSCOMMON_DEVICED_DISPLAY_STATE_ON, "SYSCOMMON_DEVICED_DISPLAY_STATE_ON", NULL, NULL, NULL, NULL },
return;
}
-static int display_start(enum device_flags flags)
-{
- /* NORMAL MODE */
- if (flags & NORMAL_MODE) {
- if (flags & LCD_PANEL_OFF_MODE)
- /* standby on */
- display_panel_set_panel_state_by_standby_state(true);
- else
- /* normal lcd on */
- display_panel_set_panel_state_by_on_state(flags);
-
- return 0;
- }
-
- /* CORE LOGIC MODE */
- if (!(flags & CORE_LOGIC_MODE))
- return 0;
-
- display_get_display_ops_status(&status);
- if (status == DEVICE_OPS_STATUS_START)
- return -EALREADY;
-
- if (display_probe(NULL) < 0)
- return -EPERM;
-
- display_init(NULL);
-
- return 0;
-}
-
-static int display_stop(enum device_flags flags)
-{
- /* NORMAL MODE */
- if (flags & NORMAL_MODE || flags & FORCE_OFF_MODE) {
- display_panel_set_panel_state_by_off_state(flags);
- return 0;
- }
-
- /* CORE LOGIC MODE */
- if (!(flags & CORE_LOGIC_MODE))
- return 0;
-
- display_get_display_ops_status(&status);
- if (status == DEVICE_OPS_STATUS_STOP)
- return -EALREADY;
-
- display_exit(NULL);
-
- return 0;
-}
-
-static int display_status(void)
-{
- return status;
-}
-
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,
- .start = display_start,
- .stop = display_stop,
- .status = display_status,
};
DEVICE_OPS_REGISTER(&display_plugin_device_ops)
static int display_start(enum device_flags flags)
{
- if (!display_plugin_device_ops || !display_plugin_device_ops->start)
+ /* NORMAL MODE */
+ if (flags & NORMAL_MODE) {
+ if (flags & LCD_PANEL_OFF_MODE)
+ /* standby on */
+ display_panel_set_panel_state_by_standby_state(true);
+ else
+ /* normal lcd on */
+ display_panel_set_panel_state_by_on_state(flags);
+ return 0;
+ }
+
+ /* CORE LOGIC MODE */
+ if (!(flags & CORE_LOGIC_MODE))
return 0;
- return display_plugin_device_ops->start(flags);
+ if (display_ops_status == DEVICE_OPS_STATUS_START)
+ return -EALREADY;
+
+ if (display_probe(NULL) < 0)
+ return -EPERM;
+
+ display_init(NULL);
+
+ return 0;
}
static int display_stop(enum device_flags flags)
{
- if (!display_plugin_device_ops || !display_plugin_device_ops->stop)
+ /* NORMAL MODE */
+ if (flags & NORMAL_MODE || flags & FORCE_OFF_MODE) {
+ display_panel_set_panel_state_by_off_state(flags);
return 0;
+ }
+
+ /* CORE LOGIC MODE */
+ if (!(flags & CORE_LOGIC_MODE))
+ return 0;
+
+ if (display_ops_status == DEVICE_OPS_STATUS_STOP)
+ return -EALREADY;
- return display_plugin_device_ops->stop(flags);
+ display_exit(NULL);
+
+ return 0;
}
static int display_status(void)
{
- if (!display_plugin_device_ops || !display_plugin_device_ops->status)
- return 0;
-
- return display_plugin_device_ops->status();
+ return display_ops_status;
}
static const struct device_ops display_device_ops = {