#include <linux/delay.h>
#include <linux/freezer.h>
#include <linux/fs.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/timer.h>
#include <linux/uaccess.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/mfd/da9052/da9052.h>
#include <linux/mfd/da9052/pdata.h>
#include <linux/mfd/da9052/reg.h>
#define DA9052_BAT_CUTOFF_VOLT …
#define DA9052_BAT_TSH …
#define DA9052_BAT_LOW_CAP …
#define DA9052_AVG_SZ …
#define DA9052_VC_TBL_SZ …
#define DA9052_VC_TBL_REF_SZ …
#define DA9052_ISET_USB_MASK …
#define DA9052_CHG_USB_ILIM_MASK …
#define DA9052_CHG_LIM_COLS …
#define DA9052_MEAN(x, y) …
enum charger_type_enum { … };
static const u16 da9052_chg_current_lim[2][DA9052_CHG_LIM_COLS] = …;
static const u16 vc_tbl_ref[3] = …;
static u32 const vc_tbl[3][68][2] = …;
struct da9052_battery { … };
static inline int volt_reg_to_mV(int value)
{ … }
static inline int ichg_reg_to_mA(int value)
{ … }
static int da9052_read_chgend_current(struct da9052_battery *bat,
int *current_mA)
{ … }
static int da9052_read_chg_current(struct da9052_battery *bat, int *current_mA)
{ … }
static int da9052_bat_check_status(struct da9052_battery *bat, int *status)
{ … }
static int da9052_bat_read_volt(struct da9052_battery *bat, int *volt_mV)
{ … }
static int da9052_bat_check_presence(struct da9052_battery *bat, int *illegal)
{ … }
static int da9052_bat_interpolate(int vbat_lower, int vbat_upper,
int level_lower, int level_upper,
int bat_voltage)
{ … }
static unsigned char da9052_determine_vc_tbl_index(unsigned char adc_temp)
{ … }
static int da9052_bat_read_capacity(struct da9052_battery *bat, int *capacity)
{ … }
static int da9052_bat_check_health(struct da9052_battery *bat, int *health)
{ … }
static irqreturn_t da9052_bat_irq(int irq, void *data)
{ … }
static int da9052_USB_current_notifier(struct notifier_block *nb,
unsigned long events, void *data)
{ … }
static int da9052_bat_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static enum power_supply_property da9052_bat_props[] = …;
static struct power_supply_desc psy_desc = …;
static char *da9052_bat_irqs[] = …;
static int da9052_bat_irq_bits[] = …;
static s32 da9052_bat_probe(struct platform_device *pdev)
{ … }
static void da9052_bat_remove(struct platform_device *pdev)
{ … }
static struct platform_driver da9052_bat_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;