Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
charger-manager.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011 Samsung Electronics Co., Ltd.
3  * MyungJoo.Ham <[email protected]>
4  *
5  * Charger Manager.
6  * This framework enables to control and multiple chargers and to
7  * monitor charging even in the context of suspend-to-RAM with
8  * an interface combining the chargers.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13 **/
14 
15 #ifndef _CHARGER_MANAGER_H
16 #define _CHARGER_MANAGER_H
17 
18 #include <linux/power_supply.h>
19 #include <linux/extcon.h>
20 
26 };
27 
33 };
34 
43 };
44 
61  char *rtc_name;
62 
64 
66 };
67 
84 struct charger_cable {
85  const char *extcon_name;
86  const char *name;
87 
88  /* The charger-manager use Exton framework*/
90  struct work_struct wq;
92 
93  /* The state of charger cable */
94  bool attached;
95 
97 
98  /*
99  * Set min/max current of regulator to protect over-current issue
100  * according to a kind of charger cable when cable is attached.
101  */
102  int min_uA;
103  int max_uA;
104 
106 };
107 
128  /* The name of regulator for charging */
129  const char *regulator_name;
131 
132  /* charger never on when system is on */
134 
135  /*
136  * Store constraint information related to current limit,
137  * each cable have different condition for charging.
138  */
141 
146  struct attribute *attrs[4];
147 
149 };
150 
192 struct charger_desc {
193  char *psy_name;
194 
196  unsigned int polling_interval_ms;
197 
198  unsigned int fullbatt_vchkdrop_ms;
199  unsigned int fullbatt_vchkdrop_uV;
200  unsigned int fullbatt_uV;
201  unsigned int fullbatt_soc;
203 
205 
207 
210 
212 
215 
218 };
219 
220 #define PSY_NAME_MAX 30
221 
246  struct list_head entry;
247  struct device *dev;
249 
252 
254 
257 
260 
263 
266 
269 };
270 
271 #ifdef CONFIG_CHARGER_MANAGER
272 extern int setup_charger_manager(struct charger_global_desc *gd);
273 extern bool cm_suspend_again(void);
274 extern void cm_notify_event(struct power_supply *psy,
275  enum cm_event_types type, char *msg);
276 #else
277 static inline int setup_charger_manager(struct charger_global_desc *gd)
278 { return 0; }
279 static inline bool cm_suspend_again(void) { return false; }
280 static inline void cm_notify_event(struct power_supply *psy,
281  enum cm_event_types type, char *msg) { }
282 #endif
283 #endif /* _CHARGER_MANAGER_H */