linux/drivers/power/supply/act8945a_charger.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Power supply driver for the Active-semi ACT8945A PMIC
 *
 * Copyright (C) 2015 Atmel Corporation
 *
 * Author: Wenyou Yang <[email protected]>
 */
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/regmap.h>
#include <linux/gpio/consumer.h>

static const char *act8945a_charger_model =;
static const char *act8945a_charger_manufacturer =;

/*
 * ACT8945A Charger Register Map
 */

/* 0x70: Reserved */
#define ACT8945A_APCH_CFG
#define ACT8945A_APCH_STATUS
#define ACT8945A_APCH_CTRL
#define ACT8945A_APCH_STATE

/* ACT8945A_APCH_CFG */
#define APCH_CFG_OVPSET
#define APCH_CFG_OVPSET_6V6
#define APCH_CFG_OVPSET_7V
#define APCH_CFG_OVPSET_7V5
#define APCH_CFG_OVPSET_8V
#define APCH_CFG_PRETIMO
#define APCH_CFG_PRETIMO_40_MIN
#define APCH_CFG_PRETIMO_60_MIN
#define APCH_CFG_PRETIMO_80_MIN
#define APCH_CFG_PRETIMO_DISABLED
#define APCH_CFG_TOTTIMO
#define APCH_CFG_TOTTIMO_3_HOUR
#define APCH_CFG_TOTTIMO_4_HOUR
#define APCH_CFG_TOTTIMO_5_HOUR
#define APCH_CFG_TOTTIMO_DISABLED
#define APCH_CFG_SUSCHG

#define APCH_STATUS_CHGDAT
#define APCH_STATUS_INDAT
#define APCH_STATUS_TEMPDAT
#define APCH_STATUS_TIMRDAT
#define APCH_STATUS_CHGSTAT
#define APCH_STATUS_INSTAT
#define APCH_STATUS_TEMPSTAT
#define APCH_STATUS_TIMRSTAT

#define APCH_CTRL_CHGEOCOUT
#define APCH_CTRL_INDIS
#define APCH_CTRL_TEMPOUT
#define APCH_CTRL_TIMRPRE
#define APCH_CTRL_CHGEOCIN
#define APCH_CTRL_INCON
#define APCH_CTRL_TEMPIN
#define APCH_CTRL_TIMRTOT

#define APCH_STATE_ACINSTAT
#define APCH_STATE_CSTATE
#define APCH_STATE_CSTATE_SHIFT
#define APCH_STATE_CSTATE_DISABLED
#define APCH_STATE_CSTATE_EOC
#define APCH_STATE_CSTATE_FAST
#define APCH_STATE_CSTATE_PRE

struct act8945a_charger {};

static int act8945a_get_charger_state(struct regmap *regmap, int *val)
{}

static int act8945a_get_charge_type(struct regmap *regmap, int *val)
{}

static int act8945a_get_battery_health(struct regmap *regmap, int *val)
{}

static int act8945a_get_capacity_level(struct act8945a_charger *charger,
				       struct regmap *regmap, int *val)
{}

#define MAX_CURRENT_USB_HIGH
#define MAX_CURRENT_USB_LOW
#define MAX_CURRENT_USB_PRE
/*
 * Riset(K) = 2336 * (1V/Ichg(mA)) - 0.205
 * Riset = 2.43K
 */
#define MAX_CURRENT_AC_HIGH
#define MAX_CURRENT_AC_LOW
#define MAX_CURRENT_AC_HIGH_PRE
#define MAX_CURRENT_AC_LOW_PRE

static int act8945a_get_current_max(struct act8945a_charger *charger,
				    struct regmap *regmap, int *val)
{}

static enum power_supply_property act8945a_charger_props[] =;

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

static int act8945a_enable_interrupt(struct act8945a_charger *charger)
{}

static unsigned int act8945a_set_supply_type(struct act8945a_charger *charger,
					     unsigned int *type)
{}

static void act8945a_work(struct work_struct *work)
{}

static irqreturn_t act8945a_status_changed(int irq, void *dev_id)
{}

#define DEFAULT_TOTAL_TIME_OUT
#define DEFAULT_PRE_TIME_OUT
#define DEFAULT_INPUT_OVP_THRESHOLD

static int act8945a_charger_config(struct device *dev,
				   struct act8945a_charger *charger)
{}

static int act8945a_charger_probe(struct platform_device *pdev)
{}

static void act8945a_charger_remove(struct platform_device *pdev)
{}

static struct platform_driver act8945a_charger_driver =;
module_platform_driver();

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