#define HDMI_NUMBER_MAX (64) // max number of supported hdmi
static struct dd_bitmap *bm_hdmi;
-static struct display_plugin *disp_plgn;
static struct extcon_ops hdmi_extcon_ops;
static void hdmi_send_broadcast(int status)
}
_I("Hdmi changed");
- if (disp_plgn->pm_change_internal)
- disp_plgn->pm_change_internal(INTERNAL_LOCK_HDMI, LCD_NORMAL);
if (!index)
update_all_hdmi_bitmap(status);
hdmi_extcon_ops.status = hdmi_status;
hdmi_send_broadcast(hdmi_status);
- if (hdmi_status == HDMI_CONNECTED) {
- if (disp_plgn->pm_lock_internal)
- disp_plgn->pm_lock_internal(INTERNAL_LOCK_HDMI, LCD_DIM, STAY_CUR_STATE, 0);
- } else {
- if (disp_plgn->pm_unlock_internal)
- disp_plgn->pm_unlock_internal(INTERNAL_LOCK_HDMI, LCD_DIM, PM_SLEEP_MARGIN);
- }
-
- return 0;
-}
-
-static int display_changed(void *data)
-{
- enum state_t state;
- int hdmi;
-
- if (!data)
- return 0;
-
- state = *(int *)data;
- if (state != S_NORMAL)
- return 0;
-
- hdmi = hdmi_extcon_ops.status;
- if (hdmi == 0) {
- if (disp_plgn->pm_lock_internal)
- disp_plgn->pm_lock_internal(INTERNAL_LOCK_HDMI, LCD_DIM, STAY_CUR_STATE, 0);
- _I("Hdmi is connected. Dim lock is on.");
- }
return 0;
}
{
int ret;
- register_notifier(DEVICE_NOTIFIER_LCD, display_changed);
-
ret = gdbus_add_object(NULL, DEVICED_PATH_SYSNOTI, &dbus_interface);
if (ret < 0)
_E("Failed to init dbus method: %d", ret);
static void hdmi_exit(void *data)
{
- unregister_notifier(DEVICE_NOTIFIER_LCD, display_changed);
-
deinit_bitmap(bm_hdmi);
}
};
EXTCON_OPS_REGISTER(hdmi_extcon_ops)
-
-static void __CONSTRUCTOR__ initialize(void)
-{
- disp_plgn = get_var_display_plugin();
- if (!disp_plgn)
- _E("Failed to get display plugin variable.");
-}