linux/drivers/power/supply/generic-adc-battery.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Generic battery driver using IIO
 * Copyright (C) 2012, Anish Kumar <[email protected]>
 * Copyright (c) 2023, Sebastian Reichel <[email protected]>
 */
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/gpio/consumer.h>
#include <linux/err.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/iio/consumer.h>
#include <linux/iio/types.h>
#include <linux/of.h>
#include <linux/devm-helpers.h>

#define JITTER_DEFAULT

enum gab_chan_type {};

/*
 * gab_chan_name suggests the standard channel names for commonly used
 * channel types.
 */
static const char *const gab_chan_name[] =;

struct gab {};

static struct gab *to_generic_bat(struct power_supply *psy)
{}

static void gab_ext_power_changed(struct power_supply *psy)
{}

static const enum power_supply_property gab_props[] =;

/*
 * This properties are set based on the received platform data and this
 * should correspond one-to-one with enum chan_type.
 */
static const enum power_supply_property gab_dyn_props[] =;

static bool gab_charge_finished(struct gab *adc_bat)
{}

static int gab_read_channel(struct gab *adc_bat, enum gab_chan_type channel,
		int *result)
{}

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

static void gab_work(struct work_struct *work)
{}

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

static int gab_probe(struct platform_device *pdev)
{}

static int __maybe_unused gab_suspend(struct device *dev)
{}

static int __maybe_unused gab_resume(struct device *dev)
{}

static SIMPLE_DEV_PM_OPS(gab_pm_ops, gab_suspend, gab_resume);

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

static struct platform_driver gab_driver =;
module_platform_driver();

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