#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/regulator/userspace-consumer.h>
struct userspace_consumer_data {
struct regulator_bulk_data *supplies;
static ssize_t reg_show_name(struct device *dev,
struct device_attribute *attr, char *buf)
struct userspace_consumer_data *data = dev_get_drvdata(dev);
return sprintf(buf, "%s\n", data->name);
static ssize_t reg_show_state(struct device *dev,
struct device_attribute *attr, char *buf)
struct userspace_consumer_data *data = dev_get_drvdata(dev);
return sprintf(buf, "enabled\n");
return sprintf(buf, "disabled\n");
static ssize_t reg_set_state(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
struct userspace_consumer_data *data = dev_get_drvdata(dev);