#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/power_supply.h>
#include <linux/mfd/88pm860x.h>
#include <linux/delay.h>
#include <linux/uaccess.h>
#include <asm/div64.h>
#define STATUS2_CHG …
#define RESET_SW_PD …
#define PREREG1_90MA …
#define PREREG1_180MA …
#define PREREG1_450MA …
#define PREREG1_540MA …
#define PREREG1_1350MA …
#define PREREG1_VSYS_4_5V …
#define CC1_MODE_OFF …
#define CC1_MODE_PRECHARGE …
#define CC1_MODE_FASTCHARGE …
#define CC1_MODE_PULSECHARGE …
#define CC1_ITERM_20MA …
#define CC1_ITERM_60MA …
#define CC1_VFCHG_4_2V …
#define CC2_ICHG_100MA …
#define CC2_ICHG_500MA …
#define CC2_ICHG_1000MA …
#define CC3_180MIN_TIMEOUT …
#define CC3_270MIN_TIMEOUT …
#define CC3_360MIN_TIMEOUT …
#define CC3_DISABLE_TIMEOUT …
#define CC4_IPRE_40MA …
#define CC4_VPCHG_3_2V …
#define CC4_IFCHG_MON_EN …
#define CC4_BTEMP_MON_EN …
#define CC6_BAT_OV_EN …
#define CC6_BAT_UV_EN …
#define CC6_UV_VBAT_SET …
#define CC7_BAT_REM_EN …
#define CC7_IFSM_EN …
#define MEAS1_VBAT …
#define MEAS3_IBAT_EN …
#define MEAS3_CC_EN …
#define FSM_INIT …
#define FSM_DISCHARGE …
#define FSM_PRECHARGE …
#define FSM_FASTCHARGE …
#define PRECHARGE_THRESHOLD …
#define POWEROFF_THRESHOLD …
#define CHARGE_THRESHOLD …
#define DISCHARGE_THRESHOLD …
#define OVER_TEMP_FLAG …
#define OVTEMP_AUTORECOVER …
#define VCHG_NORMAL_LOW …
#define VCHG_NORMAL_CHECK …
#define VCHG_NORMAL_HIGH …
#define VCHG_OVP_LOW …
struct pm860x_charger_info { … };
static char *pm860x_supplied_to[] = …;
static int measure_vchg(struct pm860x_charger_info *info, int *data)
{ … }
static void set_vchg_threshold(struct pm860x_charger_info *info,
int min, int max)
{ … }
static void set_vbatt_threshold(struct pm860x_charger_info *info,
int min, int max)
{ … }
static int start_precharge(struct pm860x_charger_info *info)
{ … }
static int start_fastcharge(struct pm860x_charger_info *info)
{ … }
static void stop_charge(struct pm860x_charger_info *info, int vbatt)
{ … }
static void power_off_notification(struct pm860x_charger_info *info)
{ … }
static int set_charging_fsm(struct pm860x_charger_info *info)
{ … }
static irqreturn_t pm860x_charger_handler(int irq, void *data)
{ … }
static irqreturn_t pm860x_temp_handler(int irq, void *data)
{ … }
static irqreturn_t pm860x_exception_handler(int irq, void *data)
{ … }
static irqreturn_t pm860x_done_handler(int irq, void *data)
{ … }
static irqreturn_t pm860x_vbattery_handler(int irq, void *data)
{ … }
static irqreturn_t pm860x_vchg_handler(int irq, void *data)
{ … }
static int pm860x_usb_get_prop(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static enum power_supply_property pm860x_usb_props[] = …;
static int pm860x_init_charger(struct pm860x_charger_info *info)
{ … }
static struct pm860x_irq_desc { … } pm860x_irq_descs[] = …;
static const struct power_supply_desc pm860x_charger_desc = …;
static int pm860x_charger_probe(struct platform_device *pdev)
{ … }
static struct platform_driver pm860x_charger_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;