#include <linux/bits.h>
#include <linux/freezer.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/power_supply.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/of_regulator.h>
#define UCS1002_REG_CURRENT_MEASUREMENT …
#define UCS1002_REG_TOTAL_ACC_CHARGE …
#define UCS1002_REG_OTHER_STATUS …
#define F_ADET_PIN …
#define F_CHG_ACT …
#define UCS1002_REG_INTERRUPT_STATUS …
#define F_ERR …
#define F_DISCHARGE_ERR …
#define F_RESET …
#define F_MIN_KEEP_OUT …
#define F_TSD …
#define F_OVER_VOLT …
#define F_BACK_VOLT …
#define F_OVER_ILIM …
#define UCS1002_REG_PIN_STATUS …
#define UCS1002_PWR_STATE_MASK …
#define F_PWR_EN_PIN …
#define F_M2_PIN …
#define F_M1_PIN …
#define F_EM_EN_PIN …
#define F_SEL_PIN …
#define F_ACTIVE_MODE_MASK …
#define F_ACTIVE_MODE_PASSTHROUGH …
#define F_ACTIVE_MODE_DEDICATED …
#define F_ACTIVE_MODE_BC12_DCP …
#define F_ACTIVE_MODE_BC12_SDP …
#define F_ACTIVE_MODE_BC12_CDP …
#define UCS1002_REG_GENERAL_CFG …
#define F_RATION_EN …
#define UCS1002_REG_EMU_CFG …
#define UCS1002_REG_SWITCH_CFG …
#define F_PIN_IGNORE …
#define F_EM_EN_SET …
#define F_M2_SET …
#define F_M1_SET …
#define F_S0_SET …
#define F_PWR_EN_SET …
#define F_LATCH_SET …
#define V_SET_ACTIVE_MODE_MASK …
#define V_SET_ACTIVE_MODE_PASSTHROUGH …
#define V_SET_ACTIVE_MODE_DEDICATED …
#define V_SET_ACTIVE_MODE_BC12_DCP …
#define V_SET_ACTIVE_MODE_BC12_SDP …
#define V_SET_ACTIVE_MODE_BC12_CDP …
#define UCS1002_REG_ILIMIT …
#define UCS1002_ILIM_SW_MASK …
#define UCS1002_REG_PRODUCT_ID …
#define UCS1002_PRODUCT_ID …
#define UCS1002_MANUFACTURER …
struct ucs1002_info { … };
static enum power_supply_property ucs1002_props[] = …;
static int ucs1002_get_online(struct ucs1002_info *info,
union power_supply_propval *val)
{ … }
static int ucs1002_get_charge(struct ucs1002_info *info,
union power_supply_propval *val)
{ … }
static int ucs1002_get_current(struct ucs1002_info *info,
union power_supply_propval *val)
{ … }
static const u32 ucs1002_current_limit_uA[] = …;
static int ucs1002_get_max_current(struct ucs1002_info *info,
union power_supply_propval *val)
{ … }
static int ucs1002_set_max_current(struct ucs1002_info *info, u32 val)
{ … }
static enum power_supply_usb_type ucs1002_usb_types[] = …;
static int ucs1002_set_usb_type(struct ucs1002_info *info, int val)
{ … }
static int ucs1002_get_usb_type(struct ucs1002_info *info,
union power_supply_propval *val)
{ … }
static int ucs1002_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{ … }
static int ucs1002_set_property(struct power_supply *psy,
enum power_supply_property psp,
const union power_supply_propval *val)
{ … }
static int ucs1002_property_is_writeable(struct power_supply *psy,
enum power_supply_property psp)
{ … }
static const struct power_supply_desc ucs1002_charger_desc = …;
static void ucs1002_health_poll(struct work_struct *work)
{ … }
static irqreturn_t ucs1002_charger_irq(int irq, void *data)
{ … }
static irqreturn_t ucs1002_alert_irq(int irq, void *data)
{ … }
static int ucs1002_regulator_enable(struct regulator_dev *rdev)
{ … }
static const struct regulator_ops ucs1002_regulator_ops = …;
static const struct regulator_desc ucs1002_regulator_descriptor = …;
static int ucs1002_probe(struct i2c_client *client)
{ … }
static const struct of_device_id ucs1002_of_match[] = …;
MODULE_DEVICE_TABLE(of, ucs1002_of_match);
static struct i2c_driver ucs1002_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;