aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/cxusb.c
diff options
context:
space:
mode:
authorChris Pascoe <c.pascoe@itee.uq.edu.au>2006-01-09 15:21:28 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-09 15:21:28 -0500
commit0029ee143d66ca89d0e8b074abb452cf4ca2c53c (patch)
tree6d87e987682ba3b5f4d3d135d5aeb15c22a622a7 /drivers/media/dvb/dvb-usb/cxusb.c
parent0602fbb2c84ffea1b06ae8e677662074620f01d7 (diff)
V4L/DVB (3310): DViCO Dual Digital DVB-T / USB bluebird updates
- Add support for the USB portion of the DViCO Dual Digital board. Patch correct "warm" USB IDs into bluebird firmware before download. Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/cxusb.c')
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c95
1 files changed, 94 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 2c1b1e5992a3..9622a79d6e68 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -26,6 +26,8 @@
26 26
27#include "cx22702.h" 27#include "cx22702.h"
28#include "lgdt330x.h" 28#include "lgdt330x.h"
29#include "mt352.h"
30#include "mt352_priv.h"
29 31
30/* debug */ 32/* debug */
31int dvb_usb_cxusb_debug; 33int dvb_usb_cxusb_debug;
@@ -157,6 +159,27 @@ static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff)
157 return 0; 159 return 0;
158} 160}
159 161
162static int cxusb_dee1601_demod_init(struct dvb_frontend* fe)
163{
164 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x38 };
165 static u8 reset [] = { RESET, 0x80 };
166 static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
167 static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0x20 };
168 static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
169 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
170
171 mt352_write(fe, clock_config, sizeof(clock_config));
172 udelay(200);
173 mt352_write(fe, reset, sizeof(reset));
174 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
175
176 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
177 mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
178 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
179
180 return 0;
181}
182
160struct cx22702_config cxusb_cx22702_config = { 183struct cx22702_config cxusb_cx22702_config = {
161 .demod_address = 0x63, 184 .demod_address = 0x63,
162 185
@@ -172,6 +195,12 @@ struct lgdt330x_config cxusb_lgdt330x_config = {
172 .pll_set = dvb_usb_pll_set_i2c, 195 .pll_set = dvb_usb_pll_set_i2c,
173}; 196};
174 197
198struct mt352_config cxusb_dee1601_config = {
199 .demod_address = 0x0f,
200 .demod_init = cxusb_dee1601_demod_init,
201 .pll_set = dvb_usb_pll_set,
202};
203
175/* Callbacks for DVB USB */ 204/* Callbacks for DVB USB */
176static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d) 205static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d)
177{ 206{
@@ -193,6 +222,13 @@ static int cxusb_lgh064f_tuner_attach(struct dvb_usb_device *d)
193 return 0; 222 return 0;
194} 223}
195 224
225static int cxusb_dee1601_tuner_attach(struct dvb_usb_device *d)
226{
227 d->pll_addr = 0x61;
228 d->pll_desc = &dvb_pll_thomson_dtt7579;
229 return 0;
230}
231
196static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) 232static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d)
197{ 233{
198 u8 b; 234 u8 b;
@@ -220,15 +256,31 @@ static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d)
220 return -EIO; 256 return -EIO;
221} 257}
222 258
259static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d)
260{
261 if (usb_set_interface(d->udev,0,0) < 0)
262 err("set interface failed");
263
264 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
265
266 if ((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL)
267 return 0;
268
269 return -EIO;
270}
271
223/* DVB USB Driver stuff */ 272/* DVB USB Driver stuff */
224static struct dvb_usb_properties cxusb_medion_properties; 273static struct dvb_usb_properties cxusb_medion_properties;
225static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties; 274static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties;
275static struct dvb_usb_properties cxusb_bluebird_dee1601_properties;
226 276
227static int cxusb_probe(struct usb_interface *intf, 277static int cxusb_probe(struct usb_interface *intf,
228 const struct usb_device_id *id) 278 const struct usb_device_id *id)
229{ 279{
230 if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 || 280 if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 ||
231 dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0) { 281 dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 ||
282 dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0
283 ){
232 return 0; 284 return 0;
233 } 285 }
234 286
@@ -239,6 +291,8 @@ static struct usb_device_id cxusb_table [] = {
239 { USB_DEVICE(USB_VID_MEDION, USB_PID_MEDION_MD95700) }, 291 { USB_DEVICE(USB_VID_MEDION, USB_PID_MEDION_MD95700) },
240 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_COLD) }, 292 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_COLD) },
241 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) }, 293 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) },
294 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) },
295 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) },
242 {} /* Terminating entry */ 296 {} /* Terminating entry */
243}; 297};
244MODULE_DEVICE_TABLE (usb, cxusb_table); 298MODULE_DEVICE_TABLE (usb, cxusb_table);
@@ -318,6 +372,45 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = {
318 } 372 }
319}; 373};
320 374
375static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
376 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
377
378 .usb_ctrl = CYPRESS_FX2,
379 .firmware = "dvb-usb-bluebird-01.fw",
380 /* use usb alt setting 0 for EP4 transfer (dvb-t),
381 use usb alt setting 7 for EP2 transfer (atsc) */
382
383 .size_of_priv = sizeof(struct cxusb_state),
384
385 .streaming_ctrl = cxusb_streaming_ctrl,
386 .power_ctrl = cxusb_power_ctrl,
387 .frontend_attach = cxusb_dee1601_frontend_attach,
388 .tuner_attach = cxusb_dee1601_tuner_attach,
389
390 .i2c_algo = &cxusb_i2c_algo,
391
392 .generic_bulk_ctrl_endpoint = 0x01,
393 /* parameter for the MPEG2-data transfer */
394 .urb = {
395 .type = DVB_USB_BULK,
396 .count = 5,
397 .endpoint = 0x04,
398 .u = {
399 .bulk = {
400 .buffersize = 8192,
401 }
402 }
403 },
404
405 .num_device_descs = 1,
406 .devices = {
407 { "DViCO FusionHDTV DVB-T Dual USB",
408 { &cxusb_table[3], NULL },
409 { &cxusb_table[4], NULL },
410 },
411 }
412};
413
321static struct usb_driver cxusb_driver = { 414static struct usb_driver cxusb_driver = {
322 .name = "dvb_usb_cxusb", 415 .name = "dvb_usb_cxusb",
323 .probe = cxusb_probe, 416 .probe = cxusb_probe,