#include <linux/bitfield.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/power_supply.h>
#include <linux/regmap.h>
#include <asm/unaligned.h>
#define MAX1720X_NRSENSE …
#define MAX172XX_STATUS …
#define MAX172XX_STATUS_BAT_ABSENT …
#define MAX172XX_REPCAP …
#define MAX172XX_REPSOC …
#define MAX172XX_TEMP …
#define MAX172XX_CURRENT …
#define MAX172XX_AVG_CURRENT …
#define MAX172XX_TTE …
#define MAX172XX_AVG_TA …
#define MAX172XX_CYCLES …
#define MAX172XX_DESIGN_CAP …
#define MAX172XX_AVG_VCELL …
#define MAX172XX_TTF …
#define MAX172XX_DEV_NAME …
#define MAX172XX_DEV_NAME_TYPE_MASK …
#define MAX172XX_DEV_NAME_TYPE_MAX17201 …
#define MAX172XX_DEV_NAME_TYPE_MAX17205 …
#define MAX172XX_QR_TABLE10 …
#define MAX172XX_BATT …
#define MAX172XX_ATAVCAP …
static const char *const max1720x_manufacturer = …;
static const char *const max17201_model = …;
static const char *const max17205_model = …;
struct max1720x_device_info { … };
static const struct regmap_range max1720x_volatile_allow[] = …;
static const struct regmap_range max1720x_readable_allow[] = …;
static const struct regmap_range max1720x_readable_deny[] = …;
static const struct regmap_access_table max1720x_readable_regs = …;
static const struct regmap_access_table max1720x_volatile_regs = …;
static const struct regmap_config max1720x_regmap_cfg = …;
static const enum power_supply_property max1720x_battery_props[] = …;
static int max172xx_time_to_ps(unsigned int reg)
{ … }
static int max172xx_percent_to_ps(unsigned int reg)
{ … }
static int max172xx_voltage_to_ps(unsigned int reg)
{ … }
static int max172xx_capacity_to_ps(unsigned int reg)
{ … }
static int max172xx_temperature_to_ps(unsigned int reg)
{ … }
static int max172xx_current_to_voltage(unsigned int reg)
{ … }
static int max1720x_battery_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static int max1720x_probe_sense_resistor(struct i2c_client *client,
struct max1720x_device_info *info)
{ … }
static const struct power_supply_desc max1720x_bat_desc = …;
static int max1720x_probe(struct i2c_client *client)
{ … }
static const struct of_device_id max1720x_of_match[] = …;
MODULE_DEVICE_TABLE(of, max1720x_of_match);
static struct i2c_driver max1720x_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;