kernel-power v49 -> kernel-bfs
[kernel-bfs] / kernel-bfs-2.6.28 / debian / patches / bq27x00-maemo.diff
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
3 @@ -39,7 +39,20 @@
4  #include <asm/unaligned.h>
5  #include <asm/uaccess.h>
6  
7 -#include <linux/power/bq27x00_battery.h>
8 +#define CONFIG_BATTERY_BQ27X00_I2C
9 +
10 +struct bq27000_platform_data {
11 +       const char *name;
12 +       int (*read)(struct device *dev, unsigned int);
13 +};
14 +
15 +#define BQ27X00_READ_REG _IO(MISC_MAJOR, 0)
16 +
17 +struct bq27x00_reg_parms {
18 +       int reg;
19 +       int single;
20 +       int ret;
21 +};
22  
23  #define DRIVER_VERSION                 "1.2.0"
24  
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,
29 +/*
30         POWER_SUPPLY_PROP_CAPACITY_LEVEL,
31 +*/
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,
39 +/*
40         POWER_SUPPLY_PROP_CYCLE_COUNT,
41         POWER_SUPPLY_PROP_ENERGY_NOW,
42 +*/
43  };
44  
45  static unsigned int poll_interval = 360;
46 @@ -370,7 +387,9 @@ static void bq27x00_battery_poll(struct
47  
48         if (poll_interval > 0) {
49                 /* The timer does not have to be accurate. */
50 +               /*
51                 set_timer_slack(&di->work.timer, poll_interval * HZ / 4);
52 +               */
53                 schedule_delayed_work(&di->work, poll_interval * HZ);
54         }
55  }
56 @@ -440,6 +459,7 @@ static int bq27x00_battery_status(struct
57         return 0;
58  }
59  
60 +/*
61  static int bq27x00_battery_capacity_level(struct bq27x00_device_info *di,
62         union power_supply_propval *val)
63  {
64 @@ -469,6 +489,7 @@ static int bq27x00_battery_capacity_leve
65  
66         return 0;
67  }
68 +*/
69  
70  /*
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);
75                 break;
76 +/*
77         case POWER_SUPPLY_PROP_CAPACITY_LEVEL:
78                 ret = bq27x00_battery_capacity_level(di, val);
79                 break;
80 +*/
81         case POWER_SUPPLY_PROP_TEMP:
82                 ret = bq27x00_simple_value(di->cache.temperature, val);
83                 break;
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);
87                 break;
88 +/*
89         case POWER_SUPPLY_PROP_CYCLE_COUNT:
90                 ret = bq27x00_simple_value(di->cache.cycle_count, val);
91                 break;
92         case POWER_SUPPLY_PROP_ENERGY_NOW:
93                 ret = bq27x00_simple_value(di->cache.energy, val);
94                 break;
95 +*/
96         default:
97                 return -EINVAL;
98         }