#include <linux/module.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/mfd/max8925.h>
#define MAX8925_OUT5VEN …
#define MAX8925_OUT3VEN …
#define MAX8925_CHG_CNTL1 …
#define MAX8925_CHG_STAT_VSYSLOW …
#define MAX8925_CHG_STAT_MODE_MASK …
#define MAX8925_CHG_STAT_EN_MASK …
#define MAX8925_CHG_MBDET …
#define MAX8925_CHG_AC_RANGE_MASK …
#define MAX8925_ADC_RES_CNFG1 …
#define MAX8925_ADC_AVG_CNFG1 …
#define MAX8925_ADC_ACQ_CNFG1 …
#define MAX8925_ADC_ACQ_CNFG2 …
#define MAX8925_ADC_AUX2 …
#define MAX8925_ADC_VCHG …
#define MAX8925_ADC_VBBATT …
#define MAX8925_ADC_VMBATT …
#define MAX8925_ADC_ISNS …
#define MAX8925_ADC_THM …
#define MAX8925_ADC_TDIE …
#define MAX8925_CMD_AUX2 …
#define MAX8925_CMD_VCHG …
#define MAX8925_CMD_VBBATT …
#define MAX8925_CMD_VMBATT …
#define MAX8925_CMD_ISNS …
#define MAX8925_CMD_THM …
#define MAX8925_CMD_TDIE …
enum { … };
struct max8925_power_info { … };
static int __set_charger(struct max8925_power_info *info, int enable)
{ … }
static irqreturn_t max8925_charger_handler(int irq, void *data)
{ … }
static int start_measure(struct max8925_power_info *info, int type)
{ … }
static int max8925_ac_get_prop(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static enum power_supply_property max8925_ac_props[] = …;
static int max8925_usb_get_prop(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static enum power_supply_property max8925_usb_props[] = …;
static int max8925_bat_get_prop(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static enum power_supply_property max8925_battery_props[] = …;
static const struct power_supply_desc ac_desc = …;
static const struct power_supply_desc usb_desc = …;
static const struct power_supply_desc battery_desc = …;
#define REQUEST_IRQ(_irq, _name) …
static int max8925_init_charger(struct max8925_chip *chip,
struct max8925_power_info *info)
{ … }
static int max8925_deinit_charger(struct max8925_power_info *info)
{ … }
#ifdef CONFIG_OF
static struct max8925_power_pdata *
max8925_power_dt_init(struct platform_device *pdev)
{ … }
#else
static struct max8925_power_pdata *
max8925_power_dt_init(struct platform_device *pdev)
{
return pdev->dev.platform_data;
}
#endif
static int max8925_power_probe(struct platform_device *pdev)
{ … }
static void max8925_power_remove(struct platform_device *pdev)
{ … }
static struct platform_driver max8925_power_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS(…) …;