#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regulator/gpio-regulator.h>
#include <linux/gpio/consumer.h>
#include <linux/slab.h>
#include <linux/of.h>
struct gpio_regulator_data { … };
static int gpio_regulator_get_value(struct regulator_dev *dev)
{ … }
static int gpio_regulator_set_voltage(struct regulator_dev *dev,
int min_uV, int max_uV,
unsigned *selector)
{ … }
static int gpio_regulator_list_voltage(struct regulator_dev *dev,
unsigned selector)
{ … }
static int gpio_regulator_set_current_limit(struct regulator_dev *dev,
int min_uA, int max_uA)
{ … }
static const struct regulator_ops gpio_regulator_voltage_ops = …;
static struct gpio_regulator_config *
of_get_gpio_regulator_config(struct device *dev, struct device_node *np,
const struct regulator_desc *desc)
{ … }
static const struct regulator_ops gpio_regulator_current_ops = …;
static int gpio_regulator_probe(struct platform_device *pdev)
{ … }
#if defined(CONFIG_OF)
static const struct of_device_id regulator_gpio_of_match[] = …;
MODULE_DEVICE_TABLE(of, regulator_gpio_of_match);
#endif
static struct platform_driver gpio_regulator_driver = …;
static int __init gpio_regulator_init(void)
{ … }
subsys_initcall(gpio_regulator_init);
static void __exit gpio_regulator_exit(void)
{ … }
module_exit(gpio_regulator_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;