1 --- kernel-power-2.6.28/drivers/power/bq27x00_battery.c 2011-09-21 13:16:45.007978008 +0200
2 +++ kernel-power-2.6.28/drivers/power/bq27x00_battery.c 2011-09-21 13:49:06.207956191 +0200
4 #include <linux/slab.h>
5 #include <asm/unaligned.h>
7 -#include <linux/power/bq27x00_battery.h>
8 +#define CONFIG_BATTERY_BQ27X00_I2C
10 +struct bq27000_platform_data {
12 + int (*read)(struct device *dev, unsigned int);
15 #define DRIVER_VERSION "1.2.0"
17 @@ -113,7 +118,9 @@ static enum power_supply_property bq27x0
18 POWER_SUPPLY_PROP_VOLTAGE_NOW,
19 POWER_SUPPLY_PROP_CURRENT_NOW,
20 POWER_SUPPLY_PROP_CAPACITY,
22 POWER_SUPPLY_PROP_CAPACITY_LEVEL,
24 POWER_SUPPLY_PROP_TEMP,
25 POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
26 POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG,
27 @@ -122,8 +129,10 @@ static enum power_supply_property bq27x0
28 POWER_SUPPLY_PROP_CHARGE_FULL,
29 POWER_SUPPLY_PROP_CHARGE_NOW,
30 POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
32 POWER_SUPPLY_PROP_CYCLE_COUNT,
33 POWER_SUPPLY_PROP_ENERGY_NOW,
37 static unsigned int poll_interval = 360;
38 @@ -353,7 +362,9 @@ static void bq27x00_battery_poll(struct
40 if (poll_interval > 0) {
41 /* The timer does not have to be accurate. */
43 set_timer_slack(&di->work.timer, poll_interval * HZ / 4);
45 schedule_delayed_work(&di->work, poll_interval * HZ);
48 @@ -423,6 +434,7 @@ static int bq27x00_battery_status(struct
53 static int bq27x00_battery_capacity_level(struct bq27x00_device_info *di,
54 union power_supply_propval *val)
56 @@ -452,6 +464,7 @@ static int bq27x00_battery_capacity_leve
63 * Return the battery Voltage in milivolts
64 @@ -520,9 +533,11 @@ static int bq27x00_battery_get_property(
65 case POWER_SUPPLY_PROP_CAPACITY:
66 ret = bq27x00_simple_value(di->cache.capacity, val);
69 case POWER_SUPPLY_PROP_CAPACITY_LEVEL:
70 ret = bq27x00_battery_capacity_level(di, val);
73 case POWER_SUPPLY_PROP_TEMP:
74 ret = bq27x00_simple_value(di->cache.temperature, val);
76 @@ -547,12 +562,14 @@ static int bq27x00_battery_get_property(
77 case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
78 ret = bq27x00_simple_value(di->charge_design_full, val);
81 case POWER_SUPPLY_PROP_CYCLE_COUNT:
82 ret = bq27x00_simple_value(di->cache.cycle_count, val);
84 case POWER_SUPPLY_PROP_ENERGY_NOW:
85 ret = bq27x00_simple_value(di->cache.energy, val);