diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /include/linux/power | |
parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) |
Diffstat (limited to 'include/linux/power')
-rw-r--r-- | include/linux/power/bq20z75.h | 42 | ||||
-rw-r--r-- | include/linux/power/max8907c-charger.h | 64 |
2 files changed, 106 insertions, 0 deletions
diff --git a/include/linux/power/bq20z75.h b/include/linux/power/bq20z75.h new file mode 100644 index 00000000000..1398eb004e8 --- /dev/null +++ b/include/linux/power/bq20z75.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * Gas Gauge driver for TI's BQ20Z75 | ||
3 | * | ||
4 | * Copyright (c) 2010, NVIDIA Corporation. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef __LINUX_POWER_BQ20Z75_H_ | ||
22 | #define __LINUX_POWER_BQ20Z75_H_ | ||
23 | |||
24 | #include <linux/power_supply.h> | ||
25 | #include <linux/types.h> | ||
26 | |||
27 | /** | ||
28 | * struct bq20z75_platform_data - platform data for bq20z75 devices | ||
29 | * @battery_detect: GPIO which is used to detect battery presence | ||
30 | * @battery_detect_present: gpio state when battery is present (0 / 1) | ||
31 | * @i2c_retry_count: # of times to retry on i2c IO failure | ||
32 | * @poll_retry_count: # of times to retry looking for new status after | ||
33 | * external change notification | ||
34 | */ | ||
35 | struct bq20z75_platform_data { | ||
36 | int battery_detect; | ||
37 | int battery_detect_present; | ||
38 | int i2c_retry_count; | ||
39 | int poll_retry_count; | ||
40 | }; | ||
41 | |||
42 | #endif | ||
diff --git a/include/linux/power/max8907c-charger.h b/include/linux/power/max8907c-charger.h new file mode 100644 index 00000000000..2cebad768b0 --- /dev/null +++ b/include/linux/power/max8907c-charger.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* linux/power/max8907c-charger.h | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License version 2 as | ||
5 | * published by the Free Software Foundation. | ||
6 | */ | ||
7 | |||
8 | #ifndef __LINUX_MAX8907C_CHARGER_H | ||
9 | #define __LINUX_MAX8907C_CHARGER_H | ||
10 | |||
11 | /* interrupt */ | ||
12 | #define MAX8907C_VCHG_OVP (1 << 0) | ||
13 | #define MAX8907C_VCHG_F (1 << 1) | ||
14 | #define MAX8907C_VCHG_R (1 << 2) | ||
15 | #define MAX8907C_THM_OK_R (1 << 8) | ||
16 | #define MAX8907C_THM_OK_F (1 << 9) | ||
17 | #define MAX8907C_MBATTLOW_F (1 << 10) | ||
18 | #define MAX8907C_MBATTLOW_R (1 << 11) | ||
19 | #define MAX8907C_CHG_RST (1 << 12) | ||
20 | #define MAX8907C_CHG_DONE (1 << 13) | ||
21 | #define MAX8907C_CHG_TOPOFF (1 << 14) | ||
22 | #define MAX8907C_CHK_TMR_FAULT (1 << 15) | ||
23 | |||
24 | enum max8907c_charger_topoff_threshold { | ||
25 | MAX8907C_TOPOFF_5PERCENT = 0x00, | ||
26 | MAX8907C_TOPOFF_10PERCENT = 0x01, | ||
27 | MAX8907C_TOPOFF_15PERCENT = 0x02, | ||
28 | MAX8907C_TOPOFF_20PERCENT = 0x03, | ||
29 | }; | ||
30 | |||
31 | enum max8907c_charger_restart_hysteresis { | ||
32 | MAX8907C_RESTART_100MV = 0x00, | ||
33 | MAX8907C_RESTART_150MV = 0x01, | ||
34 | MAX8907C_RESTART_200MV = 0x02, | ||
35 | MAX8907C_RESTART_FLOAT = 0x03, | ||
36 | }; | ||
37 | |||
38 | enum max8907c_fast_charging_current { | ||
39 | MAX8907C_FASTCHARGE_90MA = 0x00, | ||
40 | MAX8907C_FASTCHARGE_300MA = 0x01, | ||
41 | MAX8907C_FASTCHARGE_460MA = 0x02, | ||
42 | MAX8907C_FASTCHARGE_600MA = 0x03, | ||
43 | MAX8907C_FASTCHARGE_700MA = 0x04, | ||
44 | MAX8907C_FASTCHARGE_800MA = 0x05, | ||
45 | MAX8907C_FASTCHARGE_900MA = 0x06, | ||
46 | MAX8907C_FASTCHARGE_1000MA = 0x07, | ||
47 | }; | ||
48 | |||
49 | enum max8907c_fast_charger_time { | ||
50 | MAX8907C_FCHARGE_TM_8H = 0x00, | ||
51 | MAX8907C_FCHARGE_TM_12H = 0x01, | ||
52 | MAX8907C_FCHARGE_TM_16H = 0x02, | ||
53 | MAX8907C_FCHARGE_TM_OFF = 0x03, | ||
54 | }; | ||
55 | |||
56 | struct max8907c_charger_pdata { | ||
57 | int irq; | ||
58 | enum max8907c_charger_topoff_threshold topoff_threshold; | ||
59 | enum max8907c_charger_restart_hysteresis restart_hysteresis; | ||
60 | enum max8907c_charger_restart_hysteresis fast_charging_current; | ||
61 | enum max8907c_fast_charger_time fast_charger_time; | ||
62 | }; | ||
63 | |||
64 | #endif | ||