3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 * @author Suchang Woo (suchang.woo@samsung.com)
22 * @modified by Wonil Choi (wonil22.choi@samsung.com)
24 * @brief Power manager main loop header file
26 #ifndef __POWER_MANAGER_H__
27 #define __POWER_MANAGER_H__
31 #include "pm_llinterface.h"
32 #include "pm_setting.h"
35 #define WITHOUT_STARTNOTI 0x1
36 #define MASK_BIT 0x7 /* 111 */
37 #define MASK_DIM 0x1 /* 001 */
38 #define MASK_OFF 0x2 /* 010 */
39 #define MASK_SLP 0x4 /* 100 */
41 #define VCALL_FLAG 0x00000001
42 #define LOWBT_FLAG 0x00000100
43 #define CHRGR_FLAG 0x00000200
44 #define PWRSV_FLAG 0x00000400
45 #define BRTCH_FLAG 0x00002000
47 #define TOLERANCE_SLOT 2
49 unsigned int status_flag;
56 S_NORMAL, /*< normal state */
57 S_LCDDIM, /*< LCD dimming */
58 S_LCDOFF, /*< LCD off */
59 S_SLEEP, /*< system suspend */
65 * cur_state : current state
66 * states : state definitions
67 * trans_table : state transition table
73 * @brief State structure
76 enum state_t state; /**< state number */
77 int (*trans) (int evt); /**< transition function pointer */
78 int (*action) (int timeout); /**< enter action */
79 int (*check) (int next); /**< transition check function */
83 /* If the bit in a condition variable is set,
84 * we cannot transit the state until clear this bit. */
87 int (*pm_init_extention) (void *data); /**< extention init function */
88 void (*pm_exit_extention) (void); /**< extention exit function */
89 int check_processes(enum state_t prohibit_state);
92 * Power manager Main loop
95 * @param[in] flags If the first bit of this is set, start managing without Start notification.
96 * If the second bit of ths is set, use unified device manager functions.
98 void start_main(unsigned int flags);