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-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
3 @@ -36,7 +36,12 @@
4  #include <linux/slab.h>
5  #include <asm/unaligned.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 DRIVER_VERSION                 "1.2.0"
16  
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,
21 +/*
22         POWER_SUPPLY_PROP_CAPACITY_LEVEL,
23 +*/
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,
31 +/*
32         POWER_SUPPLY_PROP_CYCLE_COUNT,
33         POWER_SUPPLY_PROP_ENERGY_NOW,
34 +*/
35  };
36  
37  static unsigned int poll_interval = 360;
38 @@ -353,7 +362,9 @@ static void bq27x00_battery_poll(struct
39  
40         if (poll_interval > 0) {
41                 /* The timer does not have to be accurate. */
42 +               /*
43                 set_timer_slack(&di->work.timer, poll_interval * HZ / 4);
44 +               */
45                 schedule_delayed_work(&di->work, poll_interval * HZ);
46         }
47  }
48 @@ -423,6 +434,7 @@ static int bq27x00_battery_status(struct
49         return 0;
50  }
51  
52 +/*
53  static int bq27x00_battery_capacity_level(struct bq27x00_device_info *di,
54         union power_supply_propval *val)
55  {
56 @@ -452,6 +464,7 @@ static int bq27x00_battery_capacity_leve
57  
58         return 0;
59  }
60 +*/
61  
62  /*
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);
67                 break;
68 +/*
69         case POWER_SUPPLY_PROP_CAPACITY_LEVEL:
70                 ret = bq27x00_battery_capacity_level(di, val);
71                 break;
72 +*/
73         case POWER_SUPPLY_PROP_TEMP:
74                 ret = bq27x00_simple_value(di->cache.temperature, val);
75                 break;
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);
79                 break;
80 +/*
81         case POWER_SUPPLY_PROP_CYCLE_COUNT:
82                 ret = bq27x00_simple_value(di->cache.cycle_count, val);
83                 break;
84         case POWER_SUPPLY_PROP_ENERGY_NOW:
85                 ret = bq27x00_simple_value(di->cache.energy, val);
86                 break;
87 +*/
88         default:
89                 return -EINVAL;
90         }