2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 * @author Suchang Woo (suchang.woo@samsung.com)
21 * @modified by Wonil Choi (wonil22.choi@samsung.com)
23 * @brief Power manager main loop header file
25 #ifndef __POWER_MANAGER_H__
26 #define __POWER_MANAGER_H__
30 #include "pm_llinterface.h"
31 #include "pm_setting.h"
34 #define WITHOUT_STARTNOTI 0x1
35 #define MASK_BIT 0x7 /* 111 */
36 #define MASK_DIM 0x1 /* 001 */
37 #define MASK_OFF 0x2 /* 010 */
38 #define MASK_SLP 0x4 /* 100 */
40 #define VCALL_FLAG 0x00000001
41 #define LOWBT_FLAG 0x00000100
42 #define CHRGR_FLAG 0x00000200
43 #define PWRSV_FLAG 0x00000400
45 unsigned int status_flag;
52 S_NORMAL, /*< normal state */
53 S_LCDDIM, /*< LCD dimming */
54 S_LCDOFF, /*< LCD off */
55 S_SLEEP, /*< system suspend */
61 * cur_state : current state
62 * states : state definitions
63 * trans_table : state transition table
69 * @brief State structure
72 enum state_t state; /**< state number */
73 int (*trans) (int evt); /**< transition function pointer */
74 int (*action) (int timeout); /**< enter action */
75 int (*check) (int next); /**< transition check function */
79 /* If the bit in a condition variable is set,
80 * we cannot transit the state until clear this bit. */
83 int (*pm_init_extention) (void *data); /**< extention init function */
84 void (*pm_exit_extention) (void); /**< extention exit function */
85 int check_processes(enum state_t prohibit_state);
88 * Power manager Main loop
91 * @param[in] flags If the first bit of this is set, start managing without Start notification.
92 * If the second bit of ths is set, use unified device manager functions.
94 void start_main(unsigned int flags);