summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-lp55xx-common.h
diff options
context:
space:
mode:
authorDan Murphy <dmurphy@ti.com>2020-07-16 13:20:01 -0500
committerPavel Machek <pavel@ucw.cz>2020-07-22 14:42:06 +0200
commit92a81562e695628086acb92f95090ab09d9b9ec0 (patch)
tree7d41c63208ac3429720c7ad844827eb944ffbb0a /drivers/leds/leds-lp55xx-common.h
parentc732eaf01f9c213d34b2d224bcda830089bbcf8a (diff)
leds: lp55xx: Add multicolor framework support to lp55xx
Add multicolor framework support for the lp55xx family. Acked-by: Pavel Machek <pavel@ucw.cz> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Signed-off-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/leds-lp55xx-common.h')
-rw-r--r--drivers/leds/leds-lp55xx-common.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/leds/leds-lp55xx-common.h b/drivers/leds/leds-lp55xx-common.h
index b9b1041e8143..2f38c5b33830 100644
--- a/drivers/leds/leds-lp55xx-common.h
+++ b/drivers/leds/leds-lp55xx-common.h
@@ -12,6 +12,8 @@
#ifndef _LEDS_LP55XX_COMMON_H
#define _LEDS_LP55XX_COMMON_H
+#include <linux/led-class-multicolor.h>
+
enum lp55xx_engine_index {
LP55XX_ENGINE_INVALID,
LP55XX_ENGINE_1,
@@ -93,6 +95,7 @@ struct lp55xx_reg {
* @max_channel : Maximum number of channels
* @post_init_device : Chip specific initialization code
* @brightness_fn : Brightness function
+ * @multicolor_brightness_fn : Multicolor brightness function
* @set_led_current : LED current set function
* @firmware_cb : Call function when the firmware is loaded
* @run_engine : Run internal engine for pattern
@@ -106,9 +109,12 @@ struct lp55xx_device_config {
/* define if the device has specific initialization process */
int (*post_init_device) (struct lp55xx_chip *chip);
- /* access brightness register */
+ /* set LED brightness */
int (*brightness_fn)(struct lp55xx_led *led);
+ /* set multicolor LED brightness */
+ int (*multicolor_brightness_fn)(struct lp55xx_led *led);
+
/* current setting function */
void (*set_led_current) (struct lp55xx_led *led, u8 led_current);
@@ -159,6 +165,8 @@ struct lp55xx_chip {
* struct lp55xx_led
* @chan_nr : Channel number
* @cdev : LED class device
+ * @mc_cdev : Multi color class device
+ * @color_components: Multi color LED map information
* @led_current : Current setting at each led channel
* @max_current : Maximun current at each led channel
* @brightness : Brightness value
@@ -167,6 +175,7 @@ struct lp55xx_chip {
struct lp55xx_led {
int chan_nr;
struct led_classdev cdev;
+ struct led_classdev_mc mc_cdev;
u8 led_current;
u8 max_current;
u8 brightness;
@@ -196,6 +205,7 @@ extern void lp55xx_unregister_sysfs(struct lp55xx_chip *chip);
/* common device tree population function */
extern struct lp55xx_platform_data
-*lp55xx_of_populate_pdata(struct device *dev, struct device_node *np);
+*lp55xx_of_populate_pdata(struct device *dev, struct device_node *np,
+ struct lp55xx_chip *chip);
#endif /* _LEDS_LP55XX_COMMON_H */