#include <linux/module.h>
#include <linux/leds-regulator.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#define to_regulator_led(led_cdev) \
container_of(led_cdev, struct regulator_led, cdev)
struct led_classdev cdev;
static inline int led_regulator_get_max_brightness(struct regulator *supply)
int voltage = regulator_list_voltage(supply, 0);
ret = regulator_set_voltage(supply, voltage, voltage);
return regulator_count_voltages(supply);
static int led_regulator_get_voltage(struct regulator *supply,
enum led_brightness brightness)
return regulator_list_voltage(supply, brightness - 1);
static void regulator_led_enable(struct regulator_led *led)