| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * LED Flash class interface |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2015 Samsung Electronics Co., Ltd. |
|---|
| 5 | 6 | * Author: Jacek Anaszewski <j.anaszewski@samsung.com> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | | - * |
|---|
| 11 | 7 | */ |
|---|
| 12 | 8 | #ifndef __LINUX_FLASH_LEDS_H_INCLUDED |
|---|
| 13 | 9 | #define __LINUX_FLASH_LEDS_H_INCLUDED |
|---|
| .. | .. |
|---|
| 90 | 86 | } |
|---|
| 91 | 87 | |
|---|
| 92 | 88 | /** |
|---|
| 93 | | - * led_classdev_flash_register - register a new object of led_classdev class |
|---|
| 94 | | - * with support for flash LEDs |
|---|
| 95 | | - * @parent: the flash LED to register |
|---|
| 89 | + * led_classdev_flash_register_ext - register a new object of LED class with |
|---|
| 90 | + * init data and with support for flash LEDs |
|---|
| 91 | + * @parent: LED flash controller device this flash LED is driven by |
|---|
| 96 | 92 | * @fled_cdev: the led_classdev_flash structure for this device |
|---|
| 93 | + * @init_data: the LED class flash device initialization data |
|---|
| 97 | 94 | * |
|---|
| 98 | 95 | * Returns: 0 on success or negative error value on failure |
|---|
| 99 | 96 | */ |
|---|
| 100 | | -extern int led_classdev_flash_register(struct device *parent, |
|---|
| 101 | | - struct led_classdev_flash *fled_cdev); |
|---|
| 97 | +int led_classdev_flash_register_ext(struct device *parent, |
|---|
| 98 | + struct led_classdev_flash *fled_cdev, |
|---|
| 99 | + struct led_init_data *init_data); |
|---|
| 100 | + |
|---|
| 101 | +static inline int led_classdev_flash_register(struct device *parent, |
|---|
| 102 | + struct led_classdev_flash *fled_cdev) |
|---|
| 103 | +{ |
|---|
| 104 | + return led_classdev_flash_register_ext(parent, fled_cdev, NULL); |
|---|
| 105 | +} |
|---|
| 102 | 106 | |
|---|
| 103 | 107 | /** |
|---|
| 104 | 108 | * led_classdev_flash_unregister - unregisters an object of led_classdev class |
|---|
| .. | .. |
|---|
| 107 | 111 | * |
|---|
| 108 | 112 | * Unregister a previously registered via led_classdev_flash_register object |
|---|
| 109 | 113 | */ |
|---|
| 110 | | -extern void led_classdev_flash_unregister(struct led_classdev_flash *fled_cdev); |
|---|
| 114 | +void led_classdev_flash_unregister(struct led_classdev_flash *fled_cdev); |
|---|
| 115 | + |
|---|
| 116 | +int devm_led_classdev_flash_register_ext(struct device *parent, |
|---|
| 117 | + struct led_classdev_flash *fled_cdev, |
|---|
| 118 | + struct led_init_data *init_data); |
|---|
| 119 | + |
|---|
| 120 | + |
|---|
| 121 | +static inline int devm_led_classdev_flash_register(struct device *parent, |
|---|
| 122 | + struct led_classdev_flash *fled_cdev) |
|---|
| 123 | +{ |
|---|
| 124 | + return devm_led_classdev_flash_register_ext(parent, fled_cdev, NULL); |
|---|
| 125 | +} |
|---|
| 126 | + |
|---|
| 127 | +void devm_led_classdev_flash_unregister(struct device *parent, |
|---|
| 128 | + struct led_classdev_flash *fled_cdev); |
|---|
| 111 | 129 | |
|---|
| 112 | 130 | /** |
|---|
| 113 | 131 | * led_set_flash_strobe - setup flash strobe |
|---|
| .. | .. |
|---|
| 155 | 173 | * |
|---|
| 156 | 174 | * Returns: 0 on success or negative error value on failure |
|---|
| 157 | 175 | */ |
|---|
| 158 | | -extern int led_set_flash_brightness(struct led_classdev_flash *fled_cdev, |
|---|
| 159 | | - u32 brightness); |
|---|
| 176 | +int led_set_flash_brightness(struct led_classdev_flash *fled_cdev, |
|---|
| 177 | + u32 brightness); |
|---|
| 160 | 178 | |
|---|
| 161 | 179 | /** |
|---|
| 162 | 180 | * led_update_flash_brightness - update flash LED brightness |
|---|
| .. | .. |
|---|
| 167 | 185 | * |
|---|
| 168 | 186 | * Returns: 0 on success or negative error value on failure |
|---|
| 169 | 187 | */ |
|---|
| 170 | | -extern int led_update_flash_brightness(struct led_classdev_flash *fled_cdev); |
|---|
| 188 | +int led_update_flash_brightness(struct led_classdev_flash *fled_cdev); |
|---|
| 171 | 189 | |
|---|
| 172 | 190 | /** |
|---|
| 173 | 191 | * led_set_flash_timeout - set flash LED timeout |
|---|
| .. | .. |
|---|
| 178 | 196 | * |
|---|
| 179 | 197 | * Returns: 0 on success or negative error value on failure |
|---|
| 180 | 198 | */ |
|---|
| 181 | | -extern int led_set_flash_timeout(struct led_classdev_flash *fled_cdev, |
|---|
| 182 | | - u32 timeout); |
|---|
| 199 | +int led_set_flash_timeout(struct led_classdev_flash *fled_cdev, u32 timeout); |
|---|
| 183 | 200 | |
|---|
| 184 | 201 | /** |
|---|
| 185 | 202 | * led_get_flash_fault - get the flash LED fault |
|---|
| .. | .. |
|---|
| 190 | 207 | * |
|---|
| 191 | 208 | * Returns: 0 on success or negative error value on failure |
|---|
| 192 | 209 | */ |
|---|
| 193 | | -extern int led_get_flash_fault(struct led_classdev_flash *fled_cdev, |
|---|
| 194 | | - u32 *fault); |
|---|
| 210 | +int led_get_flash_fault(struct led_classdev_flash *fled_cdev, u32 *fault); |
|---|
| 195 | 211 | |
|---|
| 196 | 212 | #endif /* __LINUX_FLASH_LEDS_H_INCLUDED */ |
|---|