1d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2d4cc6a2eSAntonio Ospite /* 3d4cc6a2eSAntonio Ospite * leds-regulator.h - platform data structure for regulator driven LEDs. 4d4cc6a2eSAntonio Ospite * 5d4cc6a2eSAntonio Ospite * Copyright (C) 2009 Antonio Ospite <ospite@studenti.unina.it> 6d4cc6a2eSAntonio Ospite */ 7d4cc6a2eSAntonio Ospite 8d4cc6a2eSAntonio Ospite #ifndef __LINUX_LEDS_REGULATOR_H 9d4cc6a2eSAntonio Ospite #define __LINUX_LEDS_REGULATOR_H 10d4cc6a2eSAntonio Ospite 11d4cc6a2eSAntonio Ospite /* 12d4cc6a2eSAntonio Ospite * Use "vled" as supply id when declaring the regulator consumer: 13d4cc6a2eSAntonio Ospite * 14d4cc6a2eSAntonio Ospite * static struct regulator_consumer_supply pcap_regulator_VVIB_consumers [] = { 15edb2fd95SAntonio Ospite * { .dev_name = "leds-regulator.0", .supply = "vled" }, 16d4cc6a2eSAntonio Ospite * }; 17d4cc6a2eSAntonio Ospite * 18d4cc6a2eSAntonio Ospite * If you have several regulator driven LEDs, you can append a numerical id to 19d4cc6a2eSAntonio Ospite * .dev_name as done above, and use the same id when declaring the platform 20d4cc6a2eSAntonio Ospite * device: 21d4cc6a2eSAntonio Ospite * 22d4cc6a2eSAntonio Ospite * static struct led_regulator_platform_data a780_vibrator_data = { 23d4cc6a2eSAntonio Ospite * .name = "a780::vibrator", 24d4cc6a2eSAntonio Ospite * }; 25d4cc6a2eSAntonio Ospite * 26d4cc6a2eSAntonio Ospite * static struct platform_device a780_vibrator = { 27d4cc6a2eSAntonio Ospite * .name = "leds-regulator", 28d4cc6a2eSAntonio Ospite * .id = 0, 29d4cc6a2eSAntonio Ospite * .dev = { 30d4cc6a2eSAntonio Ospite * .platform_data = &a780_vibrator_data, 31d4cc6a2eSAntonio Ospite * }, 32d4cc6a2eSAntonio Ospite * }; 33d4cc6a2eSAntonio Ospite */ 34d4cc6a2eSAntonio Ospite 35d4cc6a2eSAntonio Ospite #include <linux/leds.h> 36d4cc6a2eSAntonio Ospite 37d4cc6a2eSAntonio Ospite struct led_regulator_platform_data { 38d4cc6a2eSAntonio Ospite char *name; /* LED name as expected by LED class */ 39d4cc6a2eSAntonio Ospite enum led_brightness brightness; /* initial brightness value */ 40d4cc6a2eSAntonio Ospite }; 41d4cc6a2eSAntonio Ospite 42d4cc6a2eSAntonio Ospite #endif /* __LINUX_LEDS_REGULATOR_H */ 43