kernel-power v49 -> kernel-bfs
[kernel-bfs] / kernel-bfs-2.6.28 / debian / patches / bq27x00-maemo.diff
diff --git a/kernel-bfs-2.6.28/debian/patches/bq27x00-maemo.diff b/kernel-bfs-2.6.28/debian/patches/bq27x00-maemo.diff
new file mode 100644 (file)
index 0000000..5d6f5dc
--- /dev/null
@@ -0,0 +1,90 @@
+--- kernel-power-2.6.28/drivers/power/bq27x00_battery.c        2011-09-21 13:16:45.007978008 +0200
++++ kernel-power-2.6.28/drivers/power/bq27x00_battery.c        2011-09-21 13:49:06.207956191 +0200
+@@ -36,7 +36,12 @@
+ #include <linux/slab.h>
+ #include <asm/unaligned.h>
+-#include <linux/power/bq27x00_battery.h>
++#define CONFIG_BATTERY_BQ27X00_I2C
++
++struct bq27000_platform_data {
++      const char *name;
++      int (*read)(struct device *dev, unsigned int);
++};
+ #define DRIVER_VERSION                        "1.2.0"
+@@ -113,7 +118,9 @@ static enum power_supply_property bq27x0
+       POWER_SUPPLY_PROP_VOLTAGE_NOW,
+       POWER_SUPPLY_PROP_CURRENT_NOW,
+       POWER_SUPPLY_PROP_CAPACITY,
++/*
+       POWER_SUPPLY_PROP_CAPACITY_LEVEL,
++*/
+       POWER_SUPPLY_PROP_TEMP,
+       POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
+       POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG,
+@@ -122,8 +129,10 @@ static enum power_supply_property bq27x0
+       POWER_SUPPLY_PROP_CHARGE_FULL,
+       POWER_SUPPLY_PROP_CHARGE_NOW,
+       POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
++/*
+       POWER_SUPPLY_PROP_CYCLE_COUNT,
+       POWER_SUPPLY_PROP_ENERGY_NOW,
++*/
+ };
+ static unsigned int poll_interval = 360;
+@@ -353,7 +362,9 @@ static void bq27x00_battery_poll(struct
+       if (poll_interval > 0) {
+               /* The timer does not have to be accurate. */
++              /*
+               set_timer_slack(&di->work.timer, poll_interval * HZ / 4);
++              */
+               schedule_delayed_work(&di->work, poll_interval * HZ);
+       }
+ }
+@@ -423,6 +434,7 @@ static int bq27x00_battery_status(struct
+       return 0;
+ }
++/*
+ static int bq27x00_battery_capacity_level(struct bq27x00_device_info *di,
+       union power_supply_propval *val)
+ {
+@@ -452,6 +464,7 @@ static int bq27x00_battery_capacity_leve
+       return 0;
+ }
++*/
+ /*
+  * Return the battery Voltage in milivolts
+@@ -520,9 +533,11 @@ static int bq27x00_battery_get_property(
+       case POWER_SUPPLY_PROP_CAPACITY:
+               ret = bq27x00_simple_value(di->cache.capacity, val);
+               break;
++/*
+       case POWER_SUPPLY_PROP_CAPACITY_LEVEL:
+               ret = bq27x00_battery_capacity_level(di, val);
+               break;
++*/
+       case POWER_SUPPLY_PROP_TEMP:
+               ret = bq27x00_simple_value(di->cache.temperature, val);
+               break;
+@@ -547,12 +562,14 @@ static int bq27x00_battery_get_property(
+       case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
+               ret = bq27x00_simple_value(di->charge_design_full, val);
+               break;
++/*
+       case POWER_SUPPLY_PROP_CYCLE_COUNT:
+               ret = bq27x00_simple_value(di->cache.cycle_count, val);
+               break;
+       case POWER_SUPPLY_PROP_ENERGY_NOW:
+               ret = bq27x00_simple_value(di->cache.energy, val);
+               break;
++*/
+       default:
+               return -EINVAL;
+       }