diff options
author | Patrick Boettcher <pb@linuxtv.org> | 2006-08-08 14:48:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-26 10:53:41 -0400 |
commit | e4d6c1f74aaac1bbe5be50e7368e5ac99d54e5a2 (patch) | |
tree | df1106a211770b6c5c13ae32703cece73ef0e6fe | |
parent | a16bf5d5603184dc1db88f37051881b2eeacfd17 (diff) |
V4L/DVB: Cleanups for mt2060-integration
- some coding style fixes for newly added mt2060
- moved agc-config from fixed values in dib3000mc to configurable ones
- whitespace clean-ups for usb-id-file
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb-common.c | 69 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb-mc.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb.h | 8 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 104 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/dib3000.h | 29 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/dib3000mc.c | 31 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/dib3000mc_priv.h | 35 |
7 files changed, 127 insertions, 153 deletions
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c index 4d3d0d3dab95..e079ba95d384 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/drivers/media/dvb/dvb-usb/dibusb-common.c | |||
@@ -168,63 +168,61 @@ int dibusb_read_eeprom_byte(struct dvb_usb_device *d, u8 offs, u8 *val) | |||
168 | } | 168 | } |
169 | EXPORT_SYMBOL(dibusb_read_eeprom_byte); | 169 | EXPORT_SYMBOL(dibusb_read_eeprom_byte); |
170 | 170 | ||
171 | static struct mt2060_config default_mt2060_config = { | 171 | static struct mt2060_config stk3000p_mt2060_config = { |
172 | .i2c_address = 0x60, | 172 | .i2c_address = 0x60, |
173 | }; | 173 | }; |
174 | 174 | ||
175 | static int dibusb_tuner_init(struct dvb_frontend *fe) | 175 | static int dibusb_tuner_init(struct dvb_frontend *fe) |
176 | { | 176 | { |
177 | int ret; | ||
178 | struct dvb_usb_device *d = fe->dvb->priv; | 177 | struct dvb_usb_device *d = fe->dvb->priv; |
179 | struct dibusb_state *st = d->priv; | 178 | struct dibusb_state *st = d->priv; |
180 | 179 | ||
181 | if (d->tuner_pass_ctrl) { | 180 | if (d->tuner_pass_ctrl && st->mt2060_present) { |
182 | if ((int)d->fe->misc_priv==DIBUSB_TUNER_MT2060) { // Microtune MT2060 | 181 | int ret; |
183 | d->tuner_pass_ctrl(d->fe,1,default_mt2060_config.i2c_address); | 182 | d->tuner_pass_ctrl(d->fe, 1, stk3000p_mt2060_config.i2c_address); |
184 | ret=mt2060_init(&st->mt2060); | 183 | ret = mt2060_init(&st->mt2060); |
185 | } | 184 | d->tuner_pass_ctrl(d->fe, 0, 0); |
186 | else { // Panasonic whatever | ||
187 | d->tuner_pass_ctrl(d->fe,1,d->pll_addr); | ||
188 | ret=dvb_usb_pll_init_i2c(fe); | ||
189 | } | ||
190 | d->tuner_pass_ctrl(d->fe,0,0); | ||
191 | return ret; | 185 | return ret; |
192 | } | 186 | } |
193 | return -ENODEV; | 187 | return dvb_usb_pll_init_i2c(fe); |
194 | } | 188 | } |
195 | 189 | ||
196 | static int dibusb_tuner_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) | 190 | static int dibusb_tuner_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) |
197 | { | 191 | { |
198 | int ret; | ||
199 | struct dvb_usb_device *d = fe->dvb->priv; | 192 | struct dvb_usb_device *d = fe->dvb->priv; |
200 | struct dibusb_state *st = d->priv; | 193 | struct dibusb_state *st = d->priv; |
201 | 194 | ||
202 | if (d->tuner_pass_ctrl) { | 195 | if (d->tuner_pass_ctrl && st->mt2060_present) { |
203 | if ((int)d->fe->misc_priv==DIBUSB_TUNER_MT2060) { | 196 | int ret; |
204 | d->tuner_pass_ctrl(d->fe,1,default_mt2060_config.i2c_address); | 197 | d->tuner_pass_ctrl(d->fe, 1, stk3000p_mt2060_config.i2c_address); |
205 | ret=mt2060_set(&st->mt2060,fep); | 198 | ret = mt2060_set(&st->mt2060,fep); |
206 | } | ||
207 | else { | ||
208 | d->tuner_pass_ctrl(d->fe,1,d->pll_addr); | ||
209 | ret=dvb_usb_pll_set_i2c(fe,fep); | ||
210 | } | ||
211 | d->tuner_pass_ctrl(d->fe,0,0); | 199 | d->tuner_pass_ctrl(d->fe,0,0); |
212 | return ret; | 200 | return ret; |
213 | } | 201 | } |
214 | return -ENODEV; | 202 | return dvb_usb_pll_set_i2c(fe,fep); |
215 | } | 203 | } |
216 | 204 | ||
205 | static const struct dib3000p_agc_config dib3000p_agc_panasonic_env57h1xd5 = { | ||
206 | { 0x51, 0x301d, 0x0, 0x1cc7, 0xdc29, 0x570a, | ||
207 | 0xbae1, 0x8ccd, 0x3b6d, 0x551d, 0xa, 0x951e } | ||
208 | }; | ||
209 | |||
210 | static const struct dib3000p_agc_config dib3000p_agc_microtune_mt2060 = { | ||
211 | { 0x196, 0x301d, 0x0, 0x1cc7, 0xffff, 0x5c29, | ||
212 | 0xa8f6, 0x5eb8, 0x65ff, 0x40ff, 0x8a, 0x1114 } | ||
213 | }; | ||
214 | |||
217 | int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d) | 215 | int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d) |
218 | { | 216 | { |
219 | struct dib3000_config demod_cfg; | 217 | struct dib3000_config demod_cfg; |
220 | struct dibusb_state *st = d->priv; | 218 | struct dibusb_state *st = d->priv; |
221 | 219 | ||
222 | demod_cfg.pll_set = dibusb_tuner_set; | 220 | demod_cfg.agc = &dib3000p_agc_panasonic_env57h1xd5; |
221 | demod_cfg.pll_set = dibusb_tuner_set; | ||
223 | demod_cfg.pll_init = dibusb_tuner_init; | 222 | demod_cfg.pll_init = dibusb_tuner_init; |
224 | 223 | ||
225 | for (demod_cfg.demod_address = 0x8; demod_cfg.demod_address < 0xd; demod_cfg.demod_address++) | 224 | for (demod_cfg.demod_address = 0x8; demod_cfg.demod_address < 0xd; demod_cfg.demod_address++) |
226 | if ((d->fe = dib3000mc_attach(&demod_cfg,&d->i2c_adap,&st->ops)) != NULL) { | 225 | if ((d->fe = dib3000mc_attach(&demod_cfg,&d->i2c_adap,&st->ops)) != NULL) { |
227 | d->fe->misc_priv=(void *)DIBUSB_TUNER_DEFAULT; | ||
228 | d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; | 226 | d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; |
229 | return 0; | 227 | return 0; |
230 | } | 228 | } |
@@ -236,18 +234,23 @@ EXPORT_SYMBOL(dibusb_dib3000mc_frontend_attach); | |||
236 | int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *d) | 234 | int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *d) |
237 | { | 235 | { |
238 | int ret; | 236 | int ret; |
239 | d->pll_addr = 0x60; | 237 | |
240 | d->pll_desc = &dvb_pll_env57h1xd5; | ||
241 | if (d->tuner_pass_ctrl) { | 238 | if (d->tuner_pass_ctrl) { |
242 | struct dibusb_state *st = d->priv; | 239 | struct dibusb_state *st = d->priv; |
243 | d->tuner_pass_ctrl(d->fe,1,default_mt2060_config.i2c_address); | 240 | d->tuner_pass_ctrl(d->fe, 1, stk3000p_mt2060_config.i2c_address); |
244 | if ((ret = mt2060_attach(&st->mt2060,&default_mt2060_config, &d->i2c_adap)) == 0) { | 241 | /* check for mt2060 */ |
245 | d->fe->misc_priv=(void *)DIBUSB_TUNER_MT2060; | 242 | if ((ret = mt2060_attach(&st->mt2060,&stk3000p_mt2060_config, &d->i2c_adap)) != 0) { |
243 | /* not found - use panasonic pll parameters */ | ||
244 | d->pll_addr = 0x60; | ||
245 | d->pll_desc = &dvb_pll_env57h1xd5; | ||
246 | } else { | ||
247 | st->mt2060_present = 1; | ||
248 | /* set the correct agc parameters for the dib3000p */ | ||
249 | dib3000mc_set_agc_config(d->fe, &dib3000p_agc_microtune_mt2060); | ||
246 | } | 250 | } |
247 | d->tuner_pass_ctrl(d->fe,0,0); | 251 | d->tuner_pass_ctrl(d->fe,0,0); |
248 | return 0; | ||
249 | } | 252 | } |
250 | return -ENODEV; | 253 | return 0; |
251 | } | 254 | } |
252 | EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach); | 255 | EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach); |
253 | 256 | ||
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c b/drivers/media/dvb/dvb-usb/dibusb-mc.c index 2ef3d739abba..aba2de6ba56b 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mc.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c | |||
@@ -33,8 +33,8 @@ static struct usb_device_id dibusb_dib3000mc_table [] = { | |||
33 | /* 05 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_WARM) }, | 33 | /* 05 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_WARM) }, |
34 | /* 06 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_COLD) }, | 34 | /* 06 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_COLD) }, |
35 | /* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_WARM) }, | 35 | /* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_WARM) }, |
36 | /* 08 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_COLD) }, | 36 | /* 08 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_COLD) }, |
37 | /* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_WARM) }, | 37 | /* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_WARM) }, |
38 | { } /* Terminating entry */ | 38 | { } /* Terminating entry */ |
39 | }; | 39 | }; |
40 | MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table); | 40 | MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table); |
diff --git a/drivers/media/dvb/dvb-usb/dibusb.h b/drivers/media/dvb/dvb-usb/dibusb.h index f3e3ea8c8dbb..7fd57d053b9f 100644 --- a/drivers/media/dvb/dvb-usb/dibusb.h +++ b/drivers/media/dvb/dvb-usb/dibusb.h | |||
@@ -95,16 +95,10 @@ | |||
95 | #define DIBUSB_IOCTL_CMD_ENABLE_STREAM 0x01 | 95 | #define DIBUSB_IOCTL_CMD_ENABLE_STREAM 0x01 |
96 | #define DIBUSB_IOCTL_CMD_DISABLE_STREAM 0x02 | 96 | #define DIBUSB_IOCTL_CMD_DISABLE_STREAM 0x02 |
97 | 97 | ||
98 | /* Tuner types. | ||
99 | These constants shall correspond to the proper AGC values in the array | ||
100 | dib3000mc_agc_tuner[][12] in dib3000mc_priv.h */ | ||
101 | #define DIBUSB_TUNER_DEFAULT 1 // a.k.a Panasonic | ||
102 | #define DIBUSB_TUNER_MT2060 4 | ||
103 | |||
104 | |||
105 | struct dibusb_state { | 98 | struct dibusb_state { |
106 | struct dib_fe_xfer_ops ops; | 99 | struct dib_fe_xfer_ops ops; |
107 | struct mt2060_state mt2060; | 100 | struct mt2060_state mt2060; |
101 | int mt2060_present; | ||
108 | 102 | ||
109 | /* for RC5 remote control */ | 103 | /* for RC5 remote control */ |
110 | int old_toggle; | 104 | int old_toggle; |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 6039e67425ac..82374abd460e 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h | |||
@@ -10,51 +10,51 @@ | |||
10 | #define _DVB_USB_IDS_H_ | 10 | #define _DVB_USB_IDS_H_ |
11 | 11 | ||
12 | /* Vendor IDs */ | 12 | /* Vendor IDs */ |
13 | #define USB_VID_ADSTECH 0x06e1 | 13 | #define USB_VID_ADSTECH 0x06e1 |
14 | #define USB_VID_ANCHOR 0x0547 | 14 | #define USB_VID_ANCHOR 0x0547 |
15 | #define USB_VID_WIDEVIEW 0x14aa | 15 | #define USB_VID_WIDEVIEW 0x14aa |
16 | #define USB_VID_AVERMEDIA 0x07ca | 16 | #define USB_VID_AVERMEDIA 0x07ca |
17 | #define USB_VID_COMPRO 0x185b | 17 | #define USB_VID_COMPRO 0x185b |
18 | #define USB_VID_COMPRO_UNK 0x145f | 18 | #define USB_VID_COMPRO_UNK 0x145f |
19 | #define USB_VID_CYPRESS 0x04b4 | 19 | #define USB_VID_CYPRESS 0x04b4 |
20 | #define USB_VID_DIBCOM 0x10b8 | 20 | #define USB_VID_DIBCOM 0x10b8 |
21 | #define USB_VID_DVICO 0x0fe9 | 21 | #define USB_VID_DVICO 0x0fe9 |
22 | #define USB_VID_EMPIA 0xeb1a | 22 | #define USB_VID_EMPIA 0xeb1a |
23 | #define USB_VID_GRANDTEC 0x5032 | 23 | #define USB_VID_GRANDTEC 0x5032 |
24 | #define USB_VID_HANFTEK 0x15f4 | 24 | #define USB_VID_HANFTEK 0x15f4 |
25 | #define USB_VID_HAUPPAUGE 0x2040 | 25 | #define USB_VID_HAUPPAUGE 0x2040 |
26 | #define USB_VID_HYPER_PALTEK 0x1025 | 26 | #define USB_VID_HYPER_PALTEK 0x1025 |
27 | #define USB_VID_KWORLD 0xeb2a | 27 | #define USB_VID_KWORLD 0xeb2a |
28 | #define USB_VID_KYE 0x0458 | 28 | #define USB_VID_KYE 0x0458 |
29 | #define USB_VID_MEDION 0x1660 | 29 | #define USB_VID_MEDION 0x1660 |
30 | #define USB_VID_PINNACLE 0x2304 | 30 | #define USB_VID_PINNACLE 0x2304 |
31 | #define USB_VID_VISIONPLUS 0x13d3 | 31 | #define USB_VID_VISIONPLUS 0x13d3 |
32 | #define USB_VID_TWINHAN 0x1822 | 32 | #define USB_VID_TWINHAN 0x1822 |
33 | #define USB_VID_ULTIMA_ELECTRONIC 0x05d8 | 33 | #define USB_VID_ULTIMA_ELECTRONIC 0x05d8 |
34 | #define USB_VID_LITEON 0x04ca | 34 | #define USB_VID_LITEON 0x04ca |
35 | 35 | ||
36 | /* Product IDs */ | 36 | /* Product IDs */ |
37 | #define USB_PID_ADSTECH_USB2_COLD 0xa333 | 37 | #define USB_PID_ADSTECH_USB2_COLD 0xa333 |
38 | #define USB_PID_ADSTECH_USB2_WARM 0xa334 | 38 | #define USB_PID_ADSTECH_USB2_WARM 0xa334 |
39 | #define USB_PID_AVERMEDIA_DVBT_USB_COLD 0x0001 | 39 | #define USB_PID_AVERMEDIA_DVBT_USB_COLD 0x0001 |
40 | #define USB_PID_AVERMEDIA_DVBT_USB_WARM 0x0002 | 40 | #define USB_PID_AVERMEDIA_DVBT_USB_WARM 0x0002 |
41 | #define USB_PID_AVERMEDIA_DVBT_USB2_COLD 0xa800 | 41 | #define USB_PID_AVERMEDIA_DVBT_USB2_COLD 0xa800 |
42 | #define USB_PID_AVERMEDIA_DVBT_USB2_WARM 0xa801 | 42 | #define USB_PID_AVERMEDIA_DVBT_USB2_WARM 0xa801 |
43 | #define USB_PID_COMPRO_DVBU2000_COLD 0xd000 | 43 | #define USB_PID_COMPRO_DVBU2000_COLD 0xd000 |
44 | #define USB_PID_COMPRO_DVBU2000_WARM 0xd001 | 44 | #define USB_PID_COMPRO_DVBU2000_WARM 0xd001 |
45 | #define USB_PID_COMPRO_DVBU2000_UNK_COLD 0x010c | 45 | #define USB_PID_COMPRO_DVBU2000_UNK_COLD 0x010c |
46 | #define USB_PID_COMPRO_DVBU2000_UNK_WARM 0x010d | 46 | #define USB_PID_COMPRO_DVBU2000_UNK_WARM 0x010d |
47 | #define USB_PID_DIBCOM_HOOK_DEFAULT 0x0064 | 47 | #define USB_PID_DIBCOM_HOOK_DEFAULT 0x0064 |
48 | #define USB_PID_DIBCOM_HOOK_DEFAULT_REENUM 0x0065 | 48 | #define USB_PID_DIBCOM_HOOK_DEFAULT_REENUM 0x0065 |
49 | #define USB_PID_DIBCOM_MOD3000_COLD 0x0bb8 | 49 | #define USB_PID_DIBCOM_MOD3000_COLD 0x0bb8 |
50 | #define USB_PID_DIBCOM_MOD3000_WARM 0x0bb9 | 50 | #define USB_PID_DIBCOM_MOD3000_WARM 0x0bb9 |
51 | #define USB_PID_DIBCOM_MOD3001_COLD 0x0bc6 | 51 | #define USB_PID_DIBCOM_MOD3001_COLD 0x0bc6 |
52 | #define USB_PID_DIBCOM_MOD3001_WARM 0x0bc7 | 52 | #define USB_PID_DIBCOM_MOD3001_WARM 0x0bc7 |
53 | #define USB_PID_DIBCOM_STK7700 0x1e14 | 53 | #define USB_PID_DIBCOM_STK7700 0x1e14 |
54 | #define USB_PID_DIBCOM_STK7700_REENUM 0x1e15 | 54 | #define USB_PID_DIBCOM_STK7700_REENUM 0x1e15 |
55 | #define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131 | 55 | #define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131 |
56 | #define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0 | 56 | #define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0 |
57 | #define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 | 57 | #define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 |
58 | #define USB_PID_KWORLD_VSTREAM_COLD 0x17de | 58 | #define USB_PID_KWORLD_VSTREAM_COLD 0x17de |
59 | #define USB_PID_KWORLD_VSTREAM_WARM 0x17df | 59 | #define USB_PID_KWORLD_VSTREAM_WARM 0x17df |
60 | #define USB_PID_TWINHAN_VP7041_COLD 0x3201 | 60 | #define USB_PID_TWINHAN_VP7041_COLD 0x3201 |
@@ -69,23 +69,23 @@ | |||
69 | #define USB_PID_DNTV_TINYUSB2_WARM 0x3224 | 69 | #define USB_PID_DNTV_TINYUSB2_WARM 0x3224 |
70 | #define USB_PID_ULTIMA_TVBOX_COLD 0x8105 | 70 | #define USB_PID_ULTIMA_TVBOX_COLD 0x8105 |
71 | #define USB_PID_ULTIMA_TVBOX_WARM 0x8106 | 71 | #define USB_PID_ULTIMA_TVBOX_WARM 0x8106 |
72 | #define USB_PID_ULTIMA_TVBOX_AN2235_COLD 0x8107 | 72 | #define USB_PID_ULTIMA_TVBOX_AN2235_COLD 0x8107 |
73 | #define USB_PID_ULTIMA_TVBOX_AN2235_WARM 0x8108 | 73 | #define USB_PID_ULTIMA_TVBOX_AN2235_WARM 0x8108 |
74 | #define USB_PID_ULTIMA_TVBOX_ANCHOR_COLD 0x2235 | 74 | #define USB_PID_ULTIMA_TVBOX_ANCHOR_COLD 0x2235 |
75 | #define USB_PID_ULTIMA_TVBOX_USB2_COLD 0x8109 | 75 | #define USB_PID_ULTIMA_TVBOX_USB2_COLD 0x8109 |
76 | #define USB_PID_ULTIMA_TVBOX_USB2_WARM 0x810a | 76 | #define USB_PID_ULTIMA_TVBOX_USB2_WARM 0x810a |
77 | #define USB_PID_ULTIMA_TVBOX_USB2_FX_COLD 0x8613 | 77 | #define USB_PID_ULTIMA_TVBOX_USB2_FX_COLD 0x8613 |
78 | #define USB_PID_ULTIMA_TVBOX_USB2_FX_WARM 0x1002 | 78 | #define USB_PID_ULTIMA_TVBOX_USB2_FX_WARM 0x1002 |
79 | #define USB_PID_UNK_HYPER_PALTEK_COLD 0x005e | 79 | #define USB_PID_UNK_HYPER_PALTEK_COLD 0x005e |
80 | #define USB_PID_UNK_HYPER_PALTEK_WARM 0x005f | 80 | #define USB_PID_UNK_HYPER_PALTEK_WARM 0x005f |
81 | #define USB_PID_HANFTEK_UMT_010_COLD 0x0001 | 81 | #define USB_PID_HANFTEK_UMT_010_COLD 0x0001 |
82 | #define USB_PID_HANFTEK_UMT_010_WARM 0x0015 | 82 | #define USB_PID_HANFTEK_UMT_010_WARM 0x0015 |
83 | #define USB_PID_DTT200U_COLD 0x0201 | 83 | #define USB_PID_DTT200U_COLD 0x0201 |
84 | #define USB_PID_DTT200U_WARM 0x0301 | 84 | #define USB_PID_DTT200U_WARM 0x0301 |
85 | #define USB_PID_WT220U_COLD 0x0222 | 85 | #define USB_PID_WT220U_COLD 0x0222 |
86 | #define USB_PID_WT220U_WARM 0x0221 | 86 | #define USB_PID_WT220U_WARM 0x0221 |
87 | #define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 | 87 | #define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 |
88 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 | 88 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 |
89 | #define USB_PID_NEBULA_DIGITV 0x0201 | 89 | #define USB_PID_NEBULA_DIGITV 0x0201 |
90 | #define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820 | 90 | #define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820 |
91 | #define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500 | 91 | #define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500 |
@@ -101,8 +101,8 @@ | |||
101 | #define USB_PID_MEDION_MD95700 0x0932 | 101 | #define USB_PID_MEDION_MD95700 0x0932 |
102 | #define USB_PID_KYE_DVB_T_COLD 0x701e | 102 | #define USB_PID_KYE_DVB_T_COLD 0x701e |
103 | #define USB_PID_KYE_DVB_T_WARM 0x701f | 103 | #define USB_PID_KYE_DVB_T_WARM 0x701f |
104 | #define USB_PID_PCTV_200E 0x020e | 104 | #define USB_PID_PCTV_200E 0x020e |
105 | #define USB_PID_PCTV_400E 0x020f | 105 | #define USB_PID_PCTV_400E 0x020f |
106 | #define USB_PID_LITEON_DVB_T_COLD 0xf000 | 106 | #define USB_PID_LITEON_DVB_T_COLD 0xf000 |
107 | #define USB_PID_LITEON_DVB_T_WARM 0xf001 | 107 | #define USB_PID_LITEON_DVB_T_WARM 0xf001 |
108 | #define USB_PID_DIGIVOX_MINI_SL_COLD 0xe360 | 108 | #define USB_PID_DIGIVOX_MINI_SL_COLD 0xe360 |
diff --git a/drivers/media/dvb/frontends/dib3000.h b/drivers/media/dvb/frontends/dib3000.h index d2ab7479012a..bd0e663cf6f3 100644 --- a/drivers/media/dvb/frontends/dib3000.h +++ b/drivers/media/dvb/frontends/dib3000.h | |||
@@ -26,10 +26,20 @@ | |||
26 | 26 | ||
27 | #include <linux/dvb/frontend.h> | 27 | #include <linux/dvb/frontend.h> |
28 | 28 | ||
29 | struct dib3000p_agc_config { | ||
30 | u16 val[12]; | ||
31 | }; | ||
32 | |||
29 | struct dib3000_config | 33 | struct dib3000_config |
30 | { | 34 | { |
31 | /* the demodulator's i2c address */ | 35 | /* the demodulator's i2c address */ |
32 | u8 demod_address; | 36 | u8 demod_address; |
37 | |||
38 | const struct dib3000p_agc_config *agc; | ||
39 | |||
40 | /* PLL maintenance and the i2c address of the PLL */ | ||
41 | int (*pll_init)(struct dvb_frontend *fe); | ||
42 | int (*pll_set)(struct dvb_frontend *fe, struct dvb_frontend_parameters* params); | ||
33 | }; | 43 | }; |
34 | 44 | ||
35 | struct dib_fe_xfer_ops | 45 | struct dib_fe_xfer_ops |
@@ -41,28 +51,11 @@ struct dib_fe_xfer_ops | |||
41 | int (*tuner_pass_ctrl)(struct dvb_frontend *fe, int onoff, u8 pll_ctrl); | 51 | int (*tuner_pass_ctrl)(struct dvb_frontend *fe, int onoff, u8 pll_ctrl); |
42 | }; | 52 | }; |
43 | 53 | ||
44 | #if defined(CONFIG_DVB_DIB3000MB) || defined(CONFIG_DVB_DIB3000MB_MODULE) | ||
45 | extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, | 54 | extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, |
46 | struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops); | 55 | struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops); |
47 | #else | ||
48 | static inline struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, | ||
49 | struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops) | ||
50 | { | ||
51 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); | ||
52 | return NULL; | ||
53 | } | ||
54 | #endif // CONFIG_DVB_DIB3000MB | ||
55 | 56 | ||
56 | #if defined(CONFIG_DVB_DIB3000MC) || defined(CONFIG_DVB_DIB3000MC_MODULE) | ||
57 | extern struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, | 57 | extern struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, |
58 | struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops); | 58 | struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops); |
59 | #else | ||
60 | static inline struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, | ||
61 | struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops) | ||
62 | { | ||
63 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); | ||
64 | return NULL; | ||
65 | } | ||
66 | #endif // CONFIG_DVB_DIB3000MC | ||
67 | 59 | ||
60 | extern int dib3000mc_set_agc_config(struct dvb_frontend *fe, const struct dib3000p_agc_config *agc); | ||
68 | #endif // DIB3000_H | 61 | #endif // DIB3000_H |
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c index 66b30edad2e4..41710f43975a 100644 --- a/drivers/media/dvb/frontends/dib3000mc.c +++ b/drivers/media/dvb/frontends/dib3000mc.c | |||
@@ -558,7 +558,7 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, | |||
558 | static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) | 558 | static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) |
559 | { | 559 | { |
560 | struct dib3000_state *state = fe->demodulator_priv; | 560 | struct dib3000_state *state = fe->demodulator_priv; |
561 | int AGCtuner=(int)fe->misc_priv; | 561 | const struct dib3000p_agc_config *agc = state->config.agc; |
562 | deb_info("init start\n"); | 562 | deb_info("init start\n"); |
563 | 563 | ||
564 | state->timing_offset = 0; | 564 | state->timing_offset = 0; |
@@ -584,11 +584,24 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) | |||
584 | /* mobile mode - portable reception */ | 584 | /* mobile mode - portable reception */ |
585 | wr_foreach(dib3000mc_reg_mobile_mode,dib3000mc_mobile_mode[1]); | 585 | wr_foreach(dib3000mc_reg_mobile_mode,dib3000mc_mobile_mode[1]); |
586 | 586 | ||
587 | /* TUNER_PANASONIC_ENV57H12D5 or TUNER_MICROTUNE_MT2060. Sets agc_tuner accordingly */ | 587 | /* AGC settings for all tuners */ |
588 | wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth); | 588 | wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth); |
589 | wr_foreach(dib3000mc_reg_agc_bandwidth_general,dib3000mc_agc_bandwidth_general); | 589 | wr_foreach(dib3000mc_reg_agc_bandwidth_general,dib3000mc_agc_bandwidth_general); |
590 | if (AGCtuner<0 || AGCtuner>=DIB3000MC_AGC_TUNER_COUNT) AGCtuner=1; | 590 | |
591 | wr_foreach(dib3000mc_reg_agc,dib3000mc_agc_tuner[AGCtuner]); | 591 | /* AGC setting - specific to the tuners */ |
592 | wr(36, agc->val[0]); | ||
593 | wr(37, agc->val[1]); | ||
594 | wr(38, agc->val[2]); | ||
595 | wr(39, agc->val[3]); | ||
596 | |||
597 | wr(42, agc->val[4]); | ||
598 | wr(43, agc->val[5]); | ||
599 | wr(44, agc->val[6]); | ||
600 | wr(45, agc->val[7]); | ||
601 | wr(46, agc->val[8]); | ||
602 | wr(47, agc->val[9]); | ||
603 | wr(48, agc->val[10]); | ||
604 | wr(49, agc->val[11]); | ||
592 | 605 | ||
593 | wr(DIB3000MC_REG_UNK_110,DIB3000MC_UNK_110); | 606 | wr(DIB3000MC_REG_UNK_110,DIB3000MC_UNK_110); |
594 | wr(26,0x6680); | 607 | wr(26,0x6680); |
@@ -824,6 +837,13 @@ static int dib3000mc_demod_init(struct dib3000_state *state) | |||
824 | return 0; | 837 | return 0; |
825 | } | 838 | } |
826 | 839 | ||
840 | int dib3000mc_set_agc_config(struct dvb_frontend *fe, const struct dib3000p_agc_config *agc) | ||
841 | { | ||
842 | struct dib3000_state *st = fe->demodulator_priv; | ||
843 | st->config.agc = agc; | ||
844 | return 0; | ||
845 | } | ||
846 | EXPORT_SYMBOL(dib3000mc_set_agc_config); | ||
827 | 847 | ||
828 | static struct dvb_frontend_ops dib3000mc_ops; | 848 | static struct dvb_frontend_ops dib3000mc_ops; |
829 | 849 | ||
@@ -878,6 +898,7 @@ error: | |||
878 | kfree(state); | 898 | kfree(state); |
879 | return NULL; | 899 | return NULL; |
880 | } | 900 | } |
901 | EXPORT_SYMBOL(dib3000mc_attach); | ||
881 | 902 | ||
882 | static struct dvb_frontend_ops dib3000mc_ops = { | 903 | static struct dvb_frontend_ops dib3000mc_ops = { |
883 | 904 | ||
@@ -916,5 +937,3 @@ static struct dvb_frontend_ops dib3000mc_ops = { | |||
916 | MODULE_AUTHOR(DRIVER_AUTHOR); | 937 | MODULE_AUTHOR(DRIVER_AUTHOR); |
917 | MODULE_DESCRIPTION(DRIVER_DESC); | 938 | MODULE_DESCRIPTION(DRIVER_DESC); |
918 | MODULE_LICENSE("GPL"); | 939 | MODULE_LICENSE("GPL"); |
919 | |||
920 | EXPORT_SYMBOL(dib3000mc_attach); | ||
diff --git a/drivers/media/dvb/frontends/dib3000mc_priv.h b/drivers/media/dvb/frontends/dib3000mc_priv.h index e1d0c98cf914..a0c8f1c911de 100644 --- a/drivers/media/dvb/frontends/dib3000mc_priv.h +++ b/drivers/media/dvb/frontends/dib3000mc_priv.h | |||
@@ -155,41 +155,6 @@ static u16 dib3000mc_imp_noise_ctl[][2] = { | |||
155 | { 0x1294, 0x1ff8 }, /* mode 4 */ | 155 | { 0x1294, 0x1ff8 }, /* mode 4 */ |
156 | }; | 156 | }; |
157 | 157 | ||
158 | /* AGC registers */ | ||
159 | static u16 dib3000mc_reg_agc[] = { | ||
160 | 36,37,38,39,42,43,44,45,46,47,48,49 | ||
161 | }; | ||
162 | /* AGC settings. Don't change the ordering of the entries */ | ||
163 | #define DIB3000MC_AGC_TUNER_COUNT 5 | ||
164 | |||
165 | static u16 dib3000mc_agc_tuner[][12] = { | ||
166 | /* 0*/ { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xcf5c, 0x6666, | ||
167 | 0xbae1, 0xa148, 0x3b5e, 0x3c1c, 0x001a, 0x2019 | ||
168 | }, /* TUNER_PANASONIC_ENV77H04D5, */ | ||
169 | |||
170 | /* 1*/ { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xdc29, 0x570a, | ||
171 | 0xbae1, 0x8ccd, 0x3b6d, 0x551d, 0x000a, 0x951e | ||
172 | }, /* TUNER_PANASONIC_ENV57H13D5, TUNER_PANASONIC_ENV57H12D5 */ | ||
173 | |||
174 | /* 2*/ { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xffff, 0xffff, | ||
175 | 0xffff, 0x0000, 0xfdfd, 0x4040, 0x00fd, 0x4040 | ||
176 | }, /* TUNER_SAMSUNG_DTOS333IH102, TUNER_RFAGCIN_UNKNOWN */ | ||
177 | |||
178 | /* 3*/ { 0x0196, 0x301d, 0x0000, 0x1cc7, 0xbd71, 0x5c29, | ||
179 | 0xb5c3, 0x6148, 0x6569, 0x5127, 0x0033, 0x3537 | ||
180 | }, /* TUNER_PROVIDER_X */ | ||
181 | |||
182 | /* 4*/ { 0x0196, 0x301d, 0x0000, 0x1cc7, 0xffff, 0x5c29, | ||
183 | 0xa8f6, 0x5eb8, 0x65ff, 0x40ff, 0x008a, 0x1114 | ||
184 | }, /* TUNER_MT2060 ( as in DibCom driver )*/ | ||
185 | |||
186 | /* { 0x0196, 0x301d, 0x0000, 0x1cc7, 0xbd71, 0x5c29, | ||
187 | 0xb5c3, 0x6148, 0x0045, 0x5127, 0x0033, 0x3437 | ||
188 | },*//* TUNER_MT2060 ( as in LITE-ON driver )*/ | ||
189 | |||
190 | /* TODO TUNER_PANASONIC_ENV57H10D8, TUNER_PANASONIC_ENV57H11D8 */ | ||
191 | }; | ||
192 | |||
193 | /* AGC loop bandwidth */ | 158 | /* AGC loop bandwidth */ |
194 | static u16 dib3000mc_reg_agc_bandwidth[] = { 40,41 }; | 159 | static u16 dib3000mc_reg_agc_bandwidth[] = { 40,41 }; |
195 | static u16 dib3000mc_agc_bandwidth[] = { 0x119,0x330 }; | 160 | static u16 dib3000mc_agc_bandwidth[] = { 0x119,0x330 }; |