#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/wm97xx.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/gpio/consumer.h>
#include <linux/irq.h>
#include <linux/slab.h>
static struct work_struct bat_work;
static struct gpio_desc *charge_gpiod;
static DEFINE_MUTEX(work_lock);
static int bat_status = …;
static enum power_supply_property *prop;
static unsigned long wm97xx_read_bat(struct power_supply *bat_ps)
{ … }
static unsigned long wm97xx_read_temp(struct power_supply *bat_ps)
{ … }
static int wm97xx_bat_get_property(struct power_supply *bat_ps,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static void wm97xx_bat_external_power_changed(struct power_supply *bat_ps)
{ … }
static void wm97xx_bat_update(struct power_supply *bat_ps)
{ … }
static struct power_supply *bat_psy;
static struct power_supply_desc bat_psy_desc = …;
static void wm97xx_bat_work(struct work_struct *work)
{ … }
static irqreturn_t wm97xx_chrg_irq(int irq, void *data)
{ … }
#ifdef CONFIG_PM
static int wm97xx_bat_suspend(struct device *dev)
{ … }
static int wm97xx_bat_resume(struct device *dev)
{ … }
static const struct dev_pm_ops wm97xx_bat_pm_ops = …;
#endif
static int wm97xx_bat_probe(struct platform_device *dev)
{ … }
static void wm97xx_bat_remove(struct platform_device *dev)
{ … }
static struct platform_driver wm97xx_bat_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;