linux/drivers/power/supply/gpio-charger.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Copyright (C) 2010, Lars-Peter Clausen <[email protected]>
 *  Driver for chargers which report their online status through a GPIO pin
 */

#include <linux/device.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/gpio/consumer.h>

#include <linux/power/gpio-charger.h>

struct gpio_mapping {} __packed;

struct gpio_charger {};

static irqreturn_t gpio_charger_irq(int irq, void *devid)
{}

static inline struct gpio_charger *psy_to_gpio_charger(struct power_supply *psy)
{}

static int set_charge_current_limit(struct gpio_charger *gpio_charger, int val)
{}

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

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

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

static enum power_supply_type gpio_charger_get_type(struct device *dev)
{}

static int gpio_charger_get_irq(struct device *dev, void *dev_id,
				struct gpio_desc *gpio)
{}

static int init_charge_current_limit(struct device *dev,
				    struct gpio_charger *gpio_charger)
{}

/*
 * The entries will be overwritten by driver's probe routine depending
 * on the available features. This list ensures, that the array is big
 * enough for all optional features.
 */
static enum power_supply_property gpio_charger_properties[] =;

static int gpio_charger_probe(struct platform_device *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static int gpio_charger_suspend(struct device *dev)
{}

static int gpio_charger_resume(struct device *dev)
{}
#endif

static SIMPLE_DEV_PM_OPS(gpio_charger_pm_ops,
		gpio_charger_suspend, gpio_charger_resume);

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

static struct platform_driver gpio_charger_driver =;

module_platform_driver();

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