131921Sbrian/* SPDX-License-Identifier: GPL-2.0-only */ 231921Sbrian/* 331921Sbrian * leds-regulator.h - platform data structure for regulator driven LEDs. 431921Sbrian * 531921Sbrian * Copyright (C) 2009 Antonio Ospite <ospite@studenti.unina.it> 631921Sbrian */ 731921Sbrian 831921Sbrian#ifndef __LINUX_LEDS_REGULATOR_H 931921Sbrian#define __LINUX_LEDS_REGULATOR_H 1031921Sbrian 1131921Sbrian/* 1231921Sbrian * Use "vled" as supply id when declaring the regulator consumer: 1331921Sbrian * 1431921Sbrian * static struct regulator_consumer_supply pcap_regulator_VVIB_consumers [] = { 1531921Sbrian * { .dev_name = "leds-regulator.0", .supply = "vled" }, 1631921Sbrian * }; 1731921Sbrian * 1831921Sbrian * If you have several regulator driven LEDs, you can append a numerical id to 1931921Sbrian * .dev_name as done above, and use the same id when declaring the platform 2031921Sbrian * device: 2131921Sbrian * 2231921Sbrian * static struct led_regulator_platform_data a780_vibrator_data = { 2331921Sbrian * .name = "a780::vibrator", 2431921Sbrian * }; 2531921Sbrian * 2650479Speter * static struct platform_device a780_vibrator = { 2731061Sbrian * .name = "leds-regulator", 2831061Sbrian * .id = 0, 2964802Sbrian * .dev = { 30202192Sed * .platform_data = &a780_vibrator_data, 3136285Sbrian * }, 3233603Sbrian * }; 3331061Sbrian */ 3431061Sbrian 3531061Sbrian#include <linux/leds.h> 3631061Sbrian 3731061Sbrianstruct led_regulator_platform_data { 3831061Sbrian char *name; /* LED name as expected by LED class */ 3936285Sbrian enum led_brightness brightness; /* initial brightness value */ 4032025Sbrian}; 4131061Sbrian 4236450Sbrian#endif /* __LINUX_LEDS_REGULATOR_H */ 4331061Sbrian