backlight_ops->update();
}
-static int poll_callback(int condition, PMMsg *data)
+int poll_callback(int condition, PMMsg *data)
{
static time_t last_t;
time_t now;
break;
case INIT_POLL:
_I("input init");
- pm_callback = poll_callback;
ret = input_init_handler();
pm_lock_detector_init();
/* change state - LCD on */
if (disp_plgn->pm_change_internal)
disp_plgn->pm_change_internal(INTERNAL_LOCK_POWERKEY, LCD_NORMAL);
- (*pm_callback)(INPUT_POLL_EVENT, NULL);
+ poll_callback(INPUT_POLL_EVENT, NULL);
}
if (!display_has_caps(caps, DISPLAY_CAPA_LCDOFF)) {
backlight_ops->update();
}
-static int poll_callback(int condition, PMMsg *data)
+int poll_callback(int condition, PMMsg *data)
{
static time_t last_t;
time_t now;
break;
case INIT_POLL:
_I("input init");
- pm_callback = poll_callback;
ret = input_init_handler();
pm_lock_detector_init();
/* change state - LCD on */
if (disp_plgn->pm_change_internal)
disp_plgn->pm_change_internal(INTERNAL_LOCK_POWERKEY, LCD_NORMAL);
- (*pm_callback)(INPUT_POLL_EVENT, NULL);
+ poll_callback(INPUT_POLL_EVENT, NULL);
}
if (!display_has_caps(caps, DISPLAY_CAPA_LCDOFF)) {
broadcast_lcdon_by_powerkey();
lcd_on_direct(LCD_ON_BY_POWER_KEY);
- if (pm_callback)
- (*pm_callback) (INPUT_POLL_EVENT, NULL);
+ poll_callback(INPUT_POLL_EVENT, NULL);
}
return G_SOURCE_REMOVE;
backlight_ops->update();
}
-static int poll_callback(int condition, PMMsg *data)
+int poll_callback(int condition, PMMsg *data)
{
static time_t last_t;
time_t now;
break;
case INIT_POLL:
_I("input init");
- pm_callback = poll_callback;
ret = input_init_handler();
pm_lock_detector_init();
/* change state - LCD on */
if (disp_plgn->pm_change_internal)
disp_plgn->pm_change_internal(INTERNAL_LOCK_POWERKEY, LCD_NORMAL);
- (*pm_callback)(INPUT_POLL_EVENT, NULL);
+ poll_callback(INPUT_POLL_EVENT, NULL);
}
if (!display_has_caps(caps, DISPLAY_CAPA_LCDOFF)) {
}
}
-static int poll_callback(int condition, PMMsg *data)
+int poll_callback(int condition, PMMsg *data)
{
static time_t last_t;
time_t now;
break;
case INIT_POLL:
_I("input init");
- pm_callback = poll_callback;
ret = input_init_handler();
pm_lock_detector_init();
/* change state - LCD on */
if (disp_plgn->pm_change_internal)
disp_plgn->pm_change_internal(INTERNAL_LOCK_POWERKEY, LCD_NORMAL);
- (*pm_callback)(INPUT_POLL_EVENT, NULL);
+ poll_callback(INPUT_POLL_EVENT, NULL);
}
if (!display_has_caps(caps, DISPLAY_CAPA_LCDOFF)) {
extern const struct display_keyfilter_ops *keyfilter_ops;
extern GList *lcdon_ops;
+typedef struct {
+ pid_t pid;
+ unsigned int cond;
+ unsigned int timeout;
+ unsigned int timeout2;
+} PMMsg;
+extern int poll_callback(int condition, PMMsg *data);
+
/* If the bit in a condition variable is set,
* we cannot transit the state until clear this bit. */
int check_processes(enum state_t prohibit_state);
#define SEAT_NAME "seat0"
-int (*pm_callback) (int, PMMsg *);
-
static void process_event(struct libinput_event *ev)
{
static const struct device_ops *display_device_ops;
return;
}
- if (!pm_callback)
- return;
-
if (!display_device_ops) {
display_device_ops = find_device("display");
if (!display_device_ops)
return;
/* lcd on or update lcd timeout */
- (*pm_callback) (INPUT_POLL_EVENT, NULL);
+ poll_callback(INPUT_POLL_EVENT, NULL);
}
gboolean display_input_init(gpointer data)
{
int cond;
- if (!pm_callback)
- return -1;
-
cond = get_state(s_bits);
if (cond < 0)
return cond;
recv_data.cond = cond;
recv_data.timeout = timeout;
- (*pm_callback)(PM_CONTROL_EVENT, &recv_data);
+ poll_callback(PM_CONTROL_EVENT, &recv_data);
return 0;
}
{
int cond;
- if (!pm_callback)
- return -1;
-
cond = get_state(s_bits);
if (cond < 0)
return cond;
recv_data.cond = cond;
recv_data.timeout = 0;
- (*pm_callback)(PM_CONTROL_EVENT, &recv_data);
+ poll_callback(PM_CONTROL_EVENT, &recv_data);
return 0;
}
int cond, ret;
const int display_on = LCD_NORMAL | LCD_DIM;
- if (!pm_callback)
- return -1;
-
cond = get_state(s_bits);
if (cond < 0)
return cond;
recv_data.cond = cond;
recv_data.timeout = 0;
- (*pm_callback)(PM_CONTROL_EVENT, &recv_data);
+ poll_callback(PM_CONTROL_EVENT, &recv_data);
return 0;
}
#define RESET_TIMER_STR "resettimer"
#define KEEP_TIMER_STR "keeptimer"
-typedef struct {
- pid_t pid;
- unsigned int cond;
- unsigned int timeout;
- unsigned int timeout2;
-} PMMsg;
-
-extern int (*pm_callback) (int, PMMsg *);
-
gboolean display_input_init(gpointer data);
int display_input_exit(void);