Initialize Tizen 2.3
[framework/system/deviced.git] / src / core / device-handler.h
1 /*
2  * deviced
3  *
4  * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd.
5  *
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
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  */
18
19
20 #ifndef __DEVICE_HANDLER_H__
21 #define __DEVICE_HANDLER_H__
22
23 #include "data.h"
24
25 enum extcon_type {
26         EXTCON_TA = 0,
27         EXTCON_EARJACK,
28 };
29
30 enum device_change_type {
31         DEVICE_CHANGE_ABNORMAL  = 0,
32         DEVICE_CHANGE_NORMAL    = 1,
33 };
34
35 enum charge_full_type {
36         CHARGING_NOT_FULL       = 0,
37         CHARGING_FULL           = 1,
38 };
39 enum charge_now_type {
40         CHARGER_ABNORMAL        = -1,
41         CHARGER_DISCHARGING     = 0,
42         CHARGER_CHARGING        = 1,
43 };
44 enum health_type {
45         HEALTH_BAD              = 0,
46         HEALTH_GOOD             = 1,
47 };
48
49 enum temp_type {
50         TEMP_LOW                = 0,
51         TEMP_HIGH               = 1,
52 };
53
54 enum present_type {
55         PRESENT_ABNORMAL        = 0,
56         PRESENT_NORMAL          = 1,
57 };
58
59 enum ovp_type {
60         OVP_NORMAL              = 0,
61         OVP_ABNORMAL            = 1,
62 };
63
64 enum battery_noti_type {
65         DEVICE_NOTI_BATT_CHARGE = 0,
66         DEVICE_NOTI_BATT_LOW,
67         DEVICE_NOTI_BATT_FULL,
68         DEVICE_NOTI_MAX,
69 };
70
71 enum battery_noti_status {
72         DEVICE_NOTI_OFF = 0,
73         DEVICE_NOTI_ON  = 1,
74 };
75
76 enum dock_type {
77         DOCK_NONE       = 0,
78         DOCK_SOUND      = 7,
79 };
80
81 struct battery_status {
82         int capacity;
83         int charge_full;
84         int charge_now;
85         int health;
86         int present;
87         int online;
88         int temp;
89         int ovp;
90 };
91
92 struct battery_status battery;
93
94 #define CONNECTED(val) ((val) != 0)
95
96 /* Battery functions */
97 void lowbat_monitor(void *data);
98
99 int extcon_set_count(int index);
100
101 int get_usb_state_direct(void);
102
103 void sync_cradle_status(void);
104
105 #endif /* __DEVICE_HANDLER_H__ */