2 * LED driver for TI lp3952 controller
4 * Copyright (C) 2016, DAQRI, LLC.
5 * Author: Tony Makkiel <tony.makkiel@daqri.com>
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.
13 #ifndef LEDS_LP3952_H_
14 #define LEDS_LP3952_H_
16 #define LP3952_NAME "lp3952"
17 #define LP3952_CMD_REG_COUNT 8
18 #define LP3952_BRIGHT_MAX 4
19 #define LP3952_LABEL_MAX_LEN 15
21 #define LP3952_REG_LED_CTRL 0x00
22 #define LP3952_REG_R1_BLNK_TIME_CTRL 0x01
23 #define LP3952_REG_R1_BLNK_CYCLE_CTRL 0x02
24 #define LP3952_REG_G1_BLNK_TIME_CTRL 0x03
25 #define LP3952_REG_G1_BLNK_CYCLE_CTRL 0x04
26 #define LP3952_REG_B1_BLNK_TIME_CTRL 0x05
27 #define LP3952_REG_B1_BLNK_CYCLE_CTRL 0x06
28 #define LP3952_REG_ENABLES 0x0B
29 #define LP3952_REG_PAT_GEN_CTRL 0x11
30 #define LP3952_REG_RGB1_MAX_I_CTRL 0x12
31 #define LP3952_REG_RGB2_MAX_I_CTRL 0x13
32 #define LP3952_REG_CMD_0 0x50
33 #define LP3952_REG_RESET 0x60
34 #define REG_MAX LP3952_REG_RESET
36 #define LP3952_PATRN_LOOP BIT(1)
37 #define LP3952_PATRN_GEN_EN BIT(2)
38 #define LP3952_INT_B00ST_LDR BIT(2)
39 #define LP3952_ACTIVE_MODE BIT(6)
40 #define LP3952_LED_MASK_ALL 0x3f
42 /* Transition Time in ms */
54 /* Command Execution Time in ms */
73 /* Max Current in % */
74 enum lp3952_colour_I_log_0 {
95 struct lp3952_ctrl_hdl {
96 struct led_classdev cdev;
97 char name[LP3952_LABEL_MAX_LEN];
98 enum lp3952_leds channel;
102 struct ptrn_gen_cmd {
118 struct lp3952_led_array {
119 struct regmap *regmap;
120 struct i2c_client *client;
121 struct gpio_desc *enable_gpio;
122 struct lp3952_ctrl_hdl leds[LP3952_LED_ALL];
125 #endif /* LEDS_LP3952_H_ */