hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/leds/leds-lp55xx-common.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * LP55XX Common Driver Header
34 *
....@@ -5,15 +6,13 @@
56 *
67 * Author: Milo(Woogyom) Kim <milo.kim@ti.com>
78 *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License
10
- * version 2 as published by the Free Software Foundation.
11
- *
129 * Derived from leds-lp5521.c, leds-lp5523.c
1310 */
1411
1512 #ifndef _LEDS_LP55XX_COMMON_H
1613 #define _LEDS_LP55XX_COMMON_H
14
+
15
+#include <linux/led-class-multicolor.h>
1716
1817 enum lp55xx_engine_index {
1918 LP55XX_ENGINE_INVALID,
....@@ -96,6 +95,7 @@
9695 * @max_channel : Maximum number of channels
9796 * @post_init_device : Chip specific initialization code
9897 * @brightness_fn : Brightness function
98
+ * @multicolor_brightness_fn : Multicolor brightness function
9999 * @set_led_current : LED current set function
100100 * @firmware_cb : Call function when the firmware is loaded
101101 * @run_engine : Run internal engine for pattern
....@@ -109,8 +109,11 @@
109109 /* define if the device has specific initialization process */
110110 int (*post_init_device) (struct lp55xx_chip *chip);
111111
112
- /* access brightness register */
112
+ /* set LED brightness */
113113 int (*brightness_fn)(struct lp55xx_led *led);
114
+
115
+ /* set multicolor LED brightness */
116
+ int (*multicolor_brightness_fn)(struct lp55xx_led *led);
114117
115118 /* current setting function */
116119 void (*set_led_current) (struct lp55xx_led *led, u8 led_current);
....@@ -162,6 +165,8 @@
162165 * struct lp55xx_led
163166 * @chan_nr : Channel number
164167 * @cdev : LED class device
168
+ * @mc_cdev : Multi color class device
169
+ * @color_components: Multi color LED map information
165170 * @led_current : Current setting at each led channel
166171 * @max_current : Maximun current at each led channel
167172 * @brightness : Brightness value
....@@ -170,6 +175,7 @@
170175 struct lp55xx_led {
171176 int chan_nr;
172177 struct led_classdev cdev;
178
+ struct led_classdev_mc mc_cdev;
173179 u8 led_current;
174180 u8 max_current;
175181 u8 brightness;
....@@ -192,8 +198,6 @@
192198 /* common LED class device functions */
193199 extern int lp55xx_register_leds(struct lp55xx_led *led,
194200 struct lp55xx_chip *chip);
195
-extern void lp55xx_unregister_leds(struct lp55xx_led *led,
196
- struct lp55xx_chip *chip);
197201
198202 /* common device attributes functions */
199203 extern int lp55xx_register_sysfs(struct lp55xx_chip *chip);
....@@ -201,6 +205,7 @@
201205
202206 /* common device tree population function */
203207 extern struct lp55xx_platform_data
204
-*lp55xx_of_populate_pdata(struct device *dev, struct device_node *np);
208
+*lp55xx_of_populate_pdata(struct device *dev, struct device_node *np,
209
+ struct lp55xx_chip *chip);
205210
206211 #endif /* _LEDS_LP55XX_COMMON_H */