| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * LP55XX Common Driver Header |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Milo(Woogyom) Kim <milo.kim@ti.com> |
|---|
| 7 | 8 | * |
|---|
| 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 | | - * |
|---|
| 12 | 9 | * Derived from leds-lp5521.c, leds-lp5523.c |
|---|
| 13 | 10 | */ |
|---|
| 14 | 11 | |
|---|
| 15 | 12 | #ifndef _LEDS_LP55XX_COMMON_H |
|---|
| 16 | 13 | #define _LEDS_LP55XX_COMMON_H |
|---|
| 14 | + |
|---|
| 15 | +#include <linux/led-class-multicolor.h> |
|---|
| 17 | 16 | |
|---|
| 18 | 17 | enum lp55xx_engine_index { |
|---|
| 19 | 18 | LP55XX_ENGINE_INVALID, |
|---|
| .. | .. |
|---|
| 96 | 95 | * @max_channel : Maximum number of channels |
|---|
| 97 | 96 | * @post_init_device : Chip specific initialization code |
|---|
| 98 | 97 | * @brightness_fn : Brightness function |
|---|
| 98 | + * @multicolor_brightness_fn : Multicolor brightness function |
|---|
| 99 | 99 | * @set_led_current : LED current set function |
|---|
| 100 | 100 | * @firmware_cb : Call function when the firmware is loaded |
|---|
| 101 | 101 | * @run_engine : Run internal engine for pattern |
|---|
| .. | .. |
|---|
| 109 | 109 | /* define if the device has specific initialization process */ |
|---|
| 110 | 110 | int (*post_init_device) (struct lp55xx_chip *chip); |
|---|
| 111 | 111 | |
|---|
| 112 | | - /* access brightness register */ |
|---|
| 112 | + /* set LED brightness */ |
|---|
| 113 | 113 | int (*brightness_fn)(struct lp55xx_led *led); |
|---|
| 114 | + |
|---|
| 115 | + /* set multicolor LED brightness */ |
|---|
| 116 | + int (*multicolor_brightness_fn)(struct lp55xx_led *led); |
|---|
| 114 | 117 | |
|---|
| 115 | 118 | /* current setting function */ |
|---|
| 116 | 119 | void (*set_led_current) (struct lp55xx_led *led, u8 led_current); |
|---|
| .. | .. |
|---|
| 162 | 165 | * struct lp55xx_led |
|---|
| 163 | 166 | * @chan_nr : Channel number |
|---|
| 164 | 167 | * @cdev : LED class device |
|---|
| 168 | + * @mc_cdev : Multi color class device |
|---|
| 169 | + * @color_components: Multi color LED map information |
|---|
| 165 | 170 | * @led_current : Current setting at each led channel |
|---|
| 166 | 171 | * @max_current : Maximun current at each led channel |
|---|
| 167 | 172 | * @brightness : Brightness value |
|---|
| .. | .. |
|---|
| 170 | 175 | struct lp55xx_led { |
|---|
| 171 | 176 | int chan_nr; |
|---|
| 172 | 177 | struct led_classdev cdev; |
|---|
| 178 | + struct led_classdev_mc mc_cdev; |
|---|
| 173 | 179 | u8 led_current; |
|---|
| 174 | 180 | u8 max_current; |
|---|
| 175 | 181 | u8 brightness; |
|---|
| .. | .. |
|---|
| 192 | 198 | /* common LED class device functions */ |
|---|
| 193 | 199 | extern int lp55xx_register_leds(struct lp55xx_led *led, |
|---|
| 194 | 200 | struct lp55xx_chip *chip); |
|---|
| 195 | | -extern void lp55xx_unregister_leds(struct lp55xx_led *led, |
|---|
| 196 | | - struct lp55xx_chip *chip); |
|---|
| 197 | 201 | |
|---|
| 198 | 202 | /* common device attributes functions */ |
|---|
| 199 | 203 | extern int lp55xx_register_sysfs(struct lp55xx_chip *chip); |
|---|
| .. | .. |
|---|
| 201 | 205 | |
|---|
| 202 | 206 | /* common device tree population function */ |
|---|
| 203 | 207 | 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); |
|---|
| 205 | 210 | |
|---|
| 206 | 211 | #endif /* _LEDS_LP55XX_COMMON_H */ |
|---|