linux/drivers/power/supply/rn5t618_power.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Power supply driver for the RICOH RN5T618 power management chip family
 *
 * Copyright (C) 2020 Andreas Kemnade
 */

#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/bitops.h>
#include <linux/errno.h>
#include <linux/iio/consumer.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/mfd/rn5t618.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/regmap.h>
#include <linux/slab.h>

#define CHG_STATE_ADP_INPUT
#define CHG_STATE_USB_INPUT
#define CHG_STATE_MASK
#define CHG_STATE_CHG_OFF
#define CHG_STATE_CHG_READY_VADP
#define CHG_STATE_CHG_TRICKLE
#define CHG_STATE_CHG_RAPID
#define CHG_STATE_CHG_COMPLETE
#define CHG_STATE_SUSPEND
#define CHG_STATE_VCHG_OVER_VOL
#define CHG_STATE_BAT_ERROR
#define CHG_STATE_NO_BAT
#define CHG_STATE_BAT_OVER_VOL
#define CHG_STATE_BAT_TEMP_ERR
#define CHG_STATE_DIE_ERR
#define CHG_STATE_DIE_SHUTDOWN
#define CHG_STATE_NO_BAT2
#define CHG_STATE_CHG_READY_VUSB

#define GCHGDET_TYPE_MASK
#define GCHGDET_TYPE_SDP
#define GCHGDET_TYPE_CDP
#define GCHGDET_TYPE_DCP

#define FG_ENABLE

/*
 * Formula seems accurate for battery current, but for USB current around 70mA
 * per step was seen on Kobo Clara HD but all sources show the same formula
 * also fur USB current. To avoid accidentially unwanted high currents we stick
 * to that formula
 */
#define TO_CUR_REG(x)
#define FROM_CUR_REG(x)
#define CHG_MIN_CUR
#define CHG_MAX_CUR
#define ADP_MAX_CUR
#define USB_MAX_CUR


struct rn5t618_power_info {};

static enum power_supply_usb_type rn5t618_usb_types[] =;

static enum power_supply_property rn5t618_usb_props[] =;

static enum power_supply_property rn5t618_adp_props[] =;


static enum power_supply_property rn5t618_battery_props[] =;

static int rn5t618_battery_read_doublereg(struct rn5t618_power_info *info,
					  u8 reg, u16 *result)
{}

static int rn5t618_decode_status(unsigned int status)
{}

static int rn5t618_battery_status(struct rn5t618_power_info *info,
				  union power_supply_propval *val)
{}

static int rn5t618_battery_present(struct rn5t618_power_info *info,
				   union power_supply_propval *val)
{}

static int rn5t618_battery_voltage_now(struct rn5t618_power_info *info,
				       union power_supply_propval *val)
{}

static int rn5t618_battery_current_now(struct rn5t618_power_info *info,
				       union power_supply_propval *val)
{}

static int rn5t618_battery_capacity(struct rn5t618_power_info *info,
				    union power_supply_propval *val)
{}

static int rn5t618_battery_temp(struct rn5t618_power_info *info,
				union power_supply_propval *val)
{}

static int rn5t618_battery_tte(struct rn5t618_power_info *info,
			       union power_supply_propval *val)
{}

static int rn5t618_battery_ttf(struct rn5t618_power_info *info,
			       union power_supply_propval *val)
{}

static int rn5t618_battery_set_current_limit(struct rn5t618_power_info *info,
				const union power_supply_propval *val)
{}

static int rn5t618_battery_get_current_limit(struct rn5t618_power_info *info,
					     union power_supply_propval *val)
{}

static int rn5t618_battery_charge_full(struct rn5t618_power_info *info,
				       union power_supply_propval *val)
{}

static int rn5t618_battery_charge_now(struct rn5t618_power_info *info,
				      union power_supply_propval *val)
{}

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

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

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

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

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

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

static int rc5t619_usb_get_type(struct rn5t618_power_info *info,
				union power_supply_propval *val)
{}

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

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

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

static const struct power_supply_desc rn5t618_battery_desc =;

static const struct power_supply_desc rn5t618_adp_desc =;

static const struct power_supply_desc rn5t618_usb_desc =;

static irqreturn_t rn5t618_charger_irq(int irq, void *data)
{}

static int rn5t618_power_probe(struct platform_device *pdev)
{}

static struct platform_driver rn5t618_power_driver =;

module_platform_driver();
MODULE_ALIAS();
MODULE_DESCRIPTION();
MODULE_LICENSE();