4 * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 * @brief Power Manager input device poll implementation
24 * This file includes the input device poll implementation.
25 * Default input devices are /dev/event0 and /dev/event1
26 * User can use "PM_INPUT_DEV" for setting another input device poll in an environment file (/etc/profile).
27 * (ex: PM_INPUT_DEV=/dev/event0:/dev/event1:/dev/event5 )
34 #include "core/edbus-handler.h"
36 * @addtogroup POWER_MANAGER
41 INPUT_POLL_EVENT = -9,
48 INTERNAL_LOCK_BASE = 100000,
49 INTERNAL_LOCK_BATTERY,
50 INTERNAL_LOCK_BOOTING,
51 INTERNAL_LOCK_DUMPMODE,
55 INTERNAL_LOCK_SOUNDDOCK,
61 #define SIGNAL_NAME_LCD_CONTROL "lcdcontol"
63 #define LCD_NORMAL 0x1 /**< NORMAL state */
64 #define LCD_DIM 0x2 /**< LCD dimming state */
65 #define LCD_OFF 0x4 /**< LCD off state */
66 #define SUSPEND 0x8 /**< Suspend state */
67 #define POWER_OFF 0x16 /**< Sleep state */
69 #define STAY_CUR_STATE 0x1
70 #define GOTO_STATE_NOW 0x2
71 #define HOLD_KEY_BLOCK 0x4
72 #define STANDBY_MODE 0x8
74 #define PM_SLEEP_MARGIN 0x0 /**< keep guard time for unlock */
75 #define PM_RESET_TIMER 0x1 /**< reset timer for unlock */
76 #define PM_KEEP_TIMER 0x2 /**< keep timer for unlock */
78 #define PM_LOCK_STR "lock"
79 #define PM_UNLOCK_STR "unlock"
80 #define PM_CHANGE_STR "change"
82 #define PM_LCDOFF_STR "lcdoff"
83 #define PM_LCDDIM_STR "lcddim"
84 #define PM_LCDON_STR "lcdon"
85 #define PM_SUSPEND_STR "suspend"
87 #define STAYCURSTATE_STR "staycurstate"
88 #define GOTOSTATENOW_STR "gotostatenow"
90 #define HOLDKEYBLOCK_STR "holdkeyblock"
91 #define STANDBYMODE_STR "standbymode"
93 #define SLEEP_MARGIN_STR "sleepmargin"
94 #define RESET_TIMER_STR "resettimer"
95 #define KEEP_TIMER_STR "keeptimer"
100 unsigned int timeout;
101 unsigned int timeout2;
107 Ecore_Fd_Handler *dev_fd;
111 Eina_List *indev_list;
114 int (*g_pm_callback) (int, PMMsg *);
116 extern int init_pm_poll(int (*pm_callback) (int, PMMsg *));
117 extern int exit_pm_poll();
118 extern int init_pm_poll_input(int (*pm_callback)(int , PMMsg * ), const char *path);
120 extern int pm_lock_internal(pid_t pid, int s_bits, int flag, int timeout);
121 extern int pm_unlock_internal(pid_t pid, int s_bits, int flag);
122 extern int pm_change_internal(pid_t pid, int s_bits);
128 #endif /*__PM_POLL_H__ */