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 setting module header
24 #ifndef __PM_SETTING_H__
25 #define __PM_SETTING_H__
30 * @addtogroup POWER_MANAGER
36 SETTING_TO_NORMAL = SETTING_BEGIN,
40 SETTING_BOOT_POWER_ON_STATUS,
41 SETTING_POWER_CUSTOM_BRIGHTNESS,
42 SETTING_ACCESSIBILITY_TTS,
44 SETTING_PM_STATE = SETTING_GET_END,
49 SETTING_LOCK_SCREEN_BG,
53 extern int (*update_pm_setting) (int key_idx, int val);
55 extern int get_setting_brightness();
58 * @brief setting initialization function
60 * get the variables if it exists. otherwise, set the default.
61 * and register some callback functions.
64 * @param[in] func configuration change callback function
65 * @return 0 : success, -1 : error
67 extern int init_setting(int (*func) (int key_idx, int val));
69 extern int exit_setting();
72 * get normal state timeout from SLP-setting SLP_SETTING_LCD_TIMEOUT_NORMAL
75 * @param[out] timeout timeout variable pointer
76 * @return 0 : success, -1 : error
78 extern int get_run_timeout(int *timeout);
81 * get LCD dim state timeout from environment variable.
84 * @param[out] dim_timeout timeout variable pointer
85 * @return 0 : success, negative value : error
87 extern int get_dim_timeout(int *dim_timeout);
89 * get USB connection status from SLP-setting SLP_SETTING_USB_STATUS
92 * @param[out] val usb connection status variable pointer, 0 is disconnected, others is connected.
93 * @return 0 : success, -1 : error
95 extern int get_usb_status(int *val);
98 * set Current power manager state at SLP-setting "memory/pwrmgr/state"
101 * @param[in] val current power manager state.
102 * @return 0 : success, -1 : error
104 extern int set_setting_pmstate(int val);
107 * get charging status at SLP-setting "memory/Battery/Charger"
110 * @param[in] val charging or not (1 or 0 respectively).
111 * @return 0 : success, -1 : error
113 extern int get_charging_status(int *val);
116 * get current battery low status at SLP-setting "memory/Battery/Status/Low"
119 * @param[in] val current low battery status
120 * @return 0 : success, -1 : error
122 extern int get_lowbatt_status(int *val);