+--- /dev/null
++++ linux-2.6.36-rc7/drivers/cbus/lipocharge.c
+@@ -0,0 +1,63 @@
++/*
++ * Generic LIPO battery charger
++ *
++ * Copyright (c) 2010 Michael Buesch <mb@bu3sch.de>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2
++ * of the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ */
++
++#include "lipocharge.h"
++
++#include <linux/slab.h>
++
++
++static void lipocharge_timer(unsigned long data)
++{
++ struct lipocharge *c = (struct lipocharge *)data;
++
++ spin_lock(&c->lock);
++ //TODO
++ spin_unlock(&c->lock);
++}
++
++struct lipocharge * lipocharge_alloc(gfp_t gfp)
++{
++ struct lipocharge *c;
++
++ c = kzalloc(sizeof(*c), gfp);
++ if (!c)
++ return NULL;
++ spin_lock_init(&c->lock);
++ setup_timer(&c->timer, lipocharge_timer, (unsigned long)c);
++
++ return c;
++}
++
++void lipocharge_free(struct lipocharge *c)
++{
++ kfree(c);
++}
++
++int lipocharge_start(struct lipocharge *c)
++{
++ if (!c->set_current || !c->get_voltage ||
++ !c->finished || !c->emergency)
++ return -EINVAL;
++ if (!c->top_voltage || c->top_voltage > 4200)
++ return -EINVAL;
++ //TODO
++}
++
++void lipocharge_stop(struct lipocharge *c)
++{
++ del_timer_sync(&c->timer);
++ //TODO
++}
+--- /dev/null
++++ linux-2.6.36-rc7/drivers/cbus/lipocharge.h
+@@ -0,0 +1,50 @@
++#ifndef LIPOCHARGE_H_
++#define LIPOCHARGE_H_
++
++#include <linux/timer.h>
++#include <linux/spinlock.h>
++
++
++#define LIPORATE(a,b) (((a) * 1000) + (b))
++#define LIPORATE_1C LIPORATE(1,0) /* 1C */
++#define LIPORATE_p8C LIPORATE(0,8) /* 0.8C */
++
++/** struct lipocharge - A generic LIPO charger
++ *
++ * @capacity: Battery capacity in mAh.
++ * @rate: Charge rate.
++ * @top_voltage: Fully charged voltage, in mV.
++ *
++ * @set_current: Set the charge current, in mA.
++ * @get_voltage: Get the battery voltage, in mV.
++ *
++ * @emergency: Something went wrong. Force shutdown.
++ *
++ * @priv: opaque pointer.
++ */
++struct lipocharge
++{
++ unsigned int capacity;
++ unsigned int rate;
++ unsigned int top_voltage;
++
++ int (*set_current)(struct lipocharge *c, unsigned int ma);
++ int (*get_voltage)(struct lipocharge *c, unsigned int *mv);
++
++ void (*finished)(struct lipocharge *c);
++ void (*emergency)(struct lipocharge *c);
++
++ void *priv;
++
++ /* internal */
++ spinlock_t lock;
++ struct timer_list timer;
++};
++
++struct lipocharge * lipocharge_alloc(gfp_t gfp);
++void lipocharge_free(struct lipocharge *c);
++
++int lipocharge_start(struct lipocharge *c);
++void lipocharge_stop(struct lipocharge *c);
++
++#endif /* LIPOCHARGE_H_ */
+--- linux-2.6.36-rc7.orig/drivers/cbus/tahvo.h
++++ linux-2.6.36-rc7/drivers/cbus/tahvo.h
+@@ -30,8 +30,14 @@
+ #define TAHVO_REG_IDR 0x01 /* Interrupt ID */
+ #define TAHVO_REG_IDSR 0x02 /* Interrupt status */
+ #define TAHVO_REG_IMR 0x03 /* Interrupt mask */
++#define TAHVO_REG_CHGCURR 0x04 /* Charge current control (8-bit) */
+ #define TAHVO_REG_LEDPWMR 0x05 /* LED PWM */
+ #define TAHVO_REG_USBR 0x06 /* USB control */
++#define TAHVO_REG_CHGCTL 0x08 /* Charge control register */
++#define TAHVO_REG_CHGCTL_EN 0x0001 /* Global charge enable */
++#define TAHVO_REG_CHGCTL2 0x0c /* Charge control register 2 */
++#define TAHVO_REG_BATCURR 0x0d /* Battery (dis)charge current (signed 16-bit) */
++
+ #define TAHVO_REG_MAX 0x0d
+
+ /* Interrupt sources */