diff options
author | Antti Palosaari <crope@iki.fi> | 2014-01-26 19:02:53 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-03-14 04:24:37 -0400 |
commit | adaa616ffb697f00db9b4ccb638c5e9e719dbb7f (patch) | |
tree | d3ef26a4b9abb751942dd6bb7e8ec6adfb853a29 /drivers/media/tuners/e4000_priv.h | |
parent | 28fd31f82dccfcfcb4c80fd916d4caf875c04d90 (diff) |
[media] e4000: implement controls via v4l2 control framework
Implement gain and bandwidth controls using v4l2 control framework.
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/tuners/e4000_priv.h')
-rw-r--r-- | drivers/media/tuners/e4000_priv.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/drivers/media/tuners/e4000_priv.h b/drivers/media/tuners/e4000_priv.h index 8f45a300f688..e2ad54f52280 100644 --- a/drivers/media/tuners/e4000_priv.h +++ b/drivers/media/tuners/e4000_priv.h | |||
@@ -22,11 +22,25 @@ | |||
22 | #define E4000_PRIV_H | 22 | #define E4000_PRIV_H |
23 | 23 | ||
24 | #include "e4000.h" | 24 | #include "e4000.h" |
25 | #include <media/v4l2-ctrls.h> | ||
26 | #include <media/v4l2-subdev.h> | ||
25 | 27 | ||
26 | struct e4000_priv { | 28 | struct e4000_priv { |
27 | struct i2c_client *client; | 29 | struct i2c_client *client; |
28 | u32 clock; | 30 | u32 clock; |
29 | struct dvb_frontend *fe; | 31 | struct dvb_frontend *fe; |
32 | struct v4l2_subdev sd; | ||
33 | |||
34 | /* Controls */ | ||
35 | struct v4l2_ctrl_handler hdl; | ||
36 | struct v4l2_ctrl *bandwidth_auto; | ||
37 | struct v4l2_ctrl *bandwidth; | ||
38 | struct v4l2_ctrl *lna_gain_auto; | ||
39 | struct v4l2_ctrl *lna_gain; | ||
40 | struct v4l2_ctrl *mixer_gain_auto; | ||
41 | struct v4l2_ctrl *mixer_gain; | ||
42 | struct v4l2_ctrl *if_gain_auto; | ||
43 | struct v4l2_ctrl *if_gain; | ||
30 | }; | 44 | }; |
31 | 45 | ||
32 | struct e4000_pll { | 46 | struct e4000_pll { |
@@ -145,4 +159,67 @@ static const struct e4000_if_filter e4000_if_filter_lut[] = { | |||
145 | { 0xffffffff, 0x00, 0x20 }, | 159 | { 0xffffffff, 0x00, 0x20 }, |
146 | }; | 160 | }; |
147 | 161 | ||
162 | struct e4000_if_gain { | ||
163 | u8 reg16_val; | ||
164 | u8 reg17_val; | ||
165 | }; | ||
166 | |||
167 | static const struct e4000_if_gain e4000_if_gain_lut[] = { | ||
168 | {0x00, 0x00}, | ||
169 | {0x20, 0x00}, | ||
170 | {0x40, 0x00}, | ||
171 | {0x02, 0x00}, | ||
172 | {0x22, 0x00}, | ||
173 | {0x42, 0x00}, | ||
174 | {0x04, 0x00}, | ||
175 | {0x24, 0x00}, | ||
176 | {0x44, 0x00}, | ||
177 | {0x01, 0x00}, | ||
178 | {0x21, 0x00}, | ||
179 | {0x41, 0x00}, | ||
180 | {0x03, 0x00}, | ||
181 | {0x23, 0x00}, | ||
182 | {0x43, 0x00}, | ||
183 | {0x05, 0x00}, | ||
184 | {0x25, 0x00}, | ||
185 | {0x45, 0x00}, | ||
186 | {0x07, 0x00}, | ||
187 | {0x27, 0x00}, | ||
188 | {0x47, 0x00}, | ||
189 | {0x0f, 0x00}, | ||
190 | {0x2f, 0x00}, | ||
191 | {0x4f, 0x00}, | ||
192 | {0x17, 0x00}, | ||
193 | {0x37, 0x00}, | ||
194 | {0x57, 0x00}, | ||
195 | {0x1f, 0x00}, | ||
196 | {0x3f, 0x00}, | ||
197 | {0x5f, 0x00}, | ||
198 | {0x1f, 0x01}, | ||
199 | {0x3f, 0x01}, | ||
200 | {0x5f, 0x01}, | ||
201 | {0x1f, 0x02}, | ||
202 | {0x3f, 0x02}, | ||
203 | {0x5f, 0x02}, | ||
204 | {0x1f, 0x03}, | ||
205 | {0x3f, 0x03}, | ||
206 | {0x5f, 0x03}, | ||
207 | {0x1f, 0x04}, | ||
208 | {0x3f, 0x04}, | ||
209 | {0x5f, 0x04}, | ||
210 | {0x1f, 0x0c}, | ||
211 | {0x3f, 0x0c}, | ||
212 | {0x5f, 0x0c}, | ||
213 | {0x1f, 0x14}, | ||
214 | {0x3f, 0x14}, | ||
215 | {0x5f, 0x14}, | ||
216 | {0x1f, 0x1c}, | ||
217 | {0x3f, 0x1c}, | ||
218 | {0x5f, 0x1c}, | ||
219 | {0x1f, 0x24}, | ||
220 | {0x3f, 0x24}, | ||
221 | {0x5f, 0x24}, | ||
222 | {0x7f, 0x24}, | ||
223 | }; | ||
224 | |||
148 | #endif | 225 | #endif |