1
2
3
4
5
6
7
8 #ifndef _LP855X_H
9 #define _LP855X_H
10
11 #define BL_CTL_SHFT (0)
12 #define BRT_MODE_SHFT (1)
13 #define BRT_MODE_MASK (0x06)
14
15
16 #define ENABLE_BL (1)
17 #define DISABLE_BL (0)
18
19 #define I2C_CONFIG(id) id ## _I2C_CONFIG
20 #define PWM_CONFIG(id) id ## _PWM_CONFIG
21
22
23 #define LP8550_PWM_CONFIG (LP8550_PWM_ONLY << BRT_MODE_SHFT)
24 #define LP8550_I2C_CONFIG ((ENABLE_BL << BL_CTL_SHFT) | \
25 (LP8550_I2C_ONLY << BRT_MODE_SHFT))
26
27
28 #define LP8551_PWM_CONFIG LP8550_PWM_CONFIG
29 #define LP8551_I2C_CONFIG LP8550_I2C_CONFIG
30
31
32 #define LP8552_PWM_CONFIG LP8550_PWM_CONFIG
33 #define LP8552_I2C_CONFIG LP8550_I2C_CONFIG
34
35
36 #define LP8553_PWM_CONFIG LP8550_PWM_CONFIG
37 #define LP8553_I2C_CONFIG LP8550_I2C_CONFIG
38
39
40 #define LP8555_PWM_STANDBY BIT(7)
41 #define LP8555_PWM_FILTER BIT(6)
42 #define LP8555_RELOAD_EPROM BIT(3)
43
44 #define LP8555_OFF_OPENLEDS BIT(2)
45 #define LP8555_PWM_CONFIG LP8555_PWM_ONLY
46 #define LP8555_I2C_CONFIG LP8555_I2C_ONLY
47 #define LP8555_COMB1_CONFIG LP8555_COMBINED1
48 #define LP8555_COMB2_CONFIG LP8555_COMBINED2
49
50
51 #define LP8556_PWM_CONFIG (LP8556_PWM_ONLY << BRT_MODE_SHFT)
52 #define LP8556_COMB1_CONFIG (LP8556_COMBINED1 << BRT_MODE_SHFT)
53 #define LP8556_I2C_CONFIG ((ENABLE_BL << BL_CTL_SHFT) | \
54 (LP8556_I2C_ONLY << BRT_MODE_SHFT))
55 #define LP8556_COMB2_CONFIG (LP8556_COMBINED2 << BRT_MODE_SHFT)
56 #define LP8556_FAST_CONFIG BIT(7)
57
58
59
60 #define LP8557_PWM_STANDBY BIT(7)
61 #define LP8557_PWM_FILTER BIT(6)
62 #define LP8557_RELOAD_EPROM BIT(3)
63
64 #define LP8557_OFF_OPENLEDS BIT(2)
65 #define LP8557_PWM_CONFIG LP8557_PWM_ONLY
66 #define LP8557_I2C_CONFIG LP8557_I2C_ONLY
67 #define LP8557_COMB1_CONFIG LP8557_COMBINED1
68 #define LP8557_COMB2_CONFIG LP8557_COMBINED2
69
70 enum lp855x_chip_id {
71 LP8550,
72 LP8551,
73 LP8552,
74 LP8553,
75 LP8555,
76 LP8556,
77 LP8557,
78 };
79
80 enum lp8550_brighntess_source {
81 LP8550_PWM_ONLY,
82 LP8550_I2C_ONLY = 2,
83 };
84
85 enum lp8551_brighntess_source {
86 LP8551_PWM_ONLY = LP8550_PWM_ONLY,
87 LP8551_I2C_ONLY = LP8550_I2C_ONLY,
88 };
89
90 enum lp8552_brighntess_source {
91 LP8552_PWM_ONLY = LP8550_PWM_ONLY,
92 LP8552_I2C_ONLY = LP8550_I2C_ONLY,
93 };
94
95 enum lp8553_brighntess_source {
96 LP8553_PWM_ONLY = LP8550_PWM_ONLY,
97 LP8553_I2C_ONLY = LP8550_I2C_ONLY,
98 };
99
100 enum lp8555_brightness_source {
101 LP8555_PWM_ONLY,
102 LP8555_I2C_ONLY,
103 LP8555_COMBINED1,
104 LP8555_COMBINED2,
105 };
106
107 enum lp8556_brightness_source {
108 LP8556_PWM_ONLY,
109 LP8556_COMBINED1,
110 LP8556_I2C_ONLY,
111 LP8556_COMBINED2,
112 };
113
114 enum lp8557_brightness_source {
115 LP8557_PWM_ONLY,
116 LP8557_I2C_ONLY,
117 LP8557_COMBINED1,
118 LP8557_COMBINED2,
119 };
120
121 struct lp855x_rom_data {
122 u8 addr;
123 u8 val;
124 };
125
126
127
128
129
130
131
132
133
134
135
136 struct lp855x_platform_data {
137 const char *name;
138 u8 device_control;
139 u8 initial_brightness;
140 unsigned int period_ns;
141 int size_program;
142 struct lp855x_rom_data *rom_data;
143 };
144
145 #endif