linux/drivers/power/supply/sc2731_charger.c

// SPDX-License-Identifier: GPL-2.0
// Copyright (C) 2018 Spreadtrum Communications Inc.

#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/usb/phy.h>
#include <linux/regmap.h>
#include <linux/notifier.h>
#include <linux/of.h>

/* PMIC global registers definition */
#define SC2731_CHARGE_STATUS
#define SC2731_CHARGE_FULL
#define SC2731_MODULE_EN1
#define SC2731_CHARGE_EN

/* SC2731 switch charger registers definition */
#define SC2731_CHG_CFG0
#define SC2731_CHG_CFG1
#define SC2731_CHG_CFG2
#define SC2731_CHG_CFG3
#define SC2731_CHG_CFG4
#define SC2731_CHG_CFG5

/* SC2731_CHG_CFG0 register definition */
#define SC2731_PRECHG_RNG_SHIFT
#define SC2731_PRECHG_RNG_MASK

#define SC2731_TERMINATION_VOL_MASK
#define SC2731_TERMINATION_VOL_SHIFT
#define SC2731_TERMINATION_VOL_CAL_MASK
#define SC2731_TERMINATION_VOL_CAL_SHIFT
#define SC2731_TERMINATION_CUR_MASK

#define SC2731_CC_EN
#define SC2731_CHARGER_PD

/* SC2731_CHG_CFG1 register definition */
#define SC2731_CUR_MASK

/* SC2731_CHG_CFG5 register definition */
#define SC2731_CUR_LIMIT_SHIFT
#define SC2731_CUR_LIMIT_MASK

/* Default current definition (unit is mA) */
#define SC2731_CURRENT_LIMIT_100
#define SC2731_CURRENT_LIMIT_500
#define SC2731_CURRENT_LIMIT_900
#define SC2731_CURRENT_LIMIT_2000
#define SC2731_CURRENT_PRECHG
#define SC2731_CURRENT_STEP

struct sc2731_charger_info {};

static void sc2731_charger_stop_charge(struct sc2731_charger_info *info)
{}

static int sc2731_charger_start_charge(struct sc2731_charger_info *info)
{}

static int sc2731_charger_set_current_limit(struct sc2731_charger_info *info,
					    u32 limit)
{}

static int sc2731_charger_set_current(struct sc2731_charger_info *info, u32 cur)
{}

static int sc2731_charger_get_status(struct sc2731_charger_info *info)
{}

static int sc2731_charger_get_current(struct sc2731_charger_info *info,
				      u32 *cur)
{}

static int sc2731_charger_get_current_limit(struct sc2731_charger_info *info,
					    u32 *cur)
{}

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

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

static int sc2731_charger_property_is_writeable(struct power_supply *psy,
						enum power_supply_property psp)
{}

static enum power_supply_property sc2731_usb_props[] =;

static const struct power_supply_desc sc2731_charger_desc =;

static void sc2731_charger_work(struct work_struct *data)
{}

static int sc2731_charger_usb_change(struct notifier_block *nb,
				     unsigned long limit, void *data)
{}

static int sc2731_charger_hw_init(struct sc2731_charger_info *info)
{}

static void sc2731_charger_detect_status(struct sc2731_charger_info *info)
{}

static int sc2731_charger_probe(struct platform_device *pdev)
{}

static void sc2731_charger_remove(struct platform_device *pdev)
{}

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

static struct platform_driver sc2731_charger_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();