linux/drivers/power/supply/axp20x_usb_power.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * AXP20x PMIC USB power supply status driver
 *
 * Copyright (C) 2015 Hans de Goede <[email protected]>
 * Copyright (C) 2014 Bruno Prémont <[email protected]>
 */

#include <linux/bitops.h>
#include <linux/device.h>
#include <linux/devm-helpers.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mfd/axp20x.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/power_supply.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/iio/consumer.h>
#include <linux/workqueue.h>

#define DRVNAME

#define AXP192_USB_OTG_STATUS

#define AXP20X_PWR_STATUS_VBUS_PRESENT
#define AXP20X_PWR_STATUS_VBUS_USED

#define AXP20X_USB_STATUS_VBUS_VALID

#define AXP20X_VBUS_VHOLD_uV(b)
#define AXP20X_VBUS_VHOLD_MASK
#define AXP20X_VBUS_VHOLD_OFFSET

#define AXP20X_ADC_EN1_VBUS_CURR
#define AXP20X_ADC_EN1_VBUS_VOLT

/*
 * Note do not raise the debounce time, we must report Vusb high within
 * 100ms otherwise we get Vbus errors in musb.
 */
#define DEBOUNCE_TIME

struct axp_data {};

struct axp20x_usb_power {};

static bool axp20x_usb_vbus_needs_polling(struct axp20x_usb_power *power)
{}

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

static void axp20x_usb_power_poll_vbus(struct work_struct *work)
{}

static int axp20x_get_usb_type(struct axp20x_usb_power *power,
			       union power_supply_propval *val)
{}

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

static int axp20x_usb_power_set_voltage_min(struct axp20x_usb_power *power,
					    int intval)
{}

static int axp20x_usb_power_set_input_current_limit(struct axp20x_usb_power *power,
						    int intval)
{}

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

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

static enum power_supply_property axp20x_usb_power_properties[] =;

static enum power_supply_property axp22x_usb_power_properties[] =;

static enum power_supply_property axp813_usb_power_properties[] =;

static enum power_supply_usb_type axp813_usb_types[] =;

static const struct power_supply_desc axp20x_usb_power_desc =;

static const struct power_supply_desc axp22x_usb_power_desc =;

static const struct power_supply_desc axp813_usb_power_desc =;

static const char * const axp20x_irq_names[] =;

static const char * const axp22x_irq_names[] =;

static int axp192_usb_curr_lim_table[] =;

static int axp20x_usb_curr_lim_table[] =;

static int axp221_usb_curr_lim_table[] =;

static int axp813_usb_curr_lim_table[] =;

static const struct axp_data axp192_data =;

static const struct axp_data axp202_data =;

static const struct axp_data axp221_data =;

static const struct axp_data axp223_data =;

static const struct axp_data axp813_data =;

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

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

static SIMPLE_DEV_PM_OPS(axp20x_usb_power_pm_ops, axp20x_usb_power_suspend,
						  axp20x_usb_power_resume);

static int configure_iio_channels(struct platform_device *pdev,
				  struct axp20x_usb_power *power)
{}

static int configure_adc_registers(struct axp20x_usb_power *power)
{}

static int axp20x_regmap_field_alloc_optional(struct device *dev,
					      struct regmap *regmap,
					      struct reg_field fdesc,
					      struct regmap_field **fieldp)
{}

static int axp20x_usb_power_probe(struct platform_device *pdev)
{}

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

static struct platform_driver axp20x_usb_power_driver =;

module_platform_driver();

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