linux/drivers/power/supply/pm8916_bms_vm.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2023, Nikita Travkin <[email protected]>
 */

#include <linux/errno.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/timekeeping.h>
#include <linux/mod_devicetable.h>

#define PM8916_PERPH_TYPE
#define PM8916_BMS_VM_TYPE

#define PM8916_SEC_ACCESS
#define PM8916_SEC_MAGIC

#define PM8916_BMS_VM_STATUS1
#define PM8916_BMS_VM_FSM_STATE(x)
#define PM8916_BMS_VM_FSM_STATE_S2

#define PM8916_BMS_VM_MODE_CTL
#define PM8916_BMS_VM_MODE_FORCE_S3
#define PM8916_BMS_VM_MODE_NORMAL

#define PM8916_BMS_VM_EN_CTL
#define PM8916_BMS_ENABLED

#define PM8916_BMS_VM_FIFO_LENGTH_CTL
#define PM8916_BMS_VM_S1_SAMPLE_INTERVAL_CTL
#define PM8916_BMS_VM_S2_SAMPLE_INTERVAL_CTL
#define PM8916_BMS_VM_S3_S7_OCV_DATA0
#define PM8916_BMS_VM_BMS_FIFO_REG_0_LSB

/* Using only 1 fifo is broken in hardware */
#define PM8916_BMS_VM_FIFO_COUNT

#define PM8916_BMS_VM_S1_SAMPLE_INTERVAL
#define PM8916_BMS_VM_S2_SAMPLE_INTERVAL

struct pm8916_bms_vm_battery {};

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

static enum power_supply_property pm8916_bms_vm_battery_properties[] =;

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

static const struct power_supply_desc pm8916_bms_vm_battery_psy_desc =;

static int pm8916_bms_vm_battery_probe(struct platform_device *pdev)
{}

static int pm8916_bms_vm_battery_suspend(struct platform_device *pdev, pm_message_t state)
{}

static int pm8916_bms_vm_battery_resume(struct platform_device *pdev)
{}

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

static struct platform_driver pm8916_bms_vm_battery_driver =;
module_platform_driver();

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