#include <linux/err.h>
#include <linux/extcon.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/mfd/max8997.h>
#include <linux/mfd/max8997-private.h>
#include <linux/regulator/consumer.h>
#include <linux/devm-helpers.h>
#define DCINOK_SHIFT …
#define DCINOK_MASK …
#define DETBAT_SHIFT …
#define DETBAT_MASK …
#define TFCH_SHIFT …
#define TFCH_MASK …
#define ITOPOFF_SHIFT …
#define ITOPOFF_MASK …
struct charger_data { … };
static enum power_supply_property max8997_battery_props[] = …;
static int max8997_battery_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static void max8997_battery_extcon_evt_worker(struct work_struct *work)
{ … }
static int max8997_battery_extcon_evt(struct notifier_block *nb,
unsigned long event, void *param)
{ … }
static const struct power_supply_desc max8997_battery_desc = …;
static int max8997_battery_probe(struct platform_device *pdev)
{ … }
static const struct platform_device_id max8997_battery_id[] = …;
MODULE_DEVICE_TABLE(platform, max8997_battery_id);
static struct platform_driver max8997_battery_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;