diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-11 21:53:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-11 21:53:05 -0500 |
commit | b24ca57e7625bc304e77bc429693ad32a691eb16 (patch) | |
tree | 770aa389c6e763cf37776a35e85ff1e41958b1e9 /include/linux | |
parent | 6296e5d3c067df41980a5fd09ad4cc6765f79bb9 (diff) | |
parent | 913272b3864d6da89c70d9fc2c30ccb57794b369 (diff) |
Merge git://git.infradead.org/battery-2.6
* git://git.infradead.org/battery-2.6: (68 commits)
power_supply: Mark da9052 driver as broken
power_supply: Drop usage of nowarn variant of sysfs_create_link()
s3c_adc_battery: Average over more than one adc sample
power_supply: Add DA9052 battery driver
isp1704_charger: Fix missing check
jz4740-battery: Fix signedness bug
power_supply: Assume mains power by default
sbs-battery: Fix devicetree match table
ARM: rx51: Add bq27200 i2c board info
sbs-battery: Change power supply name
devicetree-bindings: Propagate bq20z75->sbs rename to dt bindings
devicetree-bindings: Add vendor entry for Smart Battery Systems
sbs-battery: Rename internals to new name
bq20z75: Rename to sbs-battery
wm97xx_battery: Use DEFINE_MUTEX() for work_lock
max8997_charger: Remove duplicate module.h
lp8727_charger: Some minor fixes for the header
lp8727_charger: Add header file
power_supply: Convert drivers/power/* to use module_platform_driver()
power_supply: Add "unknown" in power supply type
...
Diffstat (limited to 'include/linux')
-rwxr-xr-x | include/linux/lp8727.h | 51 | ||||
-rw-r--r-- | include/linux/mfd/max8925.h | 7 | ||||
-rw-r--r-- | include/linux/pda_power.h | 2 | ||||
-rw-r--r-- | include/linux/power/charger-manager.h | 147 | ||||
-rw-r--r-- | include/linux/power/sbs-battery.h (renamed from include/linux/power/bq20z75.h) | 10 | ||||
-rw-r--r-- | include/linux/power_supply.h | 11 | ||||
-rw-r--r-- | include/linux/s3c_adc_battery.h | 4 |
7 files changed, 223 insertions, 9 deletions
diff --git a/include/linux/lp8727.h b/include/linux/lp8727.h new file mode 100755 index 000000000000..d21fa2865bf4 --- /dev/null +++ b/include/linux/lp8727.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 National Semiconductor | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef _LP8727_H | ||
10 | #define _LP8727_H | ||
11 | |||
12 | enum lp8727_eoc_level { | ||
13 | EOC_5P, | ||
14 | EOC_10P, | ||
15 | EOC_16P, | ||
16 | EOC_20P, | ||
17 | EOC_25P, | ||
18 | EOC_33P, | ||
19 | EOC_50P, | ||
20 | }; | ||
21 | |||
22 | enum lp8727_ichg { | ||
23 | ICHG_90mA, | ||
24 | ICHG_100mA, | ||
25 | ICHG_400mA, | ||
26 | ICHG_450mA, | ||
27 | ICHG_500mA, | ||
28 | ICHG_600mA, | ||
29 | ICHG_700mA, | ||
30 | ICHG_800mA, | ||
31 | ICHG_900mA, | ||
32 | ICHG_1000mA, | ||
33 | }; | ||
34 | |||
35 | struct lp8727_chg_param { | ||
36 | /* end of charge level setting */ | ||
37 | enum lp8727_eoc_level eoc_level; | ||
38 | /* charging current */ | ||
39 | enum lp8727_ichg ichg; | ||
40 | }; | ||
41 | |||
42 | struct lp8727_platform_data { | ||
43 | u8 (*get_batt_present)(void); | ||
44 | u16 (*get_batt_level)(void); | ||
45 | u8 (*get_batt_capacity)(void); | ||
46 | u8 (*get_batt_temp)(void); | ||
47 | struct lp8727_chg_param ac; | ||
48 | struct lp8727_chg_param usb; | ||
49 | }; | ||
50 | |||
51 | #endif | ||
diff --git a/include/linux/mfd/max8925.h b/include/linux/mfd/max8925.h index 5259dfe8c585..b8e6d9449086 100644 --- a/include/linux/mfd/max8925.h +++ b/include/linux/mfd/max8925.h | |||
@@ -167,9 +167,6 @@ enum { | |||
167 | MAX8925_IRQ_VCHG_DC_OVP, | 167 | MAX8925_IRQ_VCHG_DC_OVP, |
168 | MAX8925_IRQ_VCHG_DC_F, | 168 | MAX8925_IRQ_VCHG_DC_F, |
169 | MAX8925_IRQ_VCHG_DC_R, | 169 | MAX8925_IRQ_VCHG_DC_R, |
170 | MAX8925_IRQ_VCHG_USB_OVP, | ||
171 | MAX8925_IRQ_VCHG_USB_F, | ||
172 | MAX8925_IRQ_VCHG_USB_R, | ||
173 | MAX8925_IRQ_VCHG_THM_OK_R, | 170 | MAX8925_IRQ_VCHG_THM_OK_R, |
174 | MAX8925_IRQ_VCHG_THM_OK_F, | 171 | MAX8925_IRQ_VCHG_THM_OK_F, |
175 | MAX8925_IRQ_VCHG_SYSLOW_F, | 172 | MAX8925_IRQ_VCHG_SYSLOW_F, |
@@ -223,6 +220,10 @@ struct max8925_power_pdata { | |||
223 | unsigned batt_detect:1; | 220 | unsigned batt_detect:1; |
224 | unsigned topoff_threshold:2; | 221 | unsigned topoff_threshold:2; |
225 | unsigned fast_charge:3; /* charge current */ | 222 | unsigned fast_charge:3; /* charge current */ |
223 | unsigned no_temp_support:1; /* set if no temperature detect */ | ||
224 | unsigned no_insert_detect:1; /* set if no ac insert detect */ | ||
225 | char **supplied_to; | ||
226 | int num_supplicants; | ||
226 | }; | 227 | }; |
227 | 228 | ||
228 | /* | 229 | /* |
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h index c9e4d814ff77..2bb62bf296ac 100644 --- a/include/linux/pda_power.h +++ b/include/linux/pda_power.h | |||
@@ -35,6 +35,8 @@ struct pda_power_pdata { | |||
35 | unsigned int polling_interval; /* msecs, default is 2000 */ | 35 | unsigned int polling_interval; /* msecs, default is 2000 */ |
36 | 36 | ||
37 | unsigned long ac_max_uA; /* current to draw when on AC */ | 37 | unsigned long ac_max_uA; /* current to draw when on AC */ |
38 | |||
39 | bool use_otg_notifier; | ||
38 | }; | 40 | }; |
39 | 41 | ||
40 | #endif /* __PDA_POWER_H__ */ | 42 | #endif /* __PDA_POWER_H__ */ |
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h new file mode 100644 index 000000000000..4f75e531c112 --- /dev/null +++ b/include/linux/power/charger-manager.h | |||
@@ -0,0 +1,147 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Samsung Electronics Co., Ltd. | ||
3 | * MyungJoo.Ham <myungjoo.ham@samsung.com> | ||
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 | |||
20 | enum data_source { | ||
21 | CM_FUEL_GAUGE, | ||
22 | CM_CHARGER_STAT, | ||
23 | }; | ||
24 | |||
25 | enum polling_modes { | ||
26 | CM_POLL_DISABLE = 0, | ||
27 | CM_POLL_ALWAYS, | ||
28 | CM_POLL_EXTERNAL_POWER_ONLY, | ||
29 | CM_POLL_CHARGING_ONLY, | ||
30 | }; | ||
31 | |||
32 | /** | ||
33 | * struct charger_global_desc | ||
34 | * @rtc_name: the name of RTC used to wake up the system from suspend. | ||
35 | * @rtc_only_wakeup: | ||
36 | * If the system is woken up by waekup-sources other than the RTC or | ||
37 | * callbacks, Charger Manager should recognize with | ||
38 | * rtc_only_wakeup() returning false. | ||
39 | * If the RTC given to CM is the only wakeup reason, | ||
40 | * rtc_only_wakeup should return true. | ||
41 | */ | ||
42 | struct charger_global_desc { | ||
43 | char *rtc_name; | ||
44 | |||
45 | bool (*rtc_only_wakeup)(void); | ||
46 | }; | ||
47 | |||
48 | /** | ||
49 | * struct charger_desc | ||
50 | * @psy_name: the name of power-supply-class for charger manager | ||
51 | * @polling_mode: | ||
52 | * Determine which polling mode will be used | ||
53 | * @fullbatt_uV: voltage in microvolt | ||
54 | * If it is not being charged and VBATT >= fullbatt_uV, | ||
55 | * it is assumed to be full. | ||
56 | * @polling_interval_ms: interval in millisecond at which | ||
57 | * charger manager will monitor battery health | ||
58 | * @battery_present: | ||
59 | * Specify where information for existance of battery can be obtained | ||
60 | * @psy_charger_stat: the names of power-supply for chargers | ||
61 | * @num_charger_regulator: the number of entries in charger_regulators | ||
62 | * @charger_regulators: array of regulator_bulk_data for chargers | ||
63 | * @psy_fuel_gauge: the name of power-supply for fuel gauge | ||
64 | * @temperature_out_of_range: | ||
65 | * Determine whether the status is overheat or cold or normal. | ||
66 | * return_value > 0: overheat | ||
67 | * return_value == 0: normal | ||
68 | * return_value < 0: cold | ||
69 | * @measure_battery_temp: | ||
70 | * true: measure battery temperature | ||
71 | * false: measure ambient temperature | ||
72 | */ | ||
73 | struct charger_desc { | ||
74 | char *psy_name; | ||
75 | |||
76 | enum polling_modes polling_mode; | ||
77 | unsigned int polling_interval_ms; | ||
78 | |||
79 | unsigned int fullbatt_uV; | ||
80 | |||
81 | enum data_source battery_present; | ||
82 | |||
83 | char **psy_charger_stat; | ||
84 | |||
85 | int num_charger_regulators; | ||
86 | struct regulator_bulk_data *charger_regulators; | ||
87 | |||
88 | char *psy_fuel_gauge; | ||
89 | |||
90 | int (*temperature_out_of_range)(int *mC); | ||
91 | bool measure_battery_temp; | ||
92 | }; | ||
93 | |||
94 | #define PSY_NAME_MAX 30 | ||
95 | |||
96 | /** | ||
97 | * struct charger_manager | ||
98 | * @entry: entry for list | ||
99 | * @dev: device pointer | ||
100 | * @desc: instance of charger_desc | ||
101 | * @fuel_gauge: power_supply for fuel gauge | ||
102 | * @charger_stat: array of power_supply for chargers | ||
103 | * @charger_enabled: the state of charger | ||
104 | * @emergency_stop: | ||
105 | * When setting true, stop charging | ||
106 | * @last_temp_mC: the measured temperature in milli-Celsius | ||
107 | * @psy_name_buf: the name of power-supply-class for charger manager | ||
108 | * @charger_psy: power_supply for charger manager | ||
109 | * @status_save_ext_pwr_inserted: | ||
110 | * saved status of external power before entering suspend-to-RAM | ||
111 | * @status_save_batt: | ||
112 | * saved status of battery before entering suspend-to-RAM | ||
113 | */ | ||
114 | struct charger_manager { | ||
115 | struct list_head entry; | ||
116 | struct device *dev; | ||
117 | struct charger_desc *desc; | ||
118 | |||
119 | struct power_supply *fuel_gauge; | ||
120 | struct power_supply **charger_stat; | ||
121 | |||
122 | bool charger_enabled; | ||
123 | |||
124 | int emergency_stop; | ||
125 | int last_temp_mC; | ||
126 | |||
127 | char psy_name_buf[PSY_NAME_MAX + 1]; | ||
128 | struct power_supply charger_psy; | ||
129 | |||
130 | bool status_save_ext_pwr_inserted; | ||
131 | bool status_save_batt; | ||
132 | }; | ||
133 | |||
134 | #ifdef CONFIG_CHARGER_MANAGER | ||
135 | extern int setup_charger_manager(struct charger_global_desc *gd); | ||
136 | extern bool cm_suspend_again(void); | ||
137 | #else | ||
138 | static void __maybe_unused setup_charger_manager(struct charger_global_desc *gd) | ||
139 | { } | ||
140 | |||
141 | static bool __maybe_unused cm_suspend_again(void) | ||
142 | { | ||
143 | return false; | ||
144 | } | ||
145 | #endif | ||
146 | |||
147 | #endif /* _CHARGER_MANAGER_H */ | ||
diff --git a/include/linux/power/bq20z75.h b/include/linux/power/sbs-battery.h index 1398eb004e83..2b0a9d9ff57e 100644 --- a/include/linux/power/bq20z75.h +++ b/include/linux/power/sbs-battery.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Gas Gauge driver for TI's BQ20Z75 | 2 | * Gas Gauge driver for SBS Compliant Gas Gauges |
3 | * | 3 | * |
4 | * Copyright (c) 2010, NVIDIA Corporation. | 4 | * Copyright (c) 2010, NVIDIA Corporation. |
5 | * | 5 | * |
@@ -18,21 +18,21 @@ | |||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef __LINUX_POWER_BQ20Z75_H_ | 21 | #ifndef __LINUX_POWER_SBS_BATTERY_H_ |
22 | #define __LINUX_POWER_BQ20Z75_H_ | 22 | #define __LINUX_POWER_SBS_BATTERY_H_ |
23 | 23 | ||
24 | #include <linux/power_supply.h> | 24 | #include <linux/power_supply.h> |
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | 26 | ||
27 | /** | 27 | /** |
28 | * struct bq20z75_platform_data - platform data for bq20z75 devices | 28 | * struct sbs_platform_data - platform data for sbs devices |
29 | * @battery_detect: GPIO which is used to detect battery presence | 29 | * @battery_detect: GPIO which is used to detect battery presence |
30 | * @battery_detect_present: gpio state when battery is present (0 / 1) | 30 | * @battery_detect_present: gpio state when battery is present (0 / 1) |
31 | * @i2c_retry_count: # of times to retry on i2c IO failure | 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 | 32 | * @poll_retry_count: # of times to retry looking for new status after |
33 | * external change notification | 33 | * external change notification |
34 | */ | 34 | */ |
35 | struct bq20z75_platform_data { | 35 | struct sbs_platform_data { |
36 | int battery_detect; | 36 | int battery_detect; |
37 | int battery_detect_present; | 37 | int battery_detect_present; |
38 | int i2c_retry_count; | 38 | int i2c_retry_count; |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 204c18dfdc9e..fa9b962aec12 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -74,6 +74,12 @@ enum { | |||
74 | POWER_SUPPLY_CAPACITY_LEVEL_FULL, | 74 | POWER_SUPPLY_CAPACITY_LEVEL_FULL, |
75 | }; | 75 | }; |
76 | 76 | ||
77 | enum { | ||
78 | POWER_SUPPLY_SCOPE_UNKNOWN = 0, | ||
79 | POWER_SUPPLY_SCOPE_SYSTEM, | ||
80 | POWER_SUPPLY_SCOPE_DEVICE, | ||
81 | }; | ||
82 | |||
77 | enum power_supply_property { | 83 | enum power_supply_property { |
78 | /* Properties of type `int' */ | 84 | /* Properties of type `int' */ |
79 | POWER_SUPPLY_PROP_STATUS = 0, | 85 | POWER_SUPPLY_PROP_STATUS = 0, |
@@ -116,6 +122,7 @@ enum power_supply_property { | |||
116 | POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, | 122 | POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, |
117 | POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, | 123 | POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, |
118 | POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ | 124 | POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */ |
125 | POWER_SUPPLY_PROP_SCOPE, | ||
119 | /* Properties of type `const char *' */ | 126 | /* Properties of type `const char *' */ |
120 | POWER_SUPPLY_PROP_MODEL_NAME, | 127 | POWER_SUPPLY_PROP_MODEL_NAME, |
121 | POWER_SUPPLY_PROP_MANUFACTURER, | 128 | POWER_SUPPLY_PROP_MANUFACTURER, |
@@ -123,7 +130,8 @@ enum power_supply_property { | |||
123 | }; | 130 | }; |
124 | 131 | ||
125 | enum power_supply_type { | 132 | enum power_supply_type { |
126 | POWER_SUPPLY_TYPE_BATTERY = 0, | 133 | POWER_SUPPLY_TYPE_UNKNOWN = 0, |
134 | POWER_SUPPLY_TYPE_BATTERY, | ||
127 | POWER_SUPPLY_TYPE_UPS, | 135 | POWER_SUPPLY_TYPE_UPS, |
128 | POWER_SUPPLY_TYPE_MAINS, | 136 | POWER_SUPPLY_TYPE_MAINS, |
129 | POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */ | 137 | POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */ |
@@ -211,6 +219,7 @@ static inline int power_supply_is_system_supplied(void) { return -ENOSYS; } | |||
211 | extern int power_supply_register(struct device *parent, | 219 | extern int power_supply_register(struct device *parent, |
212 | struct power_supply *psy); | 220 | struct power_supply *psy); |
213 | extern void power_supply_unregister(struct power_supply *psy); | 221 | extern void power_supply_unregister(struct power_supply *psy); |
222 | extern int power_supply_powers(struct power_supply *psy, struct device *dev); | ||
214 | 223 | ||
215 | /* For APM emulation, think legacy userspace. */ | 224 | /* For APM emulation, think legacy userspace. */ |
216 | extern struct class *power_supply_class; | 225 | extern struct class *power_supply_class; |
diff --git a/include/linux/s3c_adc_battery.h b/include/linux/s3c_adc_battery.h index fbe58b7e63eb..99dadbffdd4f 100644 --- a/include/linux/s3c_adc_battery.h +++ b/include/linux/s3c_adc_battery.h | |||
@@ -25,6 +25,10 @@ struct s3c_adc_bat_pdata { | |||
25 | const unsigned int current_channel; | 25 | const unsigned int current_channel; |
26 | const unsigned int backup_volt_channel; | 26 | const unsigned int backup_volt_channel; |
27 | 27 | ||
28 | const unsigned int volt_samples; | ||
29 | const unsigned int current_samples; | ||
30 | const unsigned int backup_volt_samples; | ||
31 | |||
28 | const unsigned int volt_mult; | 32 | const unsigned int volt_mult; |
29 | const unsigned int current_mult; | 33 | const unsigned int current_mult; |
30 | const unsigned int backup_volt_mult; | 34 | const unsigned int backup_volt_mult; |