SmartAudio/lichee/linux-4.9/drivers/power/supply/axp/axp-virtual.h

60 lines
1.4 KiB
C
Executable File

/*
* drivers/power/axp/axp-virtual.h
* (C) Copyright 2010-2016
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
* Pannan <pannan@allwinnertech.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
*/
#include <linux/platform_device.h>
#include "axp-core.h"
struct axp_virtual_dev_mapping {
char device_name[32];
char regulator_name[32];
};
/*
* struct regulator
*
* One for each consumer device.
*/
struct regulator {
struct device *dev;
struct list_head list;
unsigned int always_on:1;
unsigned int bypass:1;
int ua_load;
int min_uv;
int max_uv;
char *supply_name;
struct device_attribute dev_attr;
struct regulator_dev *rdev;
struct dentry *debugfs;
};
struct virtual_consumer_data {
struct mutex lock;
int enabled;
int min_uv;
int max_uv;
int min_ua;
int max_ua;
char regu_name[16];
};
extern struct device_attribute *attributes_virtual[4];
extern int axp_add_virtual_regulator_devices(struct platform_device *pdev,
int size,
struct axp_virtual_dev_mapping *mapping);
extern void axp_init_virtual_regulator_drivers(struct platform_driver *pdrv,
int size,
struct axp_virtual_dev_mapping *mapping,
int (*_probe)(struct platform_device *),
int (*_remove)(struct platform_device *));