1 /*
2 * Simple driver for Texas Instruments LM3585 Backlight driver chip
3 * Copyright (C) 2014 Texas Instruments
4 * Author: Daniel Jeong <gshark.jeong@gmail.com>
5 * Ldd Mlp <ldd-mlp@list.ti.com>
6 *
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.
10 *
11 */
13 #ifndef __LM3585_H
14 #define __LM3585_H
16 #define LM3585_NAME "lm3585"
17 #define LM3585_ADDR 0x31
19 #define LM3585_BR_MAX 4095
21 enum lm3585_leds_enable {
22 LM3585_LED_ALL_OFF = 0x00,
23 LM3585_LED_0_ON = 0x01,
24 LM3585_LED_1_ON = 0x02,
25 LM3585_LED_2_ON = 0x04,
26 LM3585_LED_3_ON = 0x08,
27 LM3585_LED_4_ON = 0x10,
28 LM3585_LED_5_ON = 0x20,
29 LM3585_LED_6_ON = 0x40,
30 LM3585_LED_7_ON = 0x80,
31 LM3585_LED_8_ON = 0x100,
32 LM3585_LED_9_ON = 0x200,
33 LM3585_LED_ALL_ON = 0x3ff,
34 };
36 enum lm3585_cabc_input {
37 LM3585_CABC_INPUT_DISABLE = 0,
38 LM3585_CABC_INPUT_ENABLE,
39 };
41 enum lm3585_curve_type {
42 LM3585_CURVE_LINEAR = 0,
43 LM3585_CURVE_QUADRATIC,
44 LM3585_CURVE_CUBIC,
45 LM3585_CURVE_QUARTIC,
46 };
48 /*
49 * struct lm3585 platform data
50 * @led_enable : each bit disables the chosen LED output or enable all.
51 * @ctype : curve type
52 * @cabc_input : the CABC PWM input control
53 * @ramp_time : the duration of the ILED transitioin. 0~3fh
54 */
55 struct lm3585_platform_data {
57 enum lm3585_leds_enable led_enable;
58 enum lm3585_curve_type ctype;
59 enum lm3585_cabc_input cabc_input;
60 int ramp_time;
61 };
63 #endif /* __LM3585_H */