#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/power_supply.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/regmap.h>
#include <linux/bitops.h>
#include <linux/devm-helpers.h>
#define SBS_CHARGER_REG_SPEC_INFO …
#define SBS_CHARGER_REG_STATUS …
#define SBS_CHARGER_REG_ALARM_WARNING …
#define SBS_CHARGER_STATUS_CHARGE_INHIBITED …
#define SBS_CHARGER_STATUS_RES_COLD …
#define SBS_CHARGER_STATUS_RES_HOT …
#define SBS_CHARGER_STATUS_BATTERY_PRESENT …
#define SBS_CHARGER_STATUS_AC_PRESENT …
#define SBS_CHARGER_POLL_TIME …
struct sbs_info { … };
static int sbs_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static int sbs_check_state(struct sbs_info *chip)
{ … }
static void sbs_delayed_work(struct work_struct *work)
{ … }
static irqreturn_t sbs_irq_thread(int irq, void *data)
{ … }
static enum power_supply_property sbs_properties[] = …;
static bool sbs_readable_reg(struct device *dev, unsigned int reg)
{ … }
static bool sbs_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config sbs_regmap = …;
static const struct power_supply_desc sbs_desc = …;
static int sbs_probe(struct i2c_client *client)
{ … }
#ifdef CONFIG_OF
static const struct of_device_id sbs_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, sbs_dt_ids);
#endif
static const struct i2c_device_id sbs_id[] = …;
MODULE_DEVICE_TABLE(i2c, sbs_id);
static struct i2c_driver sbs_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;