#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/regulator/userspace-consumer.h>
#include <linux/slab.h>
struct userspace_consumer_data { … };
static ssize_t name_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t state_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t state_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RO(name);
static DEVICE_ATTR_RW(state);
static struct attribute *attributes[] = …;
static umode_t attr_visible(struct kobject *kobj, struct attribute *attr, int idx)
{ … }
static const struct attribute_group attr_group = …;
static int regulator_userspace_consumer_probe(struct platform_device *pdev)
{ … }
static void regulator_userspace_consumer_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id regulator_userspace_consumer_of_match[] = …;
MODULE_DEVICE_TABLE(of, regulator_userspace_consumer_of_match);
static struct platform_driver regulator_userspace_consumer_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;