1
2
3
4
5
6
7
8
9
10
11
12 #ifndef _LINUX_LED_LM3530_H__
13 #define _LINUX_LED_LM3530_H__
14
15 #define LM3530_FS_CURR_5mA (0)
16 #define LM3530_FS_CURR_8mA (1)
17 #define LM3530_FS_CURR_12mA (2)
18 #define LM3530_FS_CURR_15mA (3)
19 #define LM3530_FS_CURR_19mA (4)
20 #define LM3530_FS_CURR_22mA (5)
21 #define LM3530_FS_CURR_26mA (6)
22 #define LM3530_FS_CURR_29mA (7)
23
24 #define LM3530_ALS_AVRG_TIME_32ms (0)
25 #define LM3530_ALS_AVRG_TIME_64ms (1)
26 #define LM3530_ALS_AVRG_TIME_128ms (2)
27 #define LM3530_ALS_AVRG_TIME_256ms (3)
28 #define LM3530_ALS_AVRG_TIME_512ms (4)
29 #define LM3530_ALS_AVRG_TIME_1024ms (5)
30 #define LM3530_ALS_AVRG_TIME_2048ms (6)
31 #define LM3530_ALS_AVRG_TIME_4096ms (7)
32
33 #define LM3530_RAMP_TIME_1ms (0)
34 #define LM3530_RAMP_TIME_130ms (1)
35 #define LM3530_RAMP_TIME_260ms (2)
36 #define LM3530_RAMP_TIME_520ms (3)
37 #define LM3530_RAMP_TIME_1s (4)
38 #define LM3530_RAMP_TIME_2s (5)
39 #define LM3530_RAMP_TIME_4s (6)
40 #define LM3530_RAMP_TIME_8s (7)
41
42
43 #define LM3530_ALS_IMPD_Z (0x00)
44 #define LM3530_ALS_IMPD_13_53kOhm (0x01)
45 #define LM3530_ALS_IMPD_9_01kOhm (0x02)
46 #define LM3530_ALS_IMPD_5_41kOhm (0x03)
47 #define LM3530_ALS_IMPD_2_27kOhm (0x04)
48 #define LM3530_ALS_IMPD_1_94kOhm (0x05)
49 #define LM3530_ALS_IMPD_1_81kOhm (0x06)
50 #define LM3530_ALS_IMPD_1_6kOhm (0x07)
51 #define LM3530_ALS_IMPD_1_138kOhm (0x08)
52 #define LM3530_ALS_IMPD_1_05kOhm (0x09)
53 #define LM3530_ALS_IMPD_1_011kOhm (0x0A)
54 #define LM3530_ALS_IMPD_941Ohm (0x0B)
55 #define LM3530_ALS_IMPD_759Ohm (0x0C)
56 #define LM3530_ALS_IMPD_719Ohm (0x0D)
57 #define LM3530_ALS_IMPD_700Ohm (0x0E)
58 #define LM3530_ALS_IMPD_667Ohm (0x0F)
59
60 enum lm3530_mode {
61 LM3530_BL_MODE_MANUAL = 0,
62 LM3530_BL_MODE_ALS,
63 LM3530_BL_MODE_PWM,
64 };
65
66
67 enum lm3530_als_mode {
68 LM3530_INPUT_AVRG = 0,
69 LM3530_INPUT_ALS1,
70 LM3530_INPUT_ALS2,
71 LM3530_INPUT_CEIL,
72 };
73
74
75 struct lm3530_pwm_data {
76 void (*pwm_set_intensity) (int brightness, int max_brightness);
77 int (*pwm_get_intensity) (int max_brightness);
78 };
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97 struct lm3530_platform_data {
98 enum lm3530_mode mode;
99 enum lm3530_als_mode als_input_mode;
100
101 u8 max_current;
102 bool pwm_pol_hi;
103 u8 als_avrg_time;
104
105 bool brt_ramp_law;
106 u8 brt_ramp_fall;
107 u8 brt_ramp_rise;
108
109 u8 als1_resistor_sel;
110 u8 als2_resistor_sel;
111
112 u32 als_vmin;
113 u32 als_vmax;
114
115 u8 brt_val;
116
117 struct lm3530_pwm_data pwm_data;
118 };
119
120 #endif