aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/smb349-charger.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /include/linux/smb349-charger.h
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'include/linux/smb349-charger.h')
-rw-r--r--include/linux/smb349-charger.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/include/linux/smb349-charger.h b/include/linux/smb349-charger.h
new file mode 100644
index 00000000000..116f036baf1
--- /dev/null
+++ b/include/linux/smb349-charger.h
@@ -0,0 +1,63 @@
1/*
2 * include/linux/smb349-charger.h
3 *
4 * Battery charger driver interface for Summit SMB349
5 *
6 * Copyright (C) 2012 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;
11 *
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *
21 */
22
23#ifndef __LINUX_SMB349_CHARGER_H
24#define __LINUX_SMB349_CHARGER_H
25
26#include <linux/regulator/machine.h>
27
28enum charging_states {
29 idle,
30 progress,
31 completed,
32 stopped,
33};
34
35enum charger_type {
36 AC,
37 USB,
38};
39
40typedef void (*charging_callback_t)(enum charging_states state,
41enum charger_type chrg_type, void *args);
42
43struct smb349_charger {
44 struct i2c_client *client;
45 struct device *dev;
46 void *charger_cb_data;
47 enum charging_states state;
48 enum charger_type chrg_type;
49 charging_callback_t charger_cb;
50};
51
52int smb349_battery_online(void);
53typedef void (*callback_t)(enum usb_otg_state to,
54 enum usb_otg_state from, void *args);
55/*
56 * Register callback function for the client.
57 * Used by fuel-gauge driver to get battery charging properties.
58 */
59extern int register_callback(charging_callback_t cb, void *args);
60extern int register_otg_callback(callback_t cb, void *args);
61extern int update_charger_status(void);
62
63#endif /*__LINUX_SMB349_CHARGER_H */