linux/drivers/power/supply/lp8727_charger.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for LP8727 Micro/Mini USB IC with integrated charger
 *
 *			Copyright (C) 2011 Texas Instruments
 *			Copyright (C) 2011 National Semiconductor
 */

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/power_supply.h>
#include <linux/platform_data/lp8727.h>
#include <linux/of.h>

#define LP8788_NUM_INTREGS
#define DEFAULT_DEBOUNCE_MSEC

/* Registers */
#define LP8727_CTRL1
#define LP8727_CTRL2
#define LP8727_SWCTRL
#define LP8727_INT1
#define LP8727_INT2
#define LP8727_STATUS1
#define LP8727_STATUS2
#define LP8727_CHGCTRL2

/* CTRL1 register */
#define LP8727_CP_EN
#define LP8727_ADC_EN
#define LP8727_ID200_EN

/* CTRL2 register */
#define LP8727_CHGDET_EN
#define LP8727_INT_EN

/* SWCTRL register */
#define LP8727_SW_DM1_DM
#define LP8727_SW_DM1_HiZ
#define LP8727_SW_DP2_DP
#define LP8727_SW_DP2_HiZ

/* INT1 register */
#define LP8727_IDNO
#define LP8727_VBUS

/* STATUS1 register */
#define LP8727_CHGSTAT
#define LP8727_CHPORT
#define LP8727_DCPORT
#define LP8727_STAT_EOC

/* STATUS2 register */
#define LP8727_TEMP_STAT
#define LP8727_TEMP_SHIFT

/* CHGCTRL2 register */
#define LP8727_ICHG_SHIFT

enum lp8727_dev_id {};

enum lp8727_die_temp {};

struct lp8727_psy {};

struct lp8727_chg {};

static int lp8727_read_bytes(struct lp8727_chg *pchg, u8 reg, u8 *data, u8 len)
{}

static inline int lp8727_read_byte(struct lp8727_chg *pchg, u8 reg, u8 *data)
{}

static int lp8727_write_byte(struct lp8727_chg *pchg, u8 reg, u8 data)
{}

static bool lp8727_is_charger_attached(const char *name, int id)
{}

static int lp8727_init_device(struct lp8727_chg *pchg)
{}

static int lp8727_is_dedicated_charger(struct lp8727_chg *pchg)
{}

static int lp8727_is_usb_charger(struct lp8727_chg *pchg)
{}

static inline void lp8727_ctrl_switch(struct lp8727_chg *pchg, u8 sw)
{}

static void lp8727_id_detection(struct lp8727_chg *pchg, u8 id, int vbusin)
{}

static void lp8727_enable_chgdet(struct lp8727_chg *pchg)
{}

static void lp8727_delayed_func(struct work_struct *_work)
{}

static irqreturn_t lp8727_isr_func(int irq, void *ptr)
{}

static int lp8727_setup_irq(struct lp8727_chg *pchg)
{}

static void lp8727_release_irq(struct lp8727_chg *pchg)
{}

static enum power_supply_property lp8727_charger_prop[] =;

static enum power_supply_property lp8727_battery_prop[] =;

static char *battery_supplied_to[] =;

static int lp8727_charger_get_property(struct power_supply *psy,
				       enum power_supply_property psp,
				       union power_supply_propval *val)
{}

static bool lp8727_is_high_temperature(enum lp8727_die_temp temp)
{}

static int lp8727_battery_get_property(struct power_supply *psy,
				       enum power_supply_property psp,
				       union power_supply_propval *val)
{}

static void lp8727_charger_changed(struct power_supply *psy)
{}

static const struct power_supply_desc lp8727_ac_desc =;

static const struct power_supply_desc lp8727_usb_desc =;

static const struct power_supply_desc lp8727_batt_desc =;

static int lp8727_register_psy(struct lp8727_chg *pchg)
{}

#ifdef CONFIG_OF
static struct lp8727_chg_param
*lp8727_parse_charge_pdata(struct device *dev, struct device_node *np)
{}

static struct lp8727_platform_data *lp8727_parse_dt(struct device *dev)
{}
#else
static struct lp8727_platform_data *lp8727_parse_dt(struct device *dev)
{
	return NULL;
}
#endif

static int lp8727_probe(struct i2c_client *cl)
{}

static void lp8727_remove(struct i2c_client *cl)
{}

static const struct of_device_id lp8727_dt_ids[] __maybe_unused =;
MODULE_DEVICE_TABLE(of, lp8727_dt_ids);

static const struct i2c_device_id lp8727_ids[] =;
MODULE_DEVICE_TABLE(i2c, lp8727_ids);

static struct i2c_driver lp8727_driver =;
module_i2c_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();