diff options
Diffstat (limited to 'include/linux/tps80031-charger.h')
-rw-r--r-- | include/linux/tps80031-charger.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/include/linux/tps80031-charger.h b/include/linux/tps80031-charger.h new file mode 100644 index 00000000000..26c228edc30 --- /dev/null +++ b/include/linux/tps80031-charger.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * include/linux/tps80031-charger.h | ||
3 | * | ||
4 | * Battery charger driver interface for TI TPS80031 PMIC | ||
5 | * | ||
6 | * Copyright (C) 2011 NVIDIA Corporation | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
16 | * more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef __LINUX_TPS80031_CHARGER_H | ||
25 | #define __LINUX_TPS80031_CHARGER_H | ||
26 | |||
27 | #include <linux/regulator/machine.h> | ||
28 | |||
29 | enum charging_states { | ||
30 | charging_state_idle, | ||
31 | charging_state_charging_in_progress, | ||
32 | charging_state_charging_completed, | ||
33 | charging_state_charging_stopped, | ||
34 | }; | ||
35 | |||
36 | /** | ||
37 | * Callback type definition which is called when any state changed in the | ||
38 | * charging. | ||
39 | */ | ||
40 | typedef void (*charging_callback_t)(enum charging_states state, void *args); | ||
41 | |||
42 | struct tps80031_charger_platform_data { | ||
43 | int regulator_id; | ||
44 | int max_charge_volt_mV; | ||
45 | int max_charge_current_mA; | ||
46 | int charging_term_current_mA; | ||
47 | int refresh_time; | ||
48 | int irq_base; | ||
49 | int watch_time_sec; | ||
50 | struct regulator_consumer_supply *consumer_supplies; | ||
51 | int num_consumer_supplies; | ||
52 | int (*board_init)(void *board_data); | ||
53 | void *board_data; | ||
54 | }; | ||
55 | |||
56 | /** | ||
57 | * Register the callback function for the client. This callback gets called | ||
58 | * when there is any change in the chanrging states. | ||
59 | */ | ||
60 | extern int register_charging_state_callback(charging_callback_t cb, void *args); | ||
61 | |||
62 | #endif /*__LINUX_TPS80031_CHARGER_H */ | ||