1
2
3
4
5
6
7
8
9 #ifndef __LINUX_I2C_ADP8870_H
10 #define __LINUX_I2C_ADP8870_H
11
12 #define ID_ADP8870 8870
13
14 #define ADP8870_MAX_BRIGHTNESS 0x7F
15 #define FLAG_OFFT_SHIFT 8
16
17
18
19
20
21 #define ADP8870_LED_DIS_BLINK (0 << FLAG_OFFT_SHIFT)
22 #define ADP8870_LED_OFFT_600ms (1 << FLAG_OFFT_SHIFT)
23 #define ADP8870_LED_OFFT_1200ms (2 << FLAG_OFFT_SHIFT)
24 #define ADP8870_LED_OFFT_1800ms (3 << FLAG_OFFT_SHIFT)
25
26 #define ADP8870_LED_ONT_200ms 0
27 #define ADP8870_LED_ONT_600ms 1
28 #define ADP8870_LED_ONT_800ms 2
29 #define ADP8870_LED_ONT_1200ms 3
30
31 #define ADP8870_LED_D7 (7)
32 #define ADP8870_LED_D6 (6)
33 #define ADP8870_LED_D5 (5)
34 #define ADP8870_LED_D4 (4)
35 #define ADP8870_LED_D3 (3)
36 #define ADP8870_LED_D2 (2)
37 #define ADP8870_LED_D1 (1)
38
39
40
41
42
43 #define ADP8870_BL_D7 (1 << 6)
44 #define ADP8870_BL_D6 (1 << 5)
45 #define ADP8870_BL_D5 (1 << 4)
46 #define ADP8870_BL_D4 (1 << 3)
47 #define ADP8870_BL_D3 (1 << 2)
48 #define ADP8870_BL_D2 (1 << 1)
49 #define ADP8870_BL_D1 (1 << 0)
50
51 #define ADP8870_FADE_T_DIS 0
52 #define ADP8870_FADE_T_300ms 1
53 #define ADP8870_FADE_T_600ms 2
54 #define ADP8870_FADE_T_900ms 3
55 #define ADP8870_FADE_T_1200ms 4
56 #define ADP8870_FADE_T_1500ms 5
57 #define ADP8870_FADE_T_1800ms 6
58 #define ADP8870_FADE_T_2100ms 7
59 #define ADP8870_FADE_T_2400ms 8
60 #define ADP8870_FADE_T_2700ms 9
61 #define ADP8870_FADE_T_3000ms 10
62 #define ADP8870_FADE_T_3500ms 11
63 #define ADP8870_FADE_T_4000ms 12
64 #define ADP8870_FADE_T_4500ms 13
65 #define ADP8870_FADE_T_5000ms 14
66 #define ADP8870_FADE_T_5500ms 15
67
68 #define ADP8870_FADE_LAW_LINEAR 0
69 #define ADP8870_FADE_LAW_SQUARE 1
70 #define ADP8870_FADE_LAW_CUBIC1 2
71 #define ADP8870_FADE_LAW_CUBIC2 3
72
73 #define ADP8870_BL_AMBL_FILT_80ms 0
74 #define ADP8870_BL_AMBL_FILT_160ms 1
75 #define ADP8870_BL_AMBL_FILT_320ms 2
76 #define ADP8870_BL_AMBL_FILT_640ms 3
77 #define ADP8870_BL_AMBL_FILT_1280ms 4
78 #define ADP8870_BL_AMBL_FILT_2560ms 5
79 #define ADP8870_BL_AMBL_FILT_5120ms 6
80 #define ADP8870_BL_AMBL_FILT_10240ms 7
81
82
83
84
85 #define ADP8870_BL_CUR_mA(I) ((I * 127) / 30)
86
87
88
89
90 #define ADP8870_L2_COMP_CURR_uA(I) ((I * 255) / 1106)
91
92
93
94
95 #define ADP8870_L3_COMP_CURR_uA(I) ((I * 255) / 551)
96
97
98
99
100 #define ADP8870_L4_COMP_CURR_uA(I) ((I * 255) / 275)
101
102
103
104
105 #define ADP8870_L5_COMP_CURR_uA(I) ((I * 255) / 138)
106
107 struct adp8870_backlight_platform_data {
108 u8 bl_led_assign;
109 u8 pwm_assign;
110
111 u8 bl_fade_in;
112 u8 bl_fade_out;
113 u8 bl_fade_law;
114
115 u8 en_ambl_sens;
116 u8 abml_filt;
117
118 u8 l1_daylight_max;
119 u8 l1_daylight_dim;
120 u8 l2_bright_max;
121 u8 l2_bright_dim;
122 u8 l3_office_max;
123 u8 l3_office_dim;
124 u8 l4_indoor_max;
125 u8 l4_indor_dim;
126 u8 l5_dark_max;
127 u8 l5_dark_dim;
128
129 u8 l2_trip;
130 u8 l2_hyst;
131 u8 l3_trip;
132 u8 l3_hyst;
133 u8 l4_trip;
134 u8 l4_hyst;
135 u8 l5_trip;
136 u8 l5_hyst;
137
138
139
140
141
142
143
144 int num_leds;
145 struct led_info *leds;
146 u8 led_fade_in;
147 u8 led_fade_out;
148 u8 led_fade_law;
149 u8 led_on_time;
150 };
151
152 #endif