1 --- kernel-power-2.6.28/drivers/power/bq27x00_battery.c 2011-10-09 17:23:49.655669727 +0200
2 +++ kernel-power-2.6.28/drivers/power/bq27x00_battery.c 2011-10-09 17:24:58.823667413 +0200
4 #include <asm/unaligned.h>
5 #include <asm/uaccess.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 BQ27X00_READ_REG _IO(MISC_MAJOR, 0)
17 +struct bq27x00_reg_parms {
23 #define DRIVER_VERSION "1.2.0"
25 @@ -123,7 +136,9 @@ static enum power_supply_property bq27x0
26 POWER_SUPPLY_PROP_VOLTAGE_NOW,
27 POWER_SUPPLY_PROP_CURRENT_NOW,
28 POWER_SUPPLY_PROP_CAPACITY,
30 POWER_SUPPLY_PROP_CAPACITY_LEVEL,
32 POWER_SUPPLY_PROP_TEMP,
33 POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
34 POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG,
35 @@ -132,8 +147,10 @@ static enum power_supply_property bq27x0
36 POWER_SUPPLY_PROP_CHARGE_FULL,
37 POWER_SUPPLY_PROP_CHARGE_NOW,
38 POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
40 POWER_SUPPLY_PROP_CYCLE_COUNT,
41 POWER_SUPPLY_PROP_ENERGY_NOW,
45 static unsigned int poll_interval = 360;
46 @@ -370,7 +387,9 @@ static void bq27x00_battery_poll(struct
48 if (poll_interval > 0) {
49 /* The timer does not have to be accurate. */
51 set_timer_slack(&di->work.timer, poll_interval * HZ / 4);
53 schedule_delayed_work(&di->work, poll_interval * HZ);
56 @@ -440,6 +459,7 @@ static int bq27x00_battery_status(struct
61 static int bq27x00_battery_capacity_level(struct bq27x00_device_info *di,
62 union power_supply_propval *val)
64 @@ -469,6 +489,7 @@ static int bq27x00_battery_capacity_leve
71 * Return the battery Voltage in milivolts
72 @@ -537,9 +558,11 @@ static int bq27x00_battery_get_property(
73 case POWER_SUPPLY_PROP_CAPACITY:
74 ret = bq27x00_simple_value(di->cache.capacity, val);
77 case POWER_SUPPLY_PROP_CAPACITY_LEVEL:
78 ret = bq27x00_battery_capacity_level(di, val);
81 case POWER_SUPPLY_PROP_TEMP:
82 ret = bq27x00_simple_value(di->cache.temperature, val);
84 @@ -564,12 +587,14 @@ static int bq27x00_battery_get_property(
85 case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
86 ret = bq27x00_simple_value(di->charge_design_full, val);
89 case POWER_SUPPLY_PROP_CYCLE_COUNT:
90 ret = bq27x00_simple_value(di->cache.cycle_count, val);
92 case POWER_SUPPLY_PROP_ENERGY_NOW:
93 ret = bq27x00_simple_value(di->cache.energy, val);