1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * LED driver for TI lp3952 controller
5 * Copyright (C) 2016, DAQRI, LLC.
10 #define LEDS_LP3952_H_
12 #define LP3952_NAME "lp3952"
13 #define LP3952_CMD_REG_COUNT 8
14 #define LP3952_BRIGHT_MAX 4
15 #define LP3952_LABEL_MAX_LEN 15
17 #define LP3952_REG_LED_CTRL 0x00
18 #define LP3952_REG_R1_BLNK_TIME_CTRL 0x01
19 #define LP3952_REG_R1_BLNK_CYCLE_CTRL 0x02
20 #define LP3952_REG_G1_BLNK_TIME_CTRL 0x03
21 #define LP3952_REG_G1_BLNK_CYCLE_CTRL 0x04
22 #define LP3952_REG_B1_BLNK_TIME_CTRL 0x05
23 #define LP3952_REG_B1_BLNK_CYCLE_CTRL 0x06
24 #define LP3952_REG_ENABLES 0x0B
25 #define LP3952_REG_PAT_GEN_CTRL 0x11
26 #define LP3952_REG_RGB1_MAX_I_CTRL 0x12
27 #define LP3952_REG_RGB2_MAX_I_CTRL 0x13
28 #define LP3952_REG_CMD_0 0x50
29 #define LP3952_REG_RESET 0x60
30 #define REG_MAX LP3952_REG_RESET
32 #define LP3952_PATRN_LOOP BIT(1)
33 #define LP3952_PATRN_GEN_EN BIT(2)
34 #define LP3952_INT_B00ST_LDR BIT(2)
35 #define LP3952_ACTIVE_MODE BIT(6)
36 #define LP3952_LED_MASK_ALL 0x3f
38 /* Transition Time in ms */
50 /* Command Execution Time in ms */
69 /* Max Current in % */
70 enum lp3952_colour_I_log_0 {
91 struct lp3952_ctrl_hdl {
92 struct led_classdev cdev;
93 char name[LP3952_LABEL_MAX_LEN];
94 enum lp3952_leds channel;
114 struct lp3952_led_array {
115 struct regmap *regmap;
116 struct i2c_client *client;
117 struct gpio_desc *enable_gpio;
118 struct lp3952_ctrl_hdl leds[LP3952_LED_ALL];
121 #endif /* LEDS_LP3952_H_ */