1
2
3
4
5
6
7
8
9 #ifndef __LINUX_I2C_ADP8860_H
10 #define __LINUX_I2C_ADP8860_H
11
12 #include <linux/leds.h>
13 #include <linux/types.h>
14
15 #define ID_ADP8860 8860
16
17 #define ADP8860_MAX_BRIGHTNESS 0x7F
18 #define FLAG_OFFT_SHIFT 8
19
20
21
22
23
24 #define ADP8860_LED_DIS_BLINK (0 << FLAG_OFFT_SHIFT)
25 #define ADP8860_LED_OFFT_600ms (1 << FLAG_OFFT_SHIFT)
26 #define ADP8860_LED_OFFT_1200ms (2 << FLAG_OFFT_SHIFT)
27 #define ADP8860_LED_OFFT_1800ms (3 << FLAG_OFFT_SHIFT)
28
29 #define ADP8860_LED_ONT_200ms 0
30 #define ADP8860_LED_ONT_600ms 1
31 #define ADP8860_LED_ONT_800ms 2
32 #define ADP8860_LED_ONT_1200ms 3
33
34 #define ADP8860_LED_D7 (7)
35 #define ADP8860_LED_D6 (6)
36 #define ADP8860_LED_D5 (5)
37 #define ADP8860_LED_D4 (4)
38 #define ADP8860_LED_D3 (3)
39 #define ADP8860_LED_D2 (2)
40 #define ADP8860_LED_D1 (1)
41
42
43
44
45
46 #define ADP8860_BL_D7 (1 << 6)
47 #define ADP8860_BL_D6 (1 << 5)
48 #define ADP8860_BL_D5 (1 << 4)
49 #define ADP8860_BL_D4 (1 << 3)
50 #define ADP8860_BL_D3 (1 << 2)
51 #define ADP8860_BL_D2 (1 << 1)
52 #define ADP8860_BL_D1 (1 << 0)
53
54 #define ADP8860_FADE_T_DIS 0
55 #define ADP8860_FADE_T_300ms 1
56 #define ADP8860_FADE_T_600ms 2
57 #define ADP8860_FADE_T_900ms 3
58 #define ADP8860_FADE_T_1200ms 4
59 #define ADP8860_FADE_T_1500ms 5
60 #define ADP8860_FADE_T_1800ms 6
61 #define ADP8860_FADE_T_2100ms 7
62 #define ADP8860_FADE_T_2400ms 8
63 #define ADP8860_FADE_T_2700ms 9
64 #define ADP8860_FADE_T_3000ms 10
65 #define ADP8860_FADE_T_3500ms 11
66 #define ADP8860_FADE_T_4000ms 12
67 #define ADP8860_FADE_T_4500ms 13
68 #define ADP8860_FADE_T_5000ms 14
69 #define ADP8860_FADE_T_5500ms 15
70
71 #define ADP8860_FADE_LAW_LINEAR 0
72 #define ADP8860_FADE_LAW_SQUARE 1
73 #define ADP8860_FADE_LAW_CUBIC1 2
74 #define ADP8860_FADE_LAW_CUBIC2 3
75
76 #define ADP8860_BL_AMBL_FILT_80ms 0
77 #define ADP8860_BL_AMBL_FILT_160ms 1
78 #define ADP8860_BL_AMBL_FILT_320ms 2
79 #define ADP8860_BL_AMBL_FILT_640ms 3
80 #define ADP8860_BL_AMBL_FILT_1280ms 4
81 #define ADP8860_BL_AMBL_FILT_2560ms 5
82 #define ADP8860_BL_AMBL_FILT_5120ms 6
83 #define ADP8860_BL_AMBL_FILT_10240ms 7
84
85
86
87
88 #define ADP8860_BL_CUR_mA(I) ((I * 127) / 30)
89
90
91
92
93 #define ADP8860_L2_COMP_CURR_uA(I) ((I * 255) / 1106)
94
95
96
97
98 #define ADP8860_L3_COMP_CURR_uA(I) ((I * 255) / 138)
99
100 struct adp8860_backlight_platform_data {
101 u8 bl_led_assign;
102
103 u8 bl_fade_in;
104 u8 bl_fade_out;
105 u8 bl_fade_law;
106
107 u8 en_ambl_sens;
108 u8 abml_filt;
109
110 u8 l1_daylight_max;
111 u8 l1_daylight_dim;
112 u8 l2_office_max;
113 u8 l2_office_dim;
114 u8 l3_dark_max;
115 u8 l3_dark_dim;
116
117 u8 l2_trip;
118 u8 l2_hyst;
119 u8 l3_trip;
120 u8 l3_hyst;
121
122
123
124
125
126
127
128 int num_leds;
129 struct led_info *leds;
130 u8 led_fade_in;
131 u8 led_fade_out;
132 u8 led_fade_law;
133 u8 led_on_time;
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150 u8 gdwn_dis;
151 };
152
153 #endif