hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/include/linux/led-class-flash.h
....@@ -1,13 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * LED Flash class interface
34 *
45 * Copyright (C) 2015 Samsung Electronics Co., Ltd.
56 * 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
- *
117 */
128 #ifndef __LINUX_FLASH_LEDS_H_INCLUDED
139 #define __LINUX_FLASH_LEDS_H_INCLUDED
....@@ -90,15 +86,23 @@
9086 }
9187
9288 /**
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
9692 * @fled_cdev: the led_classdev_flash structure for this device
93
+ * @init_data: the LED class flash device initialization data
9794 *
9895 * Returns: 0 on success or negative error value on failure
9996 */
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
+}
102106
103107 /**
104108 * led_classdev_flash_unregister - unregisters an object of led_classdev class
....@@ -107,7 +111,21 @@
107111 *
108112 * Unregister a previously registered via led_classdev_flash_register object
109113 */
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);
111129
112130 /**
113131 * led_set_flash_strobe - setup flash strobe
....@@ -155,8 +173,8 @@
155173 *
156174 * Returns: 0 on success or negative error value on failure
157175 */
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);
160178
161179 /**
162180 * led_update_flash_brightness - update flash LED brightness
....@@ -167,7 +185,7 @@
167185 *
168186 * Returns: 0 on success or negative error value on failure
169187 */
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);
171189
172190 /**
173191 * led_set_flash_timeout - set flash LED timeout
....@@ -178,8 +196,7 @@
178196 *
179197 * Returns: 0 on success or negative error value on failure
180198 */
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);
183200
184201 /**
185202 * led_get_flash_fault - get the flash LED fault
....@@ -190,7 +207,6 @@
190207 *
191208 * Returns: 0 on success or negative error value on failure
192209 */
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);
195211
196212 #endif /* __LINUX_FLASH_LEDS_H_INCLUDED */