aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c152
-rw-r--r--drivers/media/dvb/dvb-usb/dtt200u-fe.c3
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-ids.h2
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-init.c6
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-urb.c9
-rw-r--r--drivers/media/dvb/dvb-usb/vp702x-fe.c3
-rw-r--r--drivers/media/dvb/dvb-usb/vp7045-fe.c3
7 files changed, 160 insertions, 18 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index 358ed153865f..18d169836c9c 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -253,6 +253,26 @@ static int cxusb_dee1601_demod_init(struct dvb_frontend* fe)
253 return 0; 253 return 0;
254} 254}
255 255
256static int cxusb_mt352_demod_init(struct dvb_frontend* fe)
257{ /* used in both lgz201 and th7579 */
258 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 };
259 static u8 reset [] = { RESET, 0x80 };
260 static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
261 static u8 agc_cfg [] = { AGC_TARGET, 0x24, 0x20 };
262 static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
263 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
264
265 mt352_write(fe, clock_config, sizeof(clock_config));
266 udelay(200);
267 mt352_write(fe, reset, sizeof(reset));
268 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
269
270 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
271 mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
272 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
273 return 0;
274}
275
256struct cx22702_config cxusb_cx22702_config = { 276struct cx22702_config cxusb_cx22702_config = {
257 .demod_address = 0x63, 277 .demod_address = 0x63,
258 278
@@ -274,6 +294,13 @@ struct mt352_config cxusb_dee1601_config = {
274 .pll_set = dvb_usb_pll_set, 294 .pll_set = dvb_usb_pll_set,
275}; 295};
276 296
297struct mt352_config cxusb_mt352_config = {
298 /* used in both lgz201 and th7579 */
299 .demod_address = 0x0f,
300 .demod_init = cxusb_mt352_demod_init,
301 .pll_set = dvb_usb_pll_set,
302};
303
277/* Callbacks for DVB USB */ 304/* Callbacks for DVB USB */
278static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d) 305static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d)
279{ 306{
@@ -302,6 +329,20 @@ static int cxusb_dee1601_tuner_attach(struct dvb_usb_device *d)
302 return 0; 329 return 0;
303} 330}
304 331
332static int cxusb_lgz201_tuner_attach(struct dvb_usb_device *d)
333{
334 d->pll_addr = 0x61;
335 d->pll_desc = &dvb_pll_lg_z201;
336 return 0;
337}
338
339static int cxusb_dtt7579_tuner_attach(struct dvb_usb_device *d)
340{
341 d->pll_addr = 0x60;
342 d->pll_desc = &dvb_pll_thomson_dtt7579;
343 return 0;
344}
345
305static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) 346static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d)
306{ 347{
307 u8 b; 348 u8 b;
@@ -329,6 +370,19 @@ static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d)
329 return -EIO; 370 return -EIO;
330} 371}
331 372
373static int cxusb_mt352_frontend_attach(struct dvb_usb_device *d)
374{ /* used in both lgz201 and th7579 */
375 if (usb_set_interface(d->udev,0,0) < 0)
376 err("set interface failed");
377
378 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
379
380 if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL)
381 return 0;
382
383 return -EIO;
384}
385
332static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d) 386static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d)
333{ 387{
334 if (usb_set_interface(d->udev,0,0) < 0) 388 if (usb_set_interface(d->udev,0,0) < 0)
@@ -370,13 +424,17 @@ static int bluebird_patch_dvico_firmware_download(struct usb_device *udev, const
370static struct dvb_usb_properties cxusb_medion_properties; 424static struct dvb_usb_properties cxusb_medion_properties;
371static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties; 425static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties;
372static struct dvb_usb_properties cxusb_bluebird_dee1601_properties; 426static struct dvb_usb_properties cxusb_bluebird_dee1601_properties;
427static struct dvb_usb_properties cxusb_bluebird_lgz201_properties;
428static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties;
373 429
374static int cxusb_probe(struct usb_interface *intf, 430static int cxusb_probe(struct usb_interface *intf,
375 const struct usb_device_id *id) 431 const struct usb_device_id *id)
376{ 432{
377 if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 || 433 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 || 434 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) { 435 dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 ||
436 dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 ||
437 dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0) {
380 return 0; 438 return 0;
381 } 439 }
382 440
@@ -389,6 +447,12 @@ static struct usb_device_id cxusb_table [] = {
389 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) }, 447 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) },
390 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) }, 448 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) },
391 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) }, 449 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) },
450 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_COLD) },
451 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_WARM) },
452 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_COLD) },
453 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_WARM) },
454 { USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_COLD) },
455 { USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_WARM) },
392 {} /* Terminating entry */ 456 {} /* Terminating entry */
393}; 457};
394MODULE_DEVICE_TABLE (usb, cxusb_table); 458MODULE_DEVICE_TABLE (usb, cxusb_table);
@@ -505,12 +569,96 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
505 } 569 }
506 }, 570 },
507 571
508 .num_device_descs = 1, 572 .num_device_descs = 2,
509 .devices = { 573 .devices = {
510 { "DViCO FusionHDTV DVB-T Dual USB", 574 { "DViCO FusionHDTV DVB-T Dual USB",
511 { &cxusb_table[3], NULL }, 575 { &cxusb_table[3], NULL },
512 { &cxusb_table[4], NULL }, 576 { &cxusb_table[4], NULL },
513 }, 577 },
578 { "DigitalNow DVB-T Dual USB",
579 { &cxusb_table[9], NULL },
580 { &cxusb_table[10], NULL },
581 },
582 }
583};
584
585static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = {
586 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
587
588 .usb_ctrl = DEVICE_SPECIFIC,
589 .firmware = "dvb-usb-bluebird-01.fw",
590 .download_firmware = bluebird_patch_dvico_firmware_download,
591 /* use usb alt setting 0 for EP4 transfer (dvb-t),
592 use usb alt setting 7 for EP2 transfer (atsc) */
593
594 .size_of_priv = sizeof(struct cxusb_state),
595
596 .streaming_ctrl = cxusb_streaming_ctrl,
597 .power_ctrl = cxusb_power_ctrl,
598 .frontend_attach = cxusb_mt352_frontend_attach,
599 .tuner_attach = cxusb_lgz201_tuner_attach,
600
601 .i2c_algo = &cxusb_i2c_algo,
602
603 .generic_bulk_ctrl_endpoint = 0x01,
604 /* parameter for the MPEG2-data transfer */
605 .urb = {
606 .type = DVB_USB_BULK,
607 .count = 5,
608 .endpoint = 0x04,
609 .u = {
610 .bulk = {
611 .buffersize = 8192,
612 }
613 }
614 },
615
616 .num_device_descs = 1,
617 .devices = {
618 { "DViCO FusionHDTV DVB-T USB (LGZ201)",
619 { &cxusb_table[5], NULL },
620 { &cxusb_table[6], NULL },
621 },
622 }
623};
624
625static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = {
626 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
627
628 .usb_ctrl = DEVICE_SPECIFIC,
629 .firmware = "dvb-usb-bluebird-01.fw",
630 .download_firmware = bluebird_patch_dvico_firmware_download,
631 /* use usb alt setting 0 for EP4 transfer (dvb-t),
632 use usb alt setting 7 for EP2 transfer (atsc) */
633
634 .size_of_priv = sizeof(struct cxusb_state),
635
636 .streaming_ctrl = cxusb_streaming_ctrl,
637 .power_ctrl = cxusb_power_ctrl,
638 .frontend_attach = cxusb_mt352_frontend_attach,
639 .tuner_attach = cxusb_dtt7579_tuner_attach,
640
641 .i2c_algo = &cxusb_i2c_algo,
642
643 .generic_bulk_ctrl_endpoint = 0x01,
644 /* parameter for the MPEG2-data transfer */
645 .urb = {
646 .type = DVB_USB_BULK,
647 .count = 5,
648 .endpoint = 0x04,
649 .u = {
650 .bulk = {
651 .buffersize = 8192,
652 }
653 }
654 },
655
656 .num_device_descs = 1,
657 .devices = {
658 { "DViCO FusionHDTV DVB-T USB (TH7579)",
659 { &cxusb_table[7], NULL },
660 { &cxusb_table[8], NULL },
661 },
514 } 662 }
515}; 663};
516 664
diff --git a/drivers/media/dvb/dvb-usb/dtt200u-fe.c b/drivers/media/dvb/dvb-usb/dtt200u-fe.c
index 0a94ec22aeb8..cd21ddbfd054 100644
--- a/drivers/media/dvb/dvb-usb/dtt200u-fe.c
+++ b/drivers/media/dvb/dvb-usb/dtt200u-fe.c
@@ -156,10 +156,9 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d)
156 struct dtt200u_fe_state* state = NULL; 156 struct dtt200u_fe_state* state = NULL;
157 157
158 /* allocate memory for the internal state */ 158 /* allocate memory for the internal state */
159 state = (struct dtt200u_fe_state*) kmalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL); 159 state = kzalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL);
160 if (state == NULL) 160 if (state == NULL)
161 goto error; 161 goto error;
162 memset(state,0,sizeof(struct dtt200u_fe_state));
163 162
164 deb_info("attaching frontend dtt200u\n"); 163 deb_info("attaching frontend dtt200u\n");
165 164
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index d22934383226..4a1b9e77e339 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -95,6 +95,8 @@
95#define USB_PID_DVICO_BLUEBIRD_TH7579_WARM 0xdb11 95#define USB_PID_DVICO_BLUEBIRD_TH7579_WARM 0xdb11
96#define USB_PID_DVICO_BLUEBIRD_DEE1601_COLD 0xdb50 96#define USB_PID_DVICO_BLUEBIRD_DEE1601_COLD 0xdb50
97#define USB_PID_DVICO_BLUEBIRD_DEE1601_WARM 0xdb51 97#define USB_PID_DVICO_BLUEBIRD_DEE1601_WARM 0xdb51
98#define USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_COLD 0xdb54
99#define USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_WARM 0xdb55
98#define USB_PID_MEDION_MD95700 0x0932 100#define USB_PID_MEDION_MD95700 0x0932
99#define USB_PID_KYE_DVB_T_COLD 0x701e 101#define USB_PID_KYE_DVB_T_COLD 0x701e
100#define USB_PID_KYE_DVB_T_WARM 0x701f 102#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 2e23060cbbca..716f8bf528cd 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
@@ -154,12 +154,11 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties
154 } 154 }
155 155
156 info("found a '%s' in warm state.",desc->name); 156 info("found a '%s' in warm state.",desc->name);
157 d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL); 157 d = kzalloc(sizeof(struct dvb_usb_device),GFP_KERNEL);
158 if (d == NULL) { 158 if (d == NULL) {
159 err("no memory for 'struct dvb_usb_device'"); 159 err("no memory for 'struct dvb_usb_device'");
160 return ret; 160 return ret;
161 } 161 }
162 memset(d,0,sizeof(struct dvb_usb_device));
163 162
164 d->udev = udev; 163 d->udev = udev;
165 memcpy(&d->props,props,sizeof(struct dvb_usb_properties)); 164 memcpy(&d->props,props,sizeof(struct dvb_usb_properties));
@@ -167,13 +166,12 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties
167 d->owner = owner; 166 d->owner = owner;
168 167
169 if (d->props.size_of_priv > 0) { 168 if (d->props.size_of_priv > 0) {
170 d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL); 169 d->priv = kzalloc(d->props.size_of_priv,GFP_KERNEL);
171 if (d->priv == NULL) { 170 if (d->priv == NULL) {
172 err("no memory for priv in 'struct dvb_usb_device'"); 171 err("no memory for priv in 'struct dvb_usb_device'");
173 kfree(d); 172 kfree(d);
174 return -ENOMEM; 173 return -ENOMEM;
175 } 174 }
176 memset(d->priv,0,d->props.size_of_priv);
177 } 175 }
178 176
179 usb_set_intfdata(intf, d); 177 usb_set_intfdata(intf, d);
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c
index 36b7048c02d2..ee821974dc60 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c
@@ -175,15 +175,13 @@ static int dvb_usb_allocate_stream_buffers(struct dvb_usb_device *d, int num, un
175 175
176 deb_mem("all in all I will use %lu bytes for streaming\n",num*size); 176 deb_mem("all in all I will use %lu bytes for streaming\n",num*size);
177 177
178 if ((d->buf_list = kmalloc(num*sizeof(u8 *), GFP_ATOMIC)) == NULL) 178 if ((d->buf_list = kcalloc(num, sizeof(u8 *), GFP_ATOMIC)) == NULL)
179 return -ENOMEM; 179 return -ENOMEM;
180 180
181 if ((d->dma_addr = kmalloc(num*sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) { 181 if ((d->dma_addr = kcalloc(num, sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) {
182 kfree(d->buf_list); 182 kfree(d->buf_list);
183 return -ENOMEM; 183 return -ENOMEM;
184 } 184 }
185 memset(d->buf_list,0,num*sizeof(u8 *));
186 memset(d->dma_addr,0,num*sizeof(dma_addr_t));
187 185
188 d->state |= DVB_USB_STATE_URB_BUF; 186 d->state |= DVB_USB_STATE_URB_BUF;
189 187
@@ -285,10 +283,9 @@ int dvb_usb_urb_init(struct dvb_usb_device *d)
285 usb_clear_halt(d->udev,usb_rcvbulkpipe(d->udev,d->props.urb.endpoint)); 283 usb_clear_halt(d->udev,usb_rcvbulkpipe(d->udev,d->props.urb.endpoint));
286 284
287 /* allocate the array for the data transfer URBs */ 285 /* allocate the array for the data transfer URBs */
288 d->urb_list = kmalloc(d->props.urb.count * sizeof(struct urb *),GFP_KERNEL); 286 d->urb_list = kzalloc(d->props.urb.count * sizeof(struct urb *),GFP_KERNEL);
289 if (d->urb_list == NULL) 287 if (d->urb_list == NULL)
290 return -ENOMEM; 288 return -ENOMEM;
291 memset(d->urb_list,0,d->props.urb.count * sizeof(struct urb *));
292 d->state |= DVB_USB_STATE_URB_LIST; 289 d->state |= DVB_USB_STATE_URB_LIST;
293 290
294 switch (d->props.urb.type) { 291 switch (d->props.urb.type) {
diff --git a/drivers/media/dvb/dvb-usb/vp702x-fe.c b/drivers/media/dvb/dvb-usb/vp702x-fe.c
index 0885d9fb2bf2..b6d95e1c9c52 100644
--- a/drivers/media/dvb/dvb-usb/vp702x-fe.c
+++ b/drivers/media/dvb/dvb-usb/vp702x-fe.c
@@ -281,10 +281,9 @@ static struct dvb_frontend_ops vp702x_fe_ops;
281 281
282struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d) 282struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d)
283{ 283{
284 struct vp702x_fe_state *s = kmalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL); 284 struct vp702x_fe_state *s = kzalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL);
285 if (s == NULL) 285 if (s == NULL)
286 goto error; 286 goto error;
287 memset(s,0,sizeof(struct vp702x_fe_state));
288 287
289 s->d = d; 288 s->d = d;
290 s->fe.ops = &vp702x_fe_ops; 289 s->fe.ops = &vp702x_fe_ops;
diff --git a/drivers/media/dvb/dvb-usb/vp7045-fe.c b/drivers/media/dvb/dvb-usb/vp7045-fe.c
index 83f1de1e7e57..5242cca5db4a 100644
--- a/drivers/media/dvb/dvb-usb/vp7045-fe.c
+++ b/drivers/media/dvb/dvb-usb/vp7045-fe.c
@@ -145,10 +145,9 @@ static struct dvb_frontend_ops vp7045_fe_ops;
145 145
146struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d) 146struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d)
147{ 147{
148 struct vp7045_fe_state *s = kmalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL); 148 struct vp7045_fe_state *s = kzalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL);
149 if (s == NULL) 149 if (s == NULL)
150 goto error; 150 goto error;
151 memset(s,0,sizeof(struct vp7045_fe_state));
152 151
153 s->d = d; 152 s->d = d;
154 s->fe.ops = &vp7045_fe_ops; 153 s->fe.ops = &vp7045_fe_ops;