diff options
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/Kconfig | 24 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/cxusb.c | 294 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/cxusb.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb-mb.c | 46 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/digitv.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dtt200u.c | 6 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dtt200u.h | 31 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-common.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-firmware.c | 154 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-i2c.c | 8 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 12 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-init.c | 59 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb.h | 29 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/nova-t-usb2.c | 7 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/vp702x-fe.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/vp702x.h | 43 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/vp7045.c | 2 |
17 files changed, 543 insertions, 180 deletions
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index 54e2b29076b1..90a69d343b79 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
@@ -37,16 +37,16 @@ config DVB_USB_DIBUSB_MB | |||
37 | DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-B demodulator. | 37 | DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-B demodulator. |
38 | 38 | ||
39 | Devices supported by this driver: | 39 | Devices supported by this driver: |
40 | TwinhanDTV USB-Ter (VP7041) | 40 | Artec T1 USB1.1 boxes |
41 | TwinhanDTV Magic Box (VP7041e) | 41 | Avermedia AverTV DVBT USB1.1 |
42 | KWorld/JetWay/ADSTech V-Stream XPERT DTV - DVB-T USB1.1 and USB2.0 | ||
43 | Hama DVB-T USB1.1-Box | ||
44 | DiBcom USB1.1 reference devices (non-public) | ||
45 | Ultima Electronic/Artec T1 USB TVBOX | ||
46 | Compro Videomate DVB-U2000 - DVB-T USB | 42 | Compro Videomate DVB-U2000 - DVB-T USB |
43 | DiBcom USB1.1 reference devices (non-public) | ||
47 | Grandtec DVB-T USB | 44 | Grandtec DVB-T USB |
48 | Avermedia AverTV DVBT USB1.1 | 45 | Hama DVB-T USB1.1-Box |
49 | Artec T1 USB1.1 boxes | 46 | KWorld/JetWay/ADSTech V-Stream XPERT DTV - DVB-T USB1.1 and USB2.0 |
47 | TwinhanDTV Magic Box (VP7041e) | ||
48 | TwinhanDTV USB-Ter (VP7041) | ||
49 | Ultima Electronic/Artec T1 USB TVBOX | ||
50 | 50 | ||
51 | The VP7041 seems to be identical to "CTS Portable" (Chinese | 51 | The VP7041 seems to be identical to "CTS Portable" (Chinese |
52 | Television System). | 52 | Television System). |
@@ -54,6 +54,12 @@ config DVB_USB_DIBUSB_MB | |||
54 | Say Y if you own such a device and want to use it. You should build it as | 54 | Say Y if you own such a device and want to use it. You should build it as |
55 | a module. | 55 | a module. |
56 | 56 | ||
57 | config DVB_USB_DIBUSB_MB_FAULTY | ||
58 | bool "Support faulty USB IDs" | ||
59 | depends on DVB_USB_DIBUSB_MB | ||
60 | help | ||
61 | Support for faulty USB IDs due to an invalid EEPROM on some Artec devices. | ||
62 | |||
57 | config DVB_USB_DIBUSB_MC | 63 | config DVB_USB_DIBUSB_MC |
58 | tristate "DiBcom USB DVB-T devices (based on the DiB3000M-C/P) (see help for device list)" | 64 | tristate "DiBcom USB DVB-T devices (based on the DiB3000M-C/P) (see help for device list)" |
59 | depends on DVB_USB | 65 | depends on DVB_USB |
@@ -63,8 +69,8 @@ config DVB_USB_DIBUSB_MC | |||
63 | DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-C/P demodulator. | 69 | DiBcom (<http://www.dibcom.fr>) equipped with a DiB3000M-C/P demodulator. |
64 | 70 | ||
65 | Devices supported by this driver: | 71 | Devices supported by this driver: |
66 | DiBcom USB2.0 reference devices (non-public) | ||
67 | Artec T1 USB2.0 boxes | 72 | Artec T1 USB2.0 boxes |
73 | DiBcom USB2.0 reference devices (non-public) | ||
68 | 74 | ||
69 | Say Y if you own such a device and want to use it. You should build it as | 75 | Say Y if you own such a device and want to use it. You should build it as |
70 | a module. | 76 | a module. |
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index d05fab01cccd..358ed153865f 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -11,10 +11,11 @@ | |||
11 | * design, so it can be reused for the "analogue-only" device (if it will | 11 | * design, so it can be reused for the "analogue-only" device (if it will |
12 | * appear at all). | 12 | * appear at all). |
13 | * | 13 | * |
14 | * TODO: check if the cx25840-driver (from ivtv) can be used for the analogue | 14 | * TODO: Use the cx25840-driver for the analogue part |
15 | * part | ||
16 | * | 15 | * |
17 | * Copyright (C) 2005 Patrick Boettcher (patrick.boettcher@desy.de) | 16 | * Copyright (C) 2005 Patrick Boettcher (patrick.boettcher@desy.de) |
17 | * Copyright (C) 2005 Michael Krufky (mkrufky@m1k.net) | ||
18 | * Copyright (C) 2006 Chris Pascoe (c.pascoe@itee.uq.edu.au) | ||
18 | * | 19 | * |
19 | * This program is free software; you can redistribute it and/or modify it | 20 | * This program is free software; you can redistribute it and/or modify it |
20 | * under the terms of the GNU General Public License as published by the Free | 21 | * under the terms of the GNU General Public License as published by the Free |
@@ -25,6 +26,9 @@ | |||
25 | #include "cxusb.h" | 26 | #include "cxusb.h" |
26 | 27 | ||
27 | #include "cx22702.h" | 28 | #include "cx22702.h" |
29 | #include "lgdt330x.h" | ||
30 | #include "mt352.h" | ||
31 | #include "mt352_priv.h" | ||
28 | 32 | ||
29 | /* debug */ | 33 | /* debug */ |
30 | int dvb_usb_cxusb_debug; | 34 | int dvb_usb_cxusb_debug; |
@@ -156,6 +160,99 @@ static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) | |||
156 | return 0; | 160 | return 0; |
157 | } | 161 | } |
158 | 162 | ||
163 | static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | ||
164 | { | ||
165 | struct dvb_usb_rc_key *keymap = d->props.rc_key_map; | ||
166 | u8 ircode[4]; | ||
167 | int i; | ||
168 | |||
169 | cxusb_ctrl_msg(d, CMD_GET_IR_CODE, NULL, 0, ircode, 4); | ||
170 | |||
171 | *event = 0; | ||
172 | *state = REMOTE_NO_KEY_PRESSED; | ||
173 | |||
174 | for (i = 0; i < d->props.rc_key_map_size; i++) { | ||
175 | if (keymap[i].custom == ircode[2] && | ||
176 | keymap[i].data == ircode[3]) { | ||
177 | *event = keymap[i].event; | ||
178 | *state = REMOTE_KEY_PRESSED; | ||
179 | |||
180 | return 0; | ||
181 | } | ||
182 | } | ||
183 | |||
184 | return 0; | ||
185 | } | ||
186 | |||
187 | struct dvb_usb_rc_key dvico_mce_rc_keys[] = { | ||
188 | { 0xfe, 0x02, KEY_TV }, | ||
189 | { 0xfe, 0x0e, KEY_MP3 }, | ||
190 | { 0xfe, 0x1a, KEY_DVD }, | ||
191 | { 0xfe, 0x1e, KEY_FAVORITES }, | ||
192 | { 0xfe, 0x16, KEY_SETUP }, | ||
193 | { 0xfe, 0x46, KEY_POWER2 }, | ||
194 | { 0xfe, 0x0a, KEY_EPG }, | ||
195 | { 0xfe, 0x49, KEY_BACK }, | ||
196 | { 0xfe, 0x4d, KEY_MENU }, | ||
197 | { 0xfe, 0x51, KEY_UP }, | ||
198 | { 0xfe, 0x5b, KEY_LEFT }, | ||
199 | { 0xfe, 0x5f, KEY_RIGHT }, | ||
200 | { 0xfe, 0x53, KEY_DOWN }, | ||
201 | { 0xfe, 0x5e, KEY_OK }, | ||
202 | { 0xfe, 0x59, KEY_INFO }, | ||
203 | { 0xfe, 0x55, KEY_TAB }, | ||
204 | { 0xfe, 0x0f, KEY_PREVIOUSSONG },/* Replay */ | ||
205 | { 0xfe, 0x12, KEY_NEXTSONG }, /* Skip */ | ||
206 | { 0xfe, 0x42, KEY_ENTER }, /* Windows/Start */ | ||
207 | { 0xfe, 0x15, KEY_VOLUMEUP }, | ||
208 | { 0xfe, 0x05, KEY_VOLUMEDOWN }, | ||
209 | { 0xfe, 0x11, KEY_CHANNELUP }, | ||
210 | { 0xfe, 0x09, KEY_CHANNELDOWN }, | ||
211 | { 0xfe, 0x52, KEY_CAMERA }, | ||
212 | { 0xfe, 0x5a, KEY_TUNER }, /* Live */ | ||
213 | { 0xfe, 0x19, KEY_OPEN }, | ||
214 | { 0xfe, 0x0b, KEY_1 }, | ||
215 | { 0xfe, 0x17, KEY_2 }, | ||
216 | { 0xfe, 0x1b, KEY_3 }, | ||
217 | { 0xfe, 0x07, KEY_4 }, | ||
218 | { 0xfe, 0x50, KEY_5 }, | ||
219 | { 0xfe, 0x54, KEY_6 }, | ||
220 | { 0xfe, 0x48, KEY_7 }, | ||
221 | { 0xfe, 0x4c, KEY_8 }, | ||
222 | { 0xfe, 0x58, KEY_9 }, | ||
223 | { 0xfe, 0x13, KEY_ANGLE }, /* Aspect */ | ||
224 | { 0xfe, 0x03, KEY_0 }, | ||
225 | { 0xfe, 0x1f, KEY_ZOOM }, | ||
226 | { 0xfe, 0x43, KEY_REWIND }, | ||
227 | { 0xfe, 0x47, KEY_PLAYPAUSE }, | ||
228 | { 0xfe, 0x4f, KEY_FASTFORWARD }, | ||
229 | { 0xfe, 0x57, KEY_MUTE }, | ||
230 | { 0xfe, 0x0d, KEY_STOP }, | ||
231 | { 0xfe, 0x01, KEY_RECORD }, | ||
232 | { 0xfe, 0x4e, KEY_POWER }, | ||
233 | }; | ||
234 | |||
235 | static int cxusb_dee1601_demod_init(struct dvb_frontend* fe) | ||
236 | { | ||
237 | static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x38 }; | ||
238 | static u8 reset [] = { RESET, 0x80 }; | ||
239 | static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 }; | ||
240 | static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0x20 }; | ||
241 | static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 }; | ||
242 | static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 }; | ||
243 | |||
244 | mt352_write(fe, clock_config, sizeof(clock_config)); | ||
245 | udelay(200); | ||
246 | mt352_write(fe, reset, sizeof(reset)); | ||
247 | mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg)); | ||
248 | |||
249 | mt352_write(fe, agc_cfg, sizeof(agc_cfg)); | ||
250 | mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg)); | ||
251 | mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg)); | ||
252 | |||
253 | return 0; | ||
254 | } | ||
255 | |||
159 | struct cx22702_config cxusb_cx22702_config = { | 256 | struct cx22702_config cxusb_cx22702_config = { |
160 | .demod_address = 0x63, | 257 | .demod_address = 0x63, |
161 | 258 | ||
@@ -165,17 +262,47 @@ struct cx22702_config cxusb_cx22702_config = { | |||
165 | .pll_set = dvb_usb_pll_set_i2c, | 262 | .pll_set = dvb_usb_pll_set_i2c, |
166 | }; | 263 | }; |
167 | 264 | ||
265 | struct lgdt330x_config cxusb_lgdt330x_config = { | ||
266 | .demod_address = 0x0e, | ||
267 | .demod_chip = LGDT3303, | ||
268 | .pll_set = dvb_usb_pll_set_i2c, | ||
269 | }; | ||
270 | |||
271 | struct mt352_config cxusb_dee1601_config = { | ||
272 | .demod_address = 0x0f, | ||
273 | .demod_init = cxusb_dee1601_demod_init, | ||
274 | .pll_set = dvb_usb_pll_set, | ||
275 | }; | ||
276 | |||
168 | /* Callbacks for DVB USB */ | 277 | /* Callbacks for DVB USB */ |
169 | static int cxusb_tuner_attach(struct dvb_usb_device *d) | 278 | static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d) |
170 | { | 279 | { |
171 | u8 bpll[4] = { 0x0b, 0xdc, 0x9c, 0xa0 }; | 280 | u8 bpll[4] = { 0x0b, 0xdc, 0x9c, 0xa0 }; |
172 | d->pll_addr = 0x61; | 281 | d->pll_addr = 0x61; |
173 | memcpy(d->pll_init,bpll,4); | 282 | memcpy(d->pll_init, bpll, 4); |
174 | d->pll_desc = &dvb_pll_fmd1216me; | 283 | d->pll_desc = &dvb_pll_fmd1216me; |
175 | return 0; | 284 | return 0; |
176 | } | 285 | } |
177 | 286 | ||
178 | static int cxusb_frontend_attach(struct dvb_usb_device *d) | 287 | static int cxusb_lgh064f_tuner_attach(struct dvb_usb_device *d) |
288 | { | ||
289 | u8 bpll[4] = { 0x00, 0x00, 0x18, 0x50 }; | ||
290 | /* bpll[2] : unset bit 3, set bits 4&5 | ||
291 | bpll[3] : 0x50 - digital, 0x20 - analog */ | ||
292 | d->pll_addr = 0x61; | ||
293 | memcpy(d->pll_init, bpll, 4); | ||
294 | d->pll_desc = &dvb_pll_tdvs_tua6034; | ||
295 | return 0; | ||
296 | } | ||
297 | |||
298 | static int cxusb_dee1601_tuner_attach(struct dvb_usb_device *d) | ||
299 | { | ||
300 | d->pll_addr = 0x61; | ||
301 | d->pll_desc = &dvb_pll_thomson_dtt7579; | ||
302 | return 0; | ||
303 | } | ||
304 | |||
305 | static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) | ||
179 | { | 306 | { |
180 | u8 b; | 307 | u8 b; |
181 | if (usb_set_interface(d->udev,0,6) < 0) | 308 | if (usb_set_interface(d->udev,0,6) < 0) |
@@ -189,22 +316,84 @@ static int cxusb_frontend_attach(struct dvb_usb_device *d) | |||
189 | return -EIO; | 316 | return -EIO; |
190 | } | 317 | } |
191 | 318 | ||
319 | static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d) | ||
320 | { | ||
321 | if (usb_set_interface(d->udev,0,7) < 0) | ||
322 | err("set interface failed"); | ||
323 | |||
324 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); | ||
325 | |||
326 | if ((d->fe = lgdt330x_attach(&cxusb_lgdt330x_config, &d->i2c_adap)) != NULL) | ||
327 | return 0; | ||
328 | |||
329 | return -EIO; | ||
330 | } | ||
331 | |||
332 | static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d) | ||
333 | { | ||
334 | if (usb_set_interface(d->udev,0,0) < 0) | ||
335 | err("set interface failed"); | ||
336 | |||
337 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); | ||
338 | |||
339 | if ((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL) | ||
340 | return 0; | ||
341 | |||
342 | return -EIO; | ||
343 | } | ||
344 | |||
345 | /* | ||
346 | * DViCO bluebird firmware needs the "warm" product ID to be patched into the | ||
347 | * firmware file before download. | ||
348 | */ | ||
349 | |||
350 | #define BLUEBIRD_01_ID_OFFSET 6638 | ||
351 | static int bluebird_patch_dvico_firmware_download(struct usb_device *udev, const struct firmware *fw) | ||
352 | { | ||
353 | if (fw->size < BLUEBIRD_01_ID_OFFSET + 4) | ||
354 | return -EINVAL; | ||
355 | |||
356 | if (fw->data[BLUEBIRD_01_ID_OFFSET] == (USB_VID_DVICO & 0xff) && | ||
357 | fw->data[BLUEBIRD_01_ID_OFFSET + 1] == USB_VID_DVICO >> 8) { | ||
358 | |||
359 | /* FIXME: are we allowed to change the fw-data ? */ | ||
360 | fw->data[BLUEBIRD_01_ID_OFFSET + 2] = udev->descriptor.idProduct + 1; | ||
361 | fw->data[BLUEBIRD_01_ID_OFFSET + 3] = udev->descriptor.idProduct >> 8; | ||
362 | |||
363 | return usb_cypress_load_firmware(udev,fw,CYPRESS_FX2); | ||
364 | } | ||
365 | |||
366 | return -EINVAL; | ||
367 | } | ||
368 | |||
192 | /* DVB USB Driver stuff */ | 369 | /* DVB USB Driver stuff */ |
193 | static struct dvb_usb_properties cxusb_properties; | 370 | static struct dvb_usb_properties cxusb_medion_properties; |
371 | static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties; | ||
372 | static struct dvb_usb_properties cxusb_bluebird_dee1601_properties; | ||
194 | 373 | ||
195 | static int cxusb_probe(struct usb_interface *intf, | 374 | static int cxusb_probe(struct usb_interface *intf, |
196 | const struct usb_device_id *id) | 375 | const struct usb_device_id *id) |
197 | { | 376 | { |
198 | return dvb_usb_device_init(intf,&cxusb_properties,THIS_MODULE,NULL); | 377 | if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 || |
378 | dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 || | ||
379 | dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0) { | ||
380 | return 0; | ||
381 | } | ||
382 | |||
383 | return -EINVAL; | ||
199 | } | 384 | } |
200 | 385 | ||
201 | static struct usb_device_id cxusb_table [] = { | 386 | static struct usb_device_id cxusb_table [] = { |
202 | { USB_DEVICE(USB_VID_MEDION, USB_PID_MEDION_MD95700) }, | 387 | { USB_DEVICE(USB_VID_MEDION, USB_PID_MEDION_MD95700) }, |
388 | { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_COLD) }, | ||
389 | { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) }, | ||
390 | { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) }, | ||
391 | { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) }, | ||
203 | {} /* Terminating entry */ | 392 | {} /* Terminating entry */ |
204 | }; | 393 | }; |
205 | MODULE_DEVICE_TABLE (usb, cxusb_table); | 394 | MODULE_DEVICE_TABLE (usb, cxusb_table); |
206 | 395 | ||
207 | static struct dvb_usb_properties cxusb_properties = { | 396 | static struct dvb_usb_properties cxusb_medion_properties = { |
208 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | 397 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, |
209 | 398 | ||
210 | .usb_ctrl = CYPRESS_FX2, | 399 | .usb_ctrl = CYPRESS_FX2, |
@@ -213,8 +402,8 @@ static struct dvb_usb_properties cxusb_properties = { | |||
213 | 402 | ||
214 | .streaming_ctrl = cxusb_streaming_ctrl, | 403 | .streaming_ctrl = cxusb_streaming_ctrl, |
215 | .power_ctrl = cxusb_power_ctrl, | 404 | .power_ctrl = cxusb_power_ctrl, |
216 | .frontend_attach = cxusb_frontend_attach, | 405 | .frontend_attach = cxusb_cx22702_frontend_attach, |
217 | .tuner_attach = cxusb_tuner_attach, | 406 | .tuner_attach = cxusb_fmd1216me_tuner_attach, |
218 | 407 | ||
219 | .i2c_algo = &cxusb_i2c_algo, | 408 | .i2c_algo = &cxusb_i2c_algo, |
220 | 409 | ||
@@ -240,6 +429,91 @@ static struct dvb_usb_properties cxusb_properties = { | |||
240 | } | 429 | } |
241 | }; | 430 | }; |
242 | 431 | ||
432 | static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { | ||
433 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | ||
434 | |||
435 | .usb_ctrl = DEVICE_SPECIFIC, | ||
436 | .firmware = "dvb-usb-bluebird-01.fw", | ||
437 | .download_firmware = bluebird_patch_dvico_firmware_download, | ||
438 | /* use usb alt setting 0 for EP4 transfer (dvb-t), | ||
439 | use usb alt setting 7 for EP2 transfer (atsc) */ | ||
440 | |||
441 | .size_of_priv = sizeof(struct cxusb_state), | ||
442 | |||
443 | .streaming_ctrl = cxusb_streaming_ctrl, | ||
444 | .power_ctrl = cxusb_power_ctrl, | ||
445 | .frontend_attach = cxusb_lgdt330x_frontend_attach, | ||
446 | .tuner_attach = cxusb_lgh064f_tuner_attach, | ||
447 | |||
448 | .i2c_algo = &cxusb_i2c_algo, | ||
449 | |||
450 | .generic_bulk_ctrl_endpoint = 0x01, | ||
451 | /* parameter for the MPEG2-data transfer */ | ||
452 | .urb = { | ||
453 | .type = DVB_USB_BULK, | ||
454 | .count = 5, | ||
455 | .endpoint = 0x02, | ||
456 | .u = { | ||
457 | .bulk = { | ||
458 | .buffersize = 8192, | ||
459 | } | ||
460 | } | ||
461 | }, | ||
462 | |||
463 | .num_device_descs = 1, | ||
464 | .devices = { | ||
465 | { "DViCO FusionHDTV5 USB Gold", | ||
466 | { &cxusb_table[1], NULL }, | ||
467 | { &cxusb_table[2], NULL }, | ||
468 | }, | ||
469 | } | ||
470 | }; | ||
471 | |||
472 | static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = { | ||
473 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | ||
474 | |||
475 | .usb_ctrl = DEVICE_SPECIFIC, | ||
476 | .firmware = "dvb-usb-bluebird-01.fw", | ||
477 | .download_firmware = bluebird_patch_dvico_firmware_download, | ||
478 | /* use usb alt setting 0 for EP4 transfer (dvb-t), | ||
479 | use usb alt setting 7 for EP2 transfer (atsc) */ | ||
480 | |||
481 | .size_of_priv = sizeof(struct cxusb_state), | ||
482 | |||
483 | .streaming_ctrl = cxusb_streaming_ctrl, | ||
484 | .power_ctrl = cxusb_power_ctrl, | ||
485 | .frontend_attach = cxusb_dee1601_frontend_attach, | ||
486 | .tuner_attach = cxusb_dee1601_tuner_attach, | ||
487 | |||
488 | .i2c_algo = &cxusb_i2c_algo, | ||
489 | |||
490 | .rc_interval = 150, | ||
491 | .rc_key_map = dvico_mce_rc_keys, | ||
492 | .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys), | ||
493 | .rc_query = cxusb_rc_query, | ||
494 | |||
495 | .generic_bulk_ctrl_endpoint = 0x01, | ||
496 | /* parameter for the MPEG2-data transfer */ | ||
497 | .urb = { | ||
498 | .type = DVB_USB_BULK, | ||
499 | .count = 5, | ||
500 | .endpoint = 0x04, | ||
501 | .u = { | ||
502 | .bulk = { | ||
503 | .buffersize = 8192, | ||
504 | } | ||
505 | } | ||
506 | }, | ||
507 | |||
508 | .num_device_descs = 1, | ||
509 | .devices = { | ||
510 | { "DViCO FusionHDTV DVB-T Dual USB", | ||
511 | { &cxusb_table[3], NULL }, | ||
512 | { &cxusb_table[4], NULL }, | ||
513 | }, | ||
514 | } | ||
515 | }; | ||
516 | |||
243 | static struct usb_driver cxusb_driver = { | 517 | static struct usb_driver cxusb_driver = { |
244 | .name = "dvb_usb_cxusb", | 518 | .name = "dvb_usb_cxusb", |
245 | .probe = cxusb_probe, | 519 | .probe = cxusb_probe, |
diff --git a/drivers/media/dvb/dvb-usb/cxusb.h b/drivers/media/dvb/dvb-usb/cxusb.h index 135c2a81f581..087c99427853 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.h +++ b/drivers/media/dvb/dvb-usb/cxusb.h | |||
@@ -21,6 +21,8 @@ extern int dvb_usb_cxusb_debug; | |||
21 | #define CMD_STREAMING_ON 0x36 | 21 | #define CMD_STREAMING_ON 0x36 |
22 | #define CMD_STREAMING_OFF 0x37 | 22 | #define CMD_STREAMING_OFF 0x37 |
23 | 23 | ||
24 | #define CMD_GET_IR_CODE 0x47 | ||
25 | |||
24 | #define CMD_ANALOG 0x50 | 26 | #define CMD_ANALOG 0x50 |
25 | #define CMD_DIGITAL 0x51 | 27 | #define CMD_DIGITAL 0x51 |
26 | 28 | ||
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c b/drivers/media/dvb/dvb-usb/dibusb-mb.c index 52ac3e5adf5d..dd5a13195886 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mb.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c | |||
@@ -65,11 +65,11 @@ static int dibusb_tuner_probe_and_attach(struct dvb_usb_device *d) | |||
65 | d->tuner_pass_ctrl(d->fe,0,msg[0].addr); | 65 | d->tuner_pass_ctrl(d->fe,0,msg[0].addr); |
66 | 66 | ||
67 | if (b2[0] == 0xfe) { | 67 | if (b2[0] == 0xfe) { |
68 | info("this device has the Thomson Cable onboard. Which is default."); | 68 | info("This device has the Thomson Cable onboard. Which is default."); |
69 | dibusb_thomson_tuner_attach(d); | 69 | dibusb_thomson_tuner_attach(d); |
70 | } else { | 70 | } else { |
71 | u8 bpll[4] = { 0x0b, 0xf5, 0x85, 0xab }; | 71 | u8 bpll[4] = { 0x0b, 0xf5, 0x85, 0xab }; |
72 | info("this device has the Panasonic ENV77H11D5 onboard."); | 72 | info("This device has the Panasonic ENV77H11D5 onboard."); |
73 | d->pll_addr = 0x60; | 73 | d->pll_addr = 0x60; |
74 | memcpy(d->pll_init,bpll,4); | 74 | memcpy(d->pll_init,bpll,4); |
75 | d->pll_desc = &dvb_pll_tda665x; | 75 | d->pll_desc = &dvb_pll_tda665x; |
@@ -98,15 +98,15 @@ static int dibusb_probe(struct usb_interface *intf, | |||
98 | 98 | ||
99 | /* do not change the order of the ID table */ | 99 | /* do not change the order of the ID table */ |
100 | static struct usb_device_id dibusb_dib3000mb_table [] = { | 100 | static struct usb_device_id dibusb_dib3000mb_table [] = { |
101 | /* 00 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_COLD)}, | 101 | /* 00 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_COLD) }, |
102 | /* 01 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_WARM)}, | 102 | /* 01 */ { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_AVERMEDIA_DVBT_USB_WARM) }, |
103 | /* 02 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_COLD) }, | 103 | /* 02 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_COLD) }, |
104 | /* 03 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_WARM) }, | 104 | /* 03 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_WARM) }, |
105 | /* 04 */ { USB_DEVICE(USB_VID_COMPRO_UNK, USB_PID_COMPRO_DVBU2000_UNK_COLD) }, | 105 | /* 04 */ { USB_DEVICE(USB_VID_COMPRO_UNK, USB_PID_COMPRO_DVBU2000_UNK_COLD) }, |
106 | /* 05 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_COLD) }, | 106 | /* 05 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_COLD) }, |
107 | /* 06 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_WARM) }, | 107 | /* 06 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_WARM) }, |
108 | /* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_COLD) }, | 108 | /* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_COLD) }, |
109 | /* 08 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_WARM) }, | 109 | /* 08 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_WARM) }, |
110 | /* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_COLD) }, | 110 | /* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_COLD) }, |
111 | /* 10 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_WARM) }, | 111 | /* 10 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_WARM) }, |
112 | /* 11 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_COLD) }, | 112 | /* 11 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_COLD) }, |
@@ -117,27 +117,34 @@ static struct usb_device_id dibusb_dib3000mb_table [] = { | |||
117 | /* 16 */ { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7041_WARM) }, | 117 | /* 16 */ { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7041_WARM) }, |
118 | /* 17 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_COLD) }, | 118 | /* 17 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_COLD) }, |
119 | /* 18 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_WARM) }, | 119 | /* 18 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_WARM) }, |
120 | /* 19 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_COLD) }, | 120 | /* 19 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_COLD) }, |
121 | /* 20 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_WARM) }, | 121 | /* 20 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_WARM) }, |
122 | /* 21 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_COLD) }, | 122 | /* 21 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_COLD) }, |
123 | /* 22 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_WARM) }, | 123 | /* 22 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_WARM) }, |
124 | /* 23 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_COLD) }, | 124 | /* 23 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_COLD) }, |
125 | 125 | ||
126 | /* device ID with default DIBUSB2_0-firmware and with the hacked firmware */ | 126 | /* device ID with default DIBUSB2_0-firmware and with the hacked firmware */ |
127 | /* 24 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_WARM) }, | 127 | /* 24 */ { USB_DEVICE(USB_VID_ADSTECH, USB_PID_ADSTECH_USB2_WARM) }, |
128 | /* 25 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_COLD) }, | 128 | /* 25 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_COLD) }, |
129 | /* 26 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_WARM) }, | 129 | /* 26 */ { USB_DEVICE(USB_VID_KYE, USB_PID_KYE_DVB_T_WARM) }, |
130 | 130 | ||
131 | /* 27 */ { USB_DEVICE(USB_VID_KWORLD, USB_PID_KWORLD_VSTREAM_COLD) }, | 131 | /* 27 */ { USB_DEVICE(USB_VID_KWORLD, USB_PID_KWORLD_VSTREAM_COLD) }, |
132 | 132 | ||
133 | /* 28 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) }, | 133 | /* 28 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) }, |
134 | /* 29 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) }, | 134 | /* 29 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) }, |
135 | 135 | ||
136 | // #define DVB_USB_DIBUSB_MB_FAULTY_USB_IDs | 136 | /* |
137 | * XXX: As Artec just 'forgot' to program the EEPROM on some Artec T1 devices | ||
138 | * we don't catch these faulty IDs (namely 'Cypress FX1 USB controller') that | ||
139 | * have been left on the device. If you don't have such a device but an Artec | ||
140 | * device that's supposed to work with this driver but is not detected by it, | ||
141 | * free to enable CONFIG_DVB_USB_DIBUSB_MB_FAULTY via your kernel config. | ||
142 | */ | ||
137 | 143 | ||
138 | #ifdef DVB_USB_DIBUSB_MB_FAULTY_USB_IDs | 144 | #ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY |
139 | /* 30 */ { USB_DEVICE(USB_VID_ANCHOR, USB_PID_ULTIMA_TVBOX_ANCHOR_COLD) }, | 145 | /* 30 */ { USB_DEVICE(USB_VID_ANCHOR, USB_PID_ULTIMA_TVBOX_ANCHOR_COLD) }, |
140 | #endif | 146 | #endif |
147 | |||
141 | { } /* Terminating entry */ | 148 | { } /* Terminating entry */ |
142 | }; | 149 | }; |
143 | MODULE_DEVICE_TABLE (usb, dibusb_dib3000mb_table); | 150 | MODULE_DEVICE_TABLE (usb, dibusb_dib3000mb_table); |
@@ -257,7 +264,7 @@ static struct dvb_usb_properties dibusb1_1_an2235_properties = { | |||
257 | } | 264 | } |
258 | }, | 265 | }, |
259 | 266 | ||
260 | #ifdef DVB_USB_DIBUSB_MB_FAULTY_USB_IDs | 267 | #ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY |
261 | .num_device_descs = 2, | 268 | .num_device_descs = 2, |
262 | #else | 269 | #else |
263 | .num_device_descs = 1, | 270 | .num_device_descs = 1, |
@@ -267,11 +274,12 @@ static struct dvb_usb_properties dibusb1_1_an2235_properties = { | |||
267 | { &dibusb_dib3000mb_table[20], NULL }, | 274 | { &dibusb_dib3000mb_table[20], NULL }, |
268 | { &dibusb_dib3000mb_table[21], NULL }, | 275 | { &dibusb_dib3000mb_table[21], NULL }, |
269 | }, | 276 | }, |
270 | #ifdef DVB_USB_DIBUSB_MB_FAULTY_USB_IDs | 277 | #ifdef CONFIG_DVB_USB_DIBUSB_MB_FAULTY |
271 | { "Artec T1 USB1.1 TVBOX with AN2235 (faulty USB IDs)", | 278 | { "Artec T1 USB1.1 TVBOX with AN2235 (faulty USB IDs)", |
272 | { &dibusb_dib3000mb_table[30], NULL }, | 279 | { &dibusb_dib3000mb_table[30], NULL }, |
273 | { NULL }, | 280 | { NULL }, |
274 | }, | 281 | }, |
282 | { NULL }, | ||
275 | #endif | 283 | #endif |
276 | } | 284 | } |
277 | }; | 285 | }; |
@@ -323,6 +331,7 @@ static struct dvb_usb_properties dibusb2_0b_properties = { | |||
323 | { &dibusb_dib3000mb_table[27], NULL }, | 331 | { &dibusb_dib3000mb_table[27], NULL }, |
324 | { NULL } | 332 | { NULL } |
325 | }, | 333 | }, |
334 | { NULL }, | ||
326 | } | 335 | } |
327 | }; | 336 | }; |
328 | 337 | ||
@@ -369,6 +378,7 @@ static struct dvb_usb_properties artec_t1_usb2_properties = { | |||
369 | { &dibusb_dib3000mb_table[28], NULL }, | 378 | { &dibusb_dib3000mb_table[28], NULL }, |
370 | { &dibusb_dib3000mb_table[29], NULL }, | 379 | { &dibusb_dib3000mb_table[29], NULL }, |
371 | }, | 380 | }, |
381 | { NULL }, | ||
372 | } | 382 | } |
373 | }; | 383 | }; |
374 | 384 | ||
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index 450417a9e64b..e6c55c9c9417 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -32,7 +32,7 @@ static int digitv_ctrl_msg(struct dvb_usb_device *d, | |||
32 | sndbuf[1] = vv; | 32 | sndbuf[1] = vv; |
33 | sndbuf[2] = wo ? wlen : rlen; | 33 | sndbuf[2] = wo ? wlen : rlen; |
34 | 34 | ||
35 | if (!wo) { | 35 | if (wo) { |
36 | memcpy(&sndbuf[3],wbuf,wlen); | 36 | memcpy(&sndbuf[3],wbuf,wlen); |
37 | dvb_usb_generic_write(d,sndbuf,7); | 37 | dvb_usb_generic_write(d,sndbuf,7); |
38 | } else { | 38 | } else { |
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c b/drivers/media/dvb/dvb-usb/dtt200u.c index 6e2bac873445..130ea7f21f5e 100644 --- a/drivers/media/dvb/dvb-usb/dtt200u.c +++ b/drivers/media/dvb/dvb-usb/dtt200u.c | |||
@@ -151,7 +151,7 @@ static struct dvb_usb_properties dtt200u_properties = { | |||
151 | .cold_ids = { &dtt200u_usb_table[0], NULL }, | 151 | .cold_ids = { &dtt200u_usb_table[0], NULL }, |
152 | .warm_ids = { &dtt200u_usb_table[1], NULL }, | 152 | .warm_ids = { &dtt200u_usb_table[1], NULL }, |
153 | }, | 153 | }, |
154 | { NULL }, | 154 | { 0 }, |
155 | } | 155 | } |
156 | }; | 156 | }; |
157 | 157 | ||
@@ -160,7 +160,7 @@ static struct dvb_usb_properties wt220u_properties = { | |||
160 | .pid_filter_count = 15, | 160 | .pid_filter_count = 15, |
161 | 161 | ||
162 | .usb_ctrl = CYPRESS_FX2, | 162 | .usb_ctrl = CYPRESS_FX2, |
163 | .firmware = "dvb-usb-wt220u-01.fw", | 163 | .firmware = "dvb-usb-wt220u-02.fw", |
164 | 164 | ||
165 | .power_ctrl = dtt200u_power_ctrl, | 165 | .power_ctrl = dtt200u_power_ctrl, |
166 | .streaming_ctrl = dtt200u_streaming_ctrl, | 166 | .streaming_ctrl = dtt200u_streaming_ctrl, |
@@ -192,7 +192,7 @@ static struct dvb_usb_properties wt220u_properties = { | |||
192 | .cold_ids = { &dtt200u_usb_table[2], NULL }, | 192 | .cold_ids = { &dtt200u_usb_table[2], NULL }, |
193 | .warm_ids = { &dtt200u_usb_table[3], NULL }, | 193 | .warm_ids = { &dtt200u_usb_table[3], NULL }, |
194 | }, | 194 | }, |
195 | { NULL }, | 195 | { 0 }, |
196 | } | 196 | } |
197 | }; | 197 | }; |
198 | 198 | ||
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.h b/drivers/media/dvb/dvb-usb/dtt200u.h index 6f1f3042e21a..005b0a7df358 100644 --- a/drivers/media/dvb/dvb-usb/dtt200u.h +++ b/drivers/media/dvb/dvb-usb/dtt200u.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #define _DVB_USB_DTT200U_H_ | 13 | #define _DVB_USB_DTT200U_H_ |
14 | 14 | ||
15 | #define DVB_USB_LOG_PREFIX "dtt200u" | 15 | #define DVB_USB_LOG_PREFIX "dtt200u" |
16 | |||
16 | #include "dvb-usb.h" | 17 | #include "dvb-usb.h" |
17 | 18 | ||
18 | extern int dvb_usb_dtt200u_debug; | 19 | extern int dvb_usb_dtt200u_debug; |
@@ -25,15 +26,15 @@ extern int dvb_usb_dtt200u_debug; | |||
25 | * 88 - locking 2 bytes (0x80 0x40 == no signal, 0x89 0x20 == nice signal) | 26 | * 88 - locking 2 bytes (0x80 0x40 == no signal, 0x89 0x20 == nice signal) |
26 | */ | 27 | */ |
27 | 28 | ||
28 | #define GET_SPEED 0x00 | 29 | #define GET_SPEED 0x00 |
29 | #define GET_TUNE_STATUS 0x81 | 30 | #define GET_TUNE_STATUS 0x81 |
30 | #define GET_RC_CODE 0x84 | 31 | #define GET_RC_CODE 0x84 |
31 | #define GET_CONFIGURATION 0x88 | 32 | #define GET_CONFIGURATION 0x88 |
32 | #define GET_AGC 0x89 | 33 | #define GET_AGC 0x89 |
33 | #define GET_SNR 0x8a | 34 | #define GET_SNR 0x8a |
34 | #define GET_VIT_ERR_CNT 0x8c | 35 | #define GET_VIT_ERR_CNT 0x8c |
35 | #define GET_RS_ERR_CNT 0x8d | 36 | #define GET_RS_ERR_CNT 0x8d |
36 | #define GET_RS_UNCOR_BLK_CNT 0x8e | 37 | #define GET_RS_UNCOR_BLK_CNT 0x8e |
37 | 38 | ||
38 | /* write | 39 | /* write |
39 | * 01 - init | 40 | * 01 - init |
@@ -44,12 +45,12 @@ extern int dvb_usb_dtt200u_debug; | |||
44 | * 08 - transfer switch | 45 | * 08 - transfer switch |
45 | */ | 46 | */ |
46 | 47 | ||
47 | #define SET_INIT 0x01 | 48 | #define SET_INIT 0x01 |
48 | #define SET_RF_FREQ 0x02 | 49 | #define SET_RF_FREQ 0x02 |
49 | #define SET_BANDWIDTH 0x03 | 50 | #define SET_BANDWIDTH 0x03 |
50 | #define SET_PID_FILTER 0x04 | 51 | #define SET_PID_FILTER 0x04 |
51 | #define RESET_PID_FILTER 0x05 | 52 | #define RESET_PID_FILTER 0x05 |
52 | #define SET_STREAMING 0x08 | 53 | #define SET_STREAMING 0x08 |
53 | 54 | ||
54 | extern struct dvb_frontend * dtt200u_fe_attach(struct dvb_usb_device *d); | 55 | extern struct dvb_frontend * dtt200u_fe_attach(struct dvb_usb_device *d); |
55 | 56 | ||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-common.h b/drivers/media/dvb/dvb-usb/dvb-usb-common.h index 7300489d3e24..a3460bf2d9fa 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-common.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-common.h | |||
@@ -24,7 +24,7 @@ extern int dvb_usb_disable_rc_polling; | |||
24 | #define deb_mem(args...) dprintk(dvb_usb_debug,0x80,args) | 24 | #define deb_mem(args...) dprintk(dvb_usb_debug,0x80,args) |
25 | 25 | ||
26 | /* commonly used methods */ | 26 | /* commonly used methods */ |
27 | extern int usb_cypress_load_firmware(struct usb_device *, const char *, int); | 27 | extern int dvb_usb_download_firmware(struct usb_device *, struct dvb_usb_properties *); |
28 | 28 | ||
29 | extern int dvb_usb_urb_submit(struct dvb_usb_device *); | 29 | extern int dvb_usb_urb_submit(struct dvb_usb_device *); |
30 | extern int dvb_usb_urb_kill(struct dvb_usb_device *); | 30 | extern int dvb_usb_urb_kill(struct dvb_usb_device *); |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c index 5244e39770a0..8535895819fb 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | #include "dvb-usb-common.h" | 10 | #include "dvb-usb-common.h" |
11 | 11 | ||
12 | #include <linux/firmware.h> | ||
13 | #include <linux/usb.h> | 12 | #include <linux/usb.h> |
14 | 13 | ||
15 | struct usb_cypress_controller { | 14 | struct usb_cypress_controller { |
@@ -19,9 +18,10 @@ struct usb_cypress_controller { | |||
19 | }; | 18 | }; |
20 | 19 | ||
21 | static struct usb_cypress_controller cypress[] = { | 20 | static struct usb_cypress_controller cypress[] = { |
22 | { .id = CYPRESS_AN2135, .name = "Cypress AN2135", .cpu_cs_register = 0x7f92 }, | 21 | { .id = DEVICE_SPECIFIC, .name = "Device specific", .cpu_cs_register = 0 }, |
23 | { .id = CYPRESS_AN2235, .name = "Cypress AN2235", .cpu_cs_register = 0x7f92 }, | 22 | { .id = CYPRESS_AN2135, .name = "Cypress AN2135", .cpu_cs_register = 0x7f92 }, |
24 | { .id = CYPRESS_FX2, .name = "Cypress FX2", .cpu_cs_register = 0xe600 }, | 23 | { .id = CYPRESS_AN2235, .name = "Cypress AN2235", .cpu_cs_register = 0x7f92 }, |
24 | { .id = CYPRESS_FX2, .name = "Cypress FX2", .cpu_cs_register = 0xe600 }, | ||
25 | }; | 25 | }; |
26 | 26 | ||
27 | /* | 27 | /* |
@@ -30,71 +30,117 @@ static struct usb_cypress_controller cypress[] = { | |||
30 | static int usb_cypress_writemem(struct usb_device *udev,u16 addr,u8 *data, u8 len) | 30 | static int usb_cypress_writemem(struct usb_device *udev,u16 addr,u8 *data, u8 len) |
31 | { | 31 | { |
32 | return usb_control_msg(udev, usb_sndctrlpipe(udev,0), | 32 | return usb_control_msg(udev, usb_sndctrlpipe(udev,0), |
33 | 0xa0, USB_TYPE_VENDOR, addr, 0x00, data, len, 5*HZ); | 33 | 0xa0, USB_TYPE_VENDOR, addr, 0x00, data, len, 5000); |
34 | } | 34 | } |
35 | 35 | ||
36 | int usb_cypress_load_firmware(struct usb_device *udev, const char *filename, int type) | 36 | int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type) |
37 | { | 37 | { |
38 | const struct firmware *fw = NULL; | 38 | struct hexline hx; |
39 | u16 addr; | 39 | u8 reset; |
40 | u8 *b,*p; | 40 | int ret,pos=0; |
41 | int ret = 0,i; | ||
42 | 41 | ||
43 | if ((ret = request_firmware(&fw, filename, &udev->dev)) != 0) { | 42 | /* stop the CPU */ |
44 | err("did not find the firmware file. (%s) " | 43 | reset = 1; |
45 | "Please see linux/Documentation/dvb/ for more details on firmware-problems.", | 44 | if ((ret = usb_cypress_writemem(udev,cypress[type].cpu_cs_register,&reset,1)) != 1) |
46 | filename); | 45 | err("could not stop the USB controller CPU."); |
46 | |||
47 | while ((ret = dvb_usb_get_hexline(fw,&hx,&pos)) > 0) { | ||
48 | deb_fw("writing to address 0x%04x (buffer: 0x%02x %02x)\n",hx.addr,hx.len,hx.chk); | ||
49 | ret = usb_cypress_writemem(udev,hx.addr,hx.data,hx.len); | ||
50 | |||
51 | if (ret != hx.len) { | ||
52 | err("error while transferring firmware " | ||
53 | "(transferred size: %d, block size: %d)", | ||
54 | ret,hx.len); | ||
55 | ret = -EINVAL; | ||
56 | break; | ||
57 | } | ||
58 | } | ||
59 | if (ret < 0) { | ||
60 | err("firmware download failed at %d with %d",pos,ret); | ||
47 | return ret; | 61 | return ret; |
48 | } | 62 | } |
49 | 63 | ||
50 | info("downloading firmware from file '%s' to the '%s'",filename,cypress[type].name); | 64 | if (ret == 0) { |
51 | |||
52 | p = kmalloc(fw->size,GFP_KERNEL); | ||
53 | if (p != NULL) { | ||
54 | u8 reset; | ||
55 | /* | ||
56 | * you cannot use the fw->data as buffer for | ||
57 | * usb_control_msg, a new buffer has to be | ||
58 | * created | ||
59 | */ | ||
60 | memcpy(p,fw->data,fw->size); | ||
61 | |||
62 | /* stop the CPU */ | ||
63 | reset = 1; | ||
64 | if ((ret = usb_cypress_writemem(udev,cypress[type].cpu_cs_register,&reset,1)) != 1) | ||
65 | err("could not stop the USB controller CPU."); | ||
66 | for(i = 0; p[i+3] == 0 && i < fw->size; ) { | ||
67 | b = (u8 *) &p[i]; | ||
68 | addr = cpu_to_le16( *((u16 *) &b[1]) ); | ||
69 | |||
70 | deb_fw("writing to address 0x%04x (buffer: 0x%02x%02x)\n",addr,b[1],b[2]); | ||
71 | |||
72 | ret = usb_cypress_writemem(udev,addr,&b[4],b[0]); | ||
73 | |||
74 | if (ret != b[0]) { | ||
75 | err("error while transferring firmware " | ||
76 | "(transferred size: %d, block size: %d)", | ||
77 | ret,b[0]); | ||
78 | ret = -EINVAL; | ||
79 | break; | ||
80 | } | ||
81 | i += 5 + b[0]; | ||
82 | } | ||
83 | /* length in ret */ | ||
84 | if (ret > 0) | ||
85 | ret = 0; | ||
86 | /* restart the CPU */ | 65 | /* restart the CPU */ |
87 | reset = 0; | 66 | reset = 0; |
88 | if (ret || usb_cypress_writemem(udev,cypress[type].cpu_cs_register,&reset,1) != 1) { | 67 | if (ret || usb_cypress_writemem(udev,cypress[type].cpu_cs_register,&reset,1) != 1) { |
89 | err("could not restart the USB controller CPU."); | 68 | err("could not restart the USB controller CPU."); |
90 | ret = -EINVAL; | 69 | ret = -EINVAL; |
91 | } | 70 | } |
71 | } else | ||
72 | ret = -EIO; | ||
92 | 73 | ||
93 | kfree(p); | 74 | return ret; |
94 | } else { | 75 | } |
95 | ret = -ENOMEM; | 76 | EXPORT_SYMBOL(usb_cypress_load_firmware); |
77 | |||
78 | int dvb_usb_download_firmware(struct usb_device *udev, struct dvb_usb_properties *props) | ||
79 | { | ||
80 | int ret; | ||
81 | const struct firmware *fw = NULL; | ||
82 | |||
83 | if ((ret = request_firmware(&fw, props->firmware, &udev->dev)) != 0) { | ||
84 | err("did not find the firmware file. (%s) " | ||
85 | "Please see linux/Documentation/dvb/ for more details on firmware-problems. (%d)", | ||
86 | props->firmware,ret); | ||
87 | return ret; | ||
96 | } | 88 | } |
97 | release_firmware(fw); | ||
98 | 89 | ||
90 | info("downloading firmware from file '%s'",props->firmware); | ||
91 | |||
92 | switch (props->usb_ctrl) { | ||
93 | case CYPRESS_AN2135: | ||
94 | case CYPRESS_AN2235: | ||
95 | case CYPRESS_FX2: | ||
96 | ret = usb_cypress_load_firmware(udev, fw, props->usb_ctrl); | ||
97 | break; | ||
98 | case DEVICE_SPECIFIC: | ||
99 | if (props->download_firmware) | ||
100 | ret = props->download_firmware(udev,fw); | ||
101 | else { | ||
102 | err("BUG: driver didn't specified a download_firmware-callback, although it claims to have a DEVICE_SPECIFIC one."); | ||
103 | ret = -EINVAL; | ||
104 | } | ||
105 | break; | ||
106 | default: | ||
107 | ret = -EINVAL; | ||
108 | break; | ||
109 | } | ||
110 | |||
111 | release_firmware(fw); | ||
99 | return ret; | 112 | return ret; |
100 | } | 113 | } |
114 | |||
115 | int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx, int *pos) | ||
116 | { | ||
117 | u8 *b = (u8 *) &fw->data[*pos]; | ||
118 | int data_offs = 4; | ||
119 | if (*pos >= fw->size) | ||
120 | return 0; | ||
121 | |||
122 | memset(hx,0,sizeof(struct hexline)); | ||
123 | |||
124 | hx->len = b[0]; | ||
125 | |||
126 | if ((*pos + hx->len + 4) >= fw->size) | ||
127 | return -EINVAL; | ||
128 | |||
129 | hx->addr = le16_to_cpu( *((u16 *) &b[1]) ); | ||
130 | hx->type = b[3]; | ||
131 | |||
132 | if (hx->type == 0x04) { | ||
133 | /* b[4] and b[5] are the Extended linear address record data field */ | ||
134 | hx->addr |= (b[4] << 24) | (b[5] << 16); | ||
135 | /* hx->len -= 2; | ||
136 | data_offs += 2; */ | ||
137 | } | ||
138 | memcpy(hx->data,&b[data_offs],hx->len); | ||
139 | hx->chk = b[hx->len + data_offs]; | ||
140 | |||
141 | *pos += hx->len + 5; | ||
142 | |||
143 | return *pos; | ||
144 | } | ||
145 | EXPORT_SYMBOL(dvb_usb_get_hexline); | ||
146 | |||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c index da970947dfc7..9b254532af4d 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-i2c.c | |||
@@ -52,9 +52,8 @@ int dvb_usb_pll_init_i2c(struct dvb_frontend *fe) | |||
52 | struct i2c_msg msg = { .addr = d->pll_addr, .flags = 0, .buf = d->pll_init, .len = 4 }; | 52 | struct i2c_msg msg = { .addr = d->pll_addr, .flags = 0, .buf = d->pll_init, .len = 4 }; |
53 | int ret = 0; | 53 | int ret = 0; |
54 | 54 | ||
55 | /* if there is nothing to initialize */ | 55 | /* if pll_desc is not used */ |
56 | if (d->pll_init[0] == 0x00 && d->pll_init[1] == 0x00 && | 56 | if (d->pll_desc == NULL) |
57 | d->pll_init[2] == 0x00 && d->pll_init[3] == 0x00) | ||
58 | return 0; | 57 | return 0; |
59 | 58 | ||
60 | if (d->tuner_pass_ctrl) | 59 | if (d->tuner_pass_ctrl) |
@@ -80,6 +79,9 @@ int dvb_usb_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep | |||
80 | { | 79 | { |
81 | struct dvb_usb_device *d = fe->dvb->priv; | 80 | struct dvb_usb_device *d = fe->dvb->priv; |
82 | 81 | ||
82 | if (d->pll_desc == NULL) | ||
83 | return 0; | ||
84 | |||
83 | deb_pll("pll addr: %x, freq: %d %p\n",d->pll_addr,fep->frequency,d->pll_desc); | 85 | deb_pll("pll addr: %x, freq: %d %p\n",d->pll_addr,fep->frequency,d->pll_desc); |
84 | 86 | ||
85 | b[0] = d->pll_addr << 1; | 87 | b[0] = d->pll_addr << 1; |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 6be99e537e12..d22934383226 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h | |||
@@ -86,11 +86,15 @@ | |||
86 | #define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 | 86 | #define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 |
87 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 | 87 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 |
88 | #define USB_PID_NEBULA_DIGITV 0x0201 | 88 | #define USB_PID_NEBULA_DIGITV 0x0201 |
89 | #define USB_PID_DVICO_BLUEBIRD_LGZ201 0xdb00 | ||
90 | #define USB_PID_DVICO_BLUEBIRD_TH7579 0xdb10 | ||
91 | #define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820 | 89 | #define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820 |
92 | #define USB_PID_DVICO_BLUEBIRD_LGZ201_1 0xdb01 | 90 | #define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500 |
93 | #define USB_PID_DVICO_BLUEBIRD_TH7579_2 0xdb11 | 91 | #define USB_PID_DVICO_BLUEBIRD_LG064F_WARM 0xd501 |
92 | #define USB_PID_DVICO_BLUEBIRD_LGZ201_COLD 0xdb00 | ||
93 | #define USB_PID_DVICO_BLUEBIRD_LGZ201_WARM 0xdb01 | ||
94 | #define USB_PID_DVICO_BLUEBIRD_TH7579_COLD 0xdb10 | ||
95 | #define USB_PID_DVICO_BLUEBIRD_TH7579_WARM 0xdb11 | ||
96 | #define USB_PID_DVICO_BLUEBIRD_DEE1601_COLD 0xdb50 | ||
97 | #define USB_PID_DVICO_BLUEBIRD_DEE1601_WARM 0xdb51 | ||
94 | #define USB_PID_MEDION_MD95700 0x0932 | 98 | #define USB_PID_MEDION_MD95700 0x0932 |
95 | #define USB_PID_KYE_DVB_T_COLD 0x701e | 99 | #define USB_PID_KYE_DVB_T_COLD 0x701e |
96 | #define USB_PID_KYE_DVB_T_WARM 0x701f | 100 | #define USB_PID_KYE_DVB_T_WARM 0x701f |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c index dd8e0b94edba..2e23060cbbca 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c | |||
@@ -138,6 +138,9 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties | |||
138 | 138 | ||
139 | int ret = -ENOMEM,cold=0; | 139 | int ret = -ENOMEM,cold=0; |
140 | 140 | ||
141 | if (du != NULL) | ||
142 | *du = NULL; | ||
143 | |||
141 | if ((desc = dvb_usb_find_device(udev,props,&cold)) == NULL) { | 144 | if ((desc = dvb_usb_find_device(udev,props,&cold)) == NULL) { |
142 | deb_err("something went very wrong, device was not found in current device list - let's see what comes next.\n"); | 145 | deb_err("something went very wrong, device was not found in current device list - let's see what comes next.\n"); |
143 | return -ENODEV; | 146 | return -ENODEV; |
@@ -145,38 +148,40 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties | |||
145 | 148 | ||
146 | if (cold) { | 149 | if (cold) { |
147 | info("found a '%s' in cold state, will try to load a firmware",desc->name); | 150 | info("found a '%s' in cold state, will try to load a firmware",desc->name); |
148 | ret = usb_cypress_load_firmware(udev,props->firmware,props->usb_ctrl); | 151 | ret = dvb_usb_download_firmware(udev,props); |
149 | } else { | 152 | if (!props->no_reconnect) |
150 | info("found a '%s' in warm state.",desc->name); | ||
151 | d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL); | ||
152 | if (d == NULL) { | ||
153 | err("no memory for 'struct dvb_usb_device'"); | ||
154 | return ret; | 153 | return ret; |
154 | } | ||
155 | |||
156 | info("found a '%s' in warm state.",desc->name); | ||
157 | d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL); | ||
158 | if (d == NULL) { | ||
159 | err("no memory for 'struct dvb_usb_device'"); | ||
160 | return ret; | ||
161 | } | ||
162 | memset(d,0,sizeof(struct dvb_usb_device)); | ||
163 | |||
164 | d->udev = udev; | ||
165 | memcpy(&d->props,props,sizeof(struct dvb_usb_properties)); | ||
166 | d->desc = desc; | ||
167 | d->owner = owner; | ||
168 | |||
169 | if (d->props.size_of_priv > 0) { | ||
170 | d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL); | ||
171 | if (d->priv == NULL) { | ||
172 | err("no memory for priv in 'struct dvb_usb_device'"); | ||
173 | kfree(d); | ||
174 | return -ENOMEM; | ||
155 | } | 175 | } |
156 | memset(d,0,sizeof(struct dvb_usb_device)); | 176 | memset(d->priv,0,d->props.size_of_priv); |
157 | 177 | } | |
158 | d->udev = udev; | ||
159 | memcpy(&d->props,props,sizeof(struct dvb_usb_properties)); | ||
160 | d->desc = desc; | ||
161 | d->owner = owner; | ||
162 | |||
163 | if (d->props.size_of_priv > 0) { | ||
164 | d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL); | ||
165 | if (d->priv == NULL) { | ||
166 | err("no memory for priv in 'struct dvb_usb_device'"); | ||
167 | kfree(d); | ||
168 | return -ENOMEM; | ||
169 | } | ||
170 | memset(d->priv,0,d->props.size_of_priv); | ||
171 | } | ||
172 | 178 | ||
173 | usb_set_intfdata(intf, d); | 179 | usb_set_intfdata(intf, d); |
174 | 180 | ||
175 | if (du != NULL) | 181 | if (du != NULL) |
176 | *du = d; | 182 | *du = d; |
177 | 183 | ||
178 | ret = dvb_usb_init(d); | 184 | ret = dvb_usb_init(d); |
179 | } | ||
180 | 185 | ||
181 | if (ret == 0) | 186 | if (ret == 0) |
182 | info("%s successfully initialized and connected.",desc->name); | 187 | info("%s successfully initialized and connected.",desc->name); |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index b4a1a98006c7..dd568396e594 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h | |||
@@ -10,8 +10,8 @@ | |||
10 | 10 | ||
11 | #include <linux/config.h> | 11 | #include <linux/config.h> |
12 | #include <linux/input.h> | 12 | #include <linux/input.h> |
13 | #include <linux/module.h> | ||
14 | #include <linux/usb.h> | 13 | #include <linux/usb.h> |
14 | #include <linux/firmware.h> | ||
15 | 15 | ||
16 | #include "dvb_frontend.h" | 16 | #include "dvb_frontend.h" |
17 | #include "dvb_demux.h" | 17 | #include "dvb_demux.h" |
@@ -94,7 +94,11 @@ struct dvb_usb_device; | |||
94 | * @usb_ctrl: which USB device-side controller is in use. Needed for firmware | 94 | * @usb_ctrl: which USB device-side controller is in use. Needed for firmware |
95 | * download. | 95 | * download. |
96 | * @firmware: name of the firmware file. | 96 | * @firmware: name of the firmware file. |
97 | * | 97 | * @download_firmware: called to download the firmware when the usb_ctrl is |
98 | * DEVICE_SPECIFIC. | ||
99 | * @no_reconnect: device doesn't do a reconnect after downloading the firmware, | ||
100 | so do the warm initialization right after it | ||
101 | |||
98 | * @size_of_priv: how many bytes shall be allocated for the private field | 102 | * @size_of_priv: how many bytes shall be allocated for the private field |
99 | * of struct dvb_usb_device. | 103 | * of struct dvb_usb_device. |
100 | * | 104 | * |
@@ -142,11 +146,14 @@ struct dvb_usb_properties { | |||
142 | int caps; | 146 | int caps; |
143 | int pid_filter_count; | 147 | int pid_filter_count; |
144 | 148 | ||
145 | #define CYPRESS_AN2135 0 | 149 | #define DEVICE_SPECIFIC 0 |
146 | #define CYPRESS_AN2235 1 | 150 | #define CYPRESS_AN2135 1 |
147 | #define CYPRESS_FX2 2 | 151 | #define CYPRESS_AN2235 2 |
152 | #define CYPRESS_FX2 3 | ||
148 | int usb_ctrl; | 153 | int usb_ctrl; |
149 | const char *firmware; | 154 | const char firmware[FIRMWARE_NAME_MAX]; |
155 | int (*download_firmware) (struct usb_device *, const struct firmware *); | ||
156 | int no_reconnect; | ||
150 | 157 | ||
151 | int size_of_priv; | 158 | int size_of_priv; |
152 | 159 | ||
@@ -326,5 +333,15 @@ extern int dvb_usb_pll_init_i2c(struct dvb_frontend *); | |||
326 | extern int dvb_usb_pll_set(struct dvb_frontend *, struct dvb_frontend_parameters *, u8[]); | 333 | extern int dvb_usb_pll_set(struct dvb_frontend *, struct dvb_frontend_parameters *, u8[]); |
327 | extern int dvb_usb_pll_set_i2c(struct dvb_frontend *, struct dvb_frontend_parameters *); | 334 | extern int dvb_usb_pll_set_i2c(struct dvb_frontend *, struct dvb_frontend_parameters *); |
328 | 335 | ||
336 | /* commonly used firmware download types and function */ | ||
337 | struct hexline { | ||
338 | u8 len; | ||
339 | u32 addr; | ||
340 | u8 type; | ||
341 | u8 data[255]; | ||
342 | u8 chk; | ||
343 | }; | ||
344 | extern int dvb_usb_get_hexline(const struct firmware *, struct hexline *, int *); | ||
345 | extern int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type); | ||
329 | 346 | ||
330 | #endif | 347 | #endif |
diff --git a/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/drivers/media/dvb/dvb-usb/nova-t-usb2.c index fac48fc7a4ac..412039d8dbae 100644 --- a/drivers/media/dvb/dvb-usb/nova-t-usb2.c +++ b/drivers/media/dvb/dvb-usb/nova-t-usb2.c | |||
@@ -129,10 +129,6 @@ static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6]) | |||
129 | dibusb_read_eeprom_byte(d,i, &b); | 129 | dibusb_read_eeprom_byte(d,i, &b); |
130 | 130 | ||
131 | mac[5 - (i - 136)] = b; | 131 | mac[5 - (i - 136)] = b; |
132 | |||
133 | /* deb_ee("%02x ",b); | ||
134 | if ((i+1) % 16 == 0) | ||
135 | deb_ee("\n");*/ | ||
136 | } | 132 | } |
137 | 133 | ||
138 | return 0; | 134 | return 0; |
@@ -153,7 +149,7 @@ static struct usb_device_id nova_t_table [] = { | |||
153 | /* 01 */ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_WINTV_NOVA_T_USB2_WARM) }, | 149 | /* 01 */ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_WINTV_NOVA_T_USB2_WARM) }, |
154 | { } /* Terminating entry */ | 150 | { } /* Terminating entry */ |
155 | }; | 151 | }; |
156 | MODULE_DEVICE_TABLE (usb, nova_t_table); | 152 | MODULE_DEVICE_TABLE(usb, nova_t_table); |
157 | 153 | ||
158 | static struct dvb_usb_properties nova_t_properties = { | 154 | static struct dvb_usb_properties nova_t_properties = { |
159 | .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_IS_AN_I2C_ADAPTER, | 155 | .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_PID_FILTER_CAN_BE_TURNED_OFF | DVB_USB_IS_AN_I2C_ADAPTER, |
@@ -198,6 +194,7 @@ static struct dvb_usb_properties nova_t_properties = { | |||
198 | { &nova_t_table[0], NULL }, | 194 | { &nova_t_table[0], NULL }, |
199 | { &nova_t_table[1], NULL }, | 195 | { &nova_t_table[1], NULL }, |
200 | }, | 196 | }, |
197 | { NULL }, | ||
201 | } | 198 | } |
202 | }; | 199 | }; |
203 | 200 | ||
diff --git a/drivers/media/dvb/dvb-usb/vp702x-fe.c b/drivers/media/dvb/dvb-usb/vp702x-fe.c index 104b5d016c7b..0885d9fb2bf2 100644 --- a/drivers/media/dvb/dvb-usb/vp702x-fe.c +++ b/drivers/media/dvb/dvb-usb/vp702x-fe.c | |||
@@ -190,7 +190,7 @@ static int vp702x_fe_get_frontend(struct dvb_frontend* fe, | |||
190 | } | 190 | } |
191 | 191 | ||
192 | static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe, | 192 | static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe, |
193 | struct dvb_diseqc_master_cmd *m) | 193 | struct dvb_diseqc_master_cmd *m) |
194 | { | 194 | { |
195 | struct vp702x_fe_state *st = fe->demodulator_priv; | 195 | struct vp702x_fe_state *st = fe->demodulator_priv; |
196 | u8 cmd[8],ibuf[10]; | 196 | u8 cmd[8],ibuf[10]; |
diff --git a/drivers/media/dvb/dvb-usb/vp702x.h b/drivers/media/dvb/dvb-usb/vp702x.h index 4a3e8c7eca2b..a808d48e7bf2 100644 --- a/drivers/media/dvb/dvb-usb/vp702x.h +++ b/drivers/media/dvb/dvb-usb/vp702x.h | |||
@@ -13,47 +13,47 @@ extern int dvb_usb_vp702x_debug; | |||
13 | /* commands are read and written with USB control messages */ | 13 | /* commands are read and written with USB control messages */ |
14 | 14 | ||
15 | /* consecutive read/write operation */ | 15 | /* consecutive read/write operation */ |
16 | #define REQUEST_OUT 0xB2 | 16 | #define REQUEST_OUT 0xB2 |
17 | #define REQUEST_IN 0xB3 | 17 | #define REQUEST_IN 0xB3 |
18 | 18 | ||
19 | /* the out-buffer of these consecutive operations contain sub-commands when b[0] = 0 | 19 | /* the out-buffer of these consecutive operations contain sub-commands when b[0] = 0 |
20 | * request: 0xB2; i: 0; v: 0; b[0] = 0, b[1] = subcmd, additional buffer | 20 | * request: 0xB2; i: 0; v: 0; b[0] = 0, b[1] = subcmd, additional buffer |
21 | * the returning buffer looks as follows | 21 | * the returning buffer looks as follows |
22 | * request: 0xB3; i: 0; v: 0; b[0] = 0xB3, additional buffer */ | 22 | * request: 0xB3; i: 0; v: 0; b[0] = 0xB3, additional buffer */ |
23 | 23 | ||
24 | #define GET_TUNER_STATUS 0x05 | 24 | #define GET_TUNER_STATUS 0x05 |
25 | /* additional in buffer: | 25 | /* additional in buffer: |
26 | * 0 1 2 3 4 5 6 7 8 | 26 | * 0 1 2 3 4 5 6 7 8 |
27 | * N/A N/A 0x05 signal-quality N/A N/A signal-strength lock==0 N/A */ | 27 | * N/A N/A 0x05 signal-quality N/A N/A signal-strength lock==0 N/A */ |
28 | 28 | ||
29 | #define GET_SYSTEM_STRING 0x06 | 29 | #define GET_SYSTEM_STRING 0x06 |
30 | /* additional in buffer: | 30 | /* additional in buffer: |
31 | * 0 1 2 3 4 5 6 7 8 | 31 | * 0 1 2 3 4 5 6 7 8 |
32 | * N/A 'U' 'S' 'B' '7' '0' '2' 'X' N/A */ | 32 | * N/A 'U' 'S' 'B' '7' '0' '2' 'X' N/A */ |
33 | 33 | ||
34 | #define SET_DISEQC_CMD 0x08 | 34 | #define SET_DISEQC_CMD 0x08 |
35 | /* additional out buffer: | 35 | /* additional out buffer: |
36 | * 0 1 2 3 4 | 36 | * 0 1 2 3 4 |
37 | * len X1 X2 X3 X4 | 37 | * len X1 X2 X3 X4 |
38 | * additional in buffer: | 38 | * additional in buffer: |
39 | * 0 1 2 | 39 | * 0 1 2 |
40 | * N/A 0 0 b[1] == b[2] == 0 -> success otherwise not */ | 40 | * N/A 0 0 b[1] == b[2] == 0 -> success, failure otherwise */ |
41 | 41 | ||
42 | #define SET_LNB_POWER 0x09 | 42 | #define SET_LNB_POWER 0x09 |
43 | /* additional out buffer: | 43 | /* additional out buffer: |
44 | * 0 1 2 | 44 | * 0 1 2 |
45 | * 0x00 0xff 1 = on, 0 = off | 45 | * 0x00 0xff 1 = on, 0 = off |
46 | * additional in buffer: | 46 | * additional in buffer: |
47 | * 0 1 2 | 47 | * 0 1 2 |
48 | * N/A 0 0 b[1] == b[2] == 0 -> success otherwise not */ | 48 | * N/A 0 0 b[1] == b[2] == 0 -> success failure otherwise */ |
49 | 49 | ||
50 | #define GET_MAC_ADDRESS 0x0A | 50 | #define GET_MAC_ADDRESS 0x0A |
51 | /* #define GET_MAC_ADDRESS 0x0B */ | 51 | /* #define GET_MAC_ADDRESS 0x0B */ |
52 | /* additional in buffer: | 52 | /* additional in buffer: |
53 | * 0 1 2 3 4 5 6 7 8 | 53 | * 0 1 2 3 4 5 6 7 8 |
54 | * N/A N/A 0x0A or 0x0B MAC0 MAC1 MAC2 MAC3 MAC4 MAC5 */ | 54 | * N/A N/A 0x0A or 0x0B MAC0 MAC1 MAC2 MAC3 MAC4 MAC5 */ |
55 | 55 | ||
56 | #define SET_PID_FILTER 0x11 | 56 | #define SET_PID_FILTER 0x11 |
57 | /* additional in buffer: | 57 | /* additional in buffer: |
58 | * 0 1 ... 14 15 16 | 58 | * 0 1 ... 14 15 16 |
59 | * PID0_MSB PID0_LSB ... PID7_MSB PID7_LSB PID_active (bits) */ | 59 | * PID0_MSB PID0_LSB ... PID7_MSB PID7_LSB PID_active (bits) */ |
@@ -64,39 +64,38 @@ extern int dvb_usb_vp702x_debug; | |||
64 | * freq0 freq1 divstep srate0 srate1 srate2 flag chksum | 64 | * freq0 freq1 divstep srate0 srate1 srate2 flag chksum |
65 | */ | 65 | */ |
66 | 66 | ||
67 | |||
68 | /* one direction requests */ | 67 | /* one direction requests */ |
69 | #define READ_REMOTE_REQ 0xB4 | 68 | #define READ_REMOTE_REQ 0xB4 |
70 | /* IN i: 0; v: 0; b[0] == request, b[1] == key */ | 69 | /* IN i: 0; v: 0; b[0] == request, b[1] == key */ |
71 | 70 | ||
72 | #define READ_PID_NUMBER_REQ 0xB5 | 71 | #define READ_PID_NUMBER_REQ 0xB5 |
73 | /* IN i: 0; v: 0; b[0] == request, b[1] == 0, b[2] = pid number */ | 72 | /* IN i: 0; v: 0; b[0] == request, b[1] == 0, b[2] = pid number */ |
74 | 73 | ||
75 | #define WRITE_EEPROM_REQ 0xB6 | 74 | #define WRITE_EEPROM_REQ 0xB6 |
76 | /* OUT i: offset; v: value to write; no extra buffer */ | 75 | /* OUT i: offset; v: value to write; no extra buffer */ |
77 | 76 | ||
78 | #define READ_EEPROM_REQ 0xB7 | 77 | #define READ_EEPROM_REQ 0xB7 |
79 | /* IN i: bufferlen; v: offset; buffer with bufferlen bytes */ | 78 | /* IN i: bufferlen; v: offset; buffer with bufferlen bytes */ |
80 | 79 | ||
81 | #define READ_STATUS 0xB8 | 80 | #define READ_STATUS 0xB8 |
82 | /* IN i: 0; v: 0; bufferlen 10 */ | 81 | /* IN i: 0; v: 0; bufferlen 10 */ |
83 | 82 | ||
84 | #define READ_TUNER_REG_REQ 0xB9 | 83 | #define READ_TUNER_REG_REQ 0xB9 |
85 | /* IN i: 0; v: register; b[0] = value */ | 84 | /* IN i: 0; v: register; b[0] = value */ |
86 | 85 | ||
87 | #define READ_FX2_REG_REQ 0xBA | 86 | #define READ_FX2_REG_REQ 0xBA |
88 | /* IN i: offset; v: 0; b[0] = value */ | 87 | /* IN i: offset; v: 0; b[0] = value */ |
89 | 88 | ||
90 | #define WRITE_FX2_REG_REQ 0xBB | 89 | #define WRITE_FX2_REG_REQ 0xBB |
91 | /* OUT i: offset; v: value to write; 1 byte extra buffer */ | 90 | /* OUT i: offset; v: value to write; 1 byte extra buffer */ |
92 | 91 | ||
93 | #define SET_TUNER_POWER_REQ 0xBC | 92 | #define SET_TUNER_POWER_REQ 0xBC |
94 | /* IN i: 0 = power off, 1 = power on */ | 93 | /* IN i: 0 = power off, 1 = power on */ |
95 | 94 | ||
96 | #define WRITE_TUNER_REG_REQ 0xBD | 95 | #define WRITE_TUNER_REG_REQ 0xBD |
97 | /* IN i: register, v: value to write, no extra buffer */ | 96 | /* IN i: register, v: value to write, no extra buffer */ |
98 | 97 | ||
99 | #define RESET_TUNER 0xBE | 98 | #define RESET_TUNER 0xBE |
100 | /* IN i: 0, v: 0, no extra buffer */ | 99 | /* IN i: 0, v: 0, no extra buffer */ |
101 | 100 | ||
102 | extern struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d); | 101 | extern struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d); |
diff --git a/drivers/media/dvb/dvb-usb/vp7045.c b/drivers/media/dvb/dvb-usb/vp7045.c index 3835235b68df..028204956bb0 100644 --- a/drivers/media/dvb/dvb-usb/vp7045.c +++ b/drivers/media/dvb/dvb-usb/vp7045.c | |||
@@ -247,7 +247,7 @@ static struct dvb_usb_properties vp7045_properties = { | |||
247 | .cold_ids = { &vp7045_usb_table[2], NULL }, | 247 | .cold_ids = { &vp7045_usb_table[2], NULL }, |
248 | .warm_ids = { &vp7045_usb_table[3], NULL }, | 248 | .warm_ids = { &vp7045_usb_table[3], NULL }, |
249 | }, | 249 | }, |
250 | { NULL }, | 250 | { 0 }, |
251 | } | 251 | } |
252 | }; | 252 | }; |
253 | 253 | ||