aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/b2c2/flexcop.c6
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.c3
-rw-r--r--drivers/media/dvb/dvb-core/dvb_ca_en50221.c8
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c3
-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
-rw-r--r--drivers/media/dvb/frontends/bcm3510.c3
-rw-r--r--drivers/media/dvb/frontends/dib3000mb.c3
-rw-r--r--drivers/media/dvb/frontends/dib3000mc.c3
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c17
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.h1
-rw-r--r--drivers/media/dvb/frontends/lgdt330x.c3
-rw-r--r--drivers/media/dvb/frontends/mt352.c3
-rw-r--r--drivers/media/dvb/frontends/nxt200x.c3
-rw-r--r--drivers/media/dvb/pluto2/pluto2.c3
-rw-r--r--drivers/media/dvb/ttpci/av7110.c4
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c129
-rw-r--r--drivers/media/dvb/ttpci/budget.h1
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c4
-rw-r--r--drivers/media/dvb/ttusb-dec/ttusb_dec.c4
25 files changed, 321 insertions, 58 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop.c b/drivers/media/dvb/b2c2/flexcop.c
index 123ed96f6faa..56ba52470676 100644
--- a/drivers/media/dvb/b2c2/flexcop.c
+++ b/drivers/media/dvb/b2c2/flexcop.c
@@ -220,20 +220,18 @@ EXPORT_SYMBOL(flexcop_reset_block_300);
220struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len) 220struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len)
221{ 221{
222 void *bus; 222 void *bus;
223 struct flexcop_device *fc = kmalloc(sizeof(struct flexcop_device), GFP_KERNEL); 223 struct flexcop_device *fc = kzalloc(sizeof(struct flexcop_device), GFP_KERNEL);
224 if (!fc) { 224 if (!fc) {
225 err("no memory"); 225 err("no memory");
226 return NULL; 226 return NULL;
227 } 227 }
228 memset(fc, 0, sizeof(struct flexcop_device));
229 228
230 bus = kmalloc(bus_specific_len, GFP_KERNEL); 229 bus = kzalloc(bus_specific_len, GFP_KERNEL);
231 if (!bus) { 230 if (!bus) {
232 err("no memory"); 231 err("no memory");
233 kfree(fc); 232 kfree(fc);
234 return NULL; 233 return NULL;
235 } 234 }
236 memset(bus, 0, bus_specific_len);
237 235
238 fc->bus_specific = bus; 236 fc->bus_specific = bus;
239 237
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 01b4e0aac049..f65f64b00ff3 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -786,10 +786,9 @@ static int dvb_bt8xx_probe(struct device *dev)
786 struct pci_dev* bttv_pci_dev; 786 struct pci_dev* bttv_pci_dev;
787 int ret; 787 int ret;
788 788
789 if (!(card = kmalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL))) 789 if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL)))
790 return -ENOMEM; 790 return -ENOMEM;
791 791
792 memset(card, 0, sizeof(*card));
793 init_MUTEX(&card->lock); 792 init_MUTEX(&card->lock);
794 card->bttv_nr = sub->core->nr; 793 card->bttv_nr = sub->core->nr;
795 strncpy(card->card_name, sub->core->name, sizeof(sub->core->name)); 794 strncpy(card->card_name, sub->core->name, sizeof(sub->core->name));
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
index 4bb779aeff6a..00347a750681 100644
--- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
@@ -1649,21 +1649,17 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
1649 return -EINVAL; 1649 return -EINVAL;
1650 1650
1651 /* initialise the system data */ 1651 /* initialise the system data */
1652 if ((ca = 1652 if ((ca = kzalloc(sizeof(struct dvb_ca_private), GFP_KERNEL)) == NULL) {
1653 (struct dvb_ca_private *) kmalloc(sizeof(struct dvb_ca_private),
1654 GFP_KERNEL)) == NULL) {
1655 ret = -ENOMEM; 1653 ret = -ENOMEM;
1656 goto error; 1654 goto error;
1657 } 1655 }
1658 memset(ca, 0, sizeof(struct dvb_ca_private));
1659 ca->pub = pubca; 1656 ca->pub = pubca;
1660 ca->flags = flags; 1657 ca->flags = flags;
1661 ca->slot_count = slot_count; 1658 ca->slot_count = slot_count;
1662 if ((ca->slot_info = kmalloc(sizeof(struct dvb_ca_slot) * slot_count, GFP_KERNEL)) == NULL) { 1659 if ((ca->slot_info = kcalloc(slot_count, sizeof(struct dvb_ca_slot), GFP_KERNEL)) == NULL) {
1663 ret = -ENOMEM; 1660 ret = -ENOMEM;
1664 goto error; 1661 goto error;
1665 } 1662 }
1666 memset(ca->slot_info, 0, sizeof(struct dvb_ca_slot) * slot_count);
1667 init_waitqueue_head(&ca->wait_queue); 1663 init_waitqueue_head(&ca->wait_queue);
1668 ca->thread_pid = 0; 1664 ca->thread_pid = 0;
1669 init_waitqueue_head(&ca->thread_queue); 1665 init_waitqueue_head(&ca->thread_queue);
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 4a08c4ab6730..771f32d889e6 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1024,13 +1024,12 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
1024 if (down_interruptible (&frontend_mutex)) 1024 if (down_interruptible (&frontend_mutex))
1025 return -ERESTARTSYS; 1025 return -ERESTARTSYS;
1026 1026
1027 fe->frontend_priv = kmalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL); 1027 fe->frontend_priv = kzalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL);
1028 if (fe->frontend_priv == NULL) { 1028 if (fe->frontend_priv == NULL) {
1029 up(&frontend_mutex); 1029 up(&frontend_mutex);
1030 return -ENOMEM; 1030 return -ENOMEM;
1031 } 1031 }
1032 fepriv = fe->frontend_priv; 1032 fepriv = fe->frontend_priv;
1033 memset(fe->frontend_priv, 0, sizeof(struct dvb_frontend_private));
1034 1033
1035 init_MUTEX (&fepriv->sem); 1034 init_MUTEX (&fepriv->sem);
1036 init_waitqueue_head (&fepriv->wait_queue); 1035 init_waitqueue_head (&fepriv->wait_queue);
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;
diff --git a/drivers/media/dvb/frontends/bcm3510.c b/drivers/media/dvb/frontends/bcm3510.c
index 3b132bafd4de..caaee893ca76 100644
--- a/drivers/media/dvb/frontends/bcm3510.c
+++ b/drivers/media/dvb/frontends/bcm3510.c
@@ -782,10 +782,9 @@ struct dvb_frontend* bcm3510_attach(const struct bcm3510_config *config,
782 bcm3510_register_value v; 782 bcm3510_register_value v;
783 783
784 /* allocate memory for the internal state */ 784 /* allocate memory for the internal state */
785 state = kmalloc(sizeof(struct bcm3510_state), GFP_KERNEL); 785 state = kzalloc(sizeof(struct bcm3510_state), GFP_KERNEL);
786 if (state == NULL) 786 if (state == NULL)
787 goto error; 787 goto error;
788 memset(state,0,sizeof(struct bcm3510_state));
789 788
790 /* setup the state */ 789 /* setup the state */
791 790
diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c
index 6b0553608610..ae589adb1c0a 100644
--- a/drivers/media/dvb/frontends/dib3000mb.c
+++ b/drivers/media/dvb/frontends/dib3000mb.c
@@ -700,10 +700,9 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
700 struct dib3000_state* state = NULL; 700 struct dib3000_state* state = NULL;
701 701
702 /* allocate memory for the internal state */ 702 /* allocate memory for the internal state */
703 state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL); 703 state = kzalloc(sizeof(struct dib3000_state), GFP_KERNEL);
704 if (state == NULL) 704 if (state == NULL)
705 goto error; 705 goto error;
706 memset(state,0,sizeof(struct dib3000_state));
707 706
708 /* setup the state */ 707 /* setup the state */
709 state->i2c = i2c; 708 state->i2c = i2c;
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c
index c024fad17337..3b303dbb6156 100644
--- a/drivers/media/dvb/frontends/dib3000mc.c
+++ b/drivers/media/dvb/frontends/dib3000mc.c
@@ -832,10 +832,9 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config,
832 u16 devid; 832 u16 devid;
833 833
834 /* allocate memory for the internal state */ 834 /* allocate memory for the internal state */
835 state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL); 835 state = kzalloc(sizeof(struct dib3000_state), GFP_KERNEL);
836 if (state == NULL) 836 if (state == NULL)
837 goto error; 837 goto error;
838 memset(state,0,sizeof(struct dib3000_state));
839 838
840 /* setup the state */ 839 /* setup the state */
841 state->i2c = i2c; 840 state->i2c = i2c;
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index a3d57ce9dd12..757075f007c1 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -345,6 +345,23 @@ struct dvb_pll_desc dvb_pll_tbmv30111in = {
345}; 345};
346EXPORT_SYMBOL(dvb_pll_tbmv30111in); 346EXPORT_SYMBOL(dvb_pll_tbmv30111in);
347 347
348/*
349 * Philips SD1878 Tuner.
350 */
351struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261 = {
352 .name = "Philips SD1878",
353 .min = 950000,
354 .max = 2150000,
355 .count = 4,
356 .entries = {
357 { 1250000, 499, 500, 0xc4, 0x00},
358 { 1550000, 499, 500, 0xc4, 0x40},
359 { 2050000, 499, 500, 0xc4, 0x80},
360 { 2150000, 499, 500, 0xc4, 0xc0},
361 },
362};
363EXPORT_SYMBOL(dvb_pll_philips_sd1878_tda8261);
364
348/* ----------------------------------------------------------- */ 365/* ----------------------------------------------------------- */
349/* code */ 366/* code */
350 367
diff --git a/drivers/media/dvb/frontends/dvb-pll.h b/drivers/media/dvb/frontends/dvb-pll.h
index 24d4d2e9acd8..f682c09189b3 100644
--- a/drivers/media/dvb/frontends/dvb-pll.h
+++ b/drivers/media/dvb/frontends/dvb-pll.h
@@ -39,6 +39,7 @@ extern struct dvb_pll_desc dvb_pll_tded4;
39extern struct dvb_pll_desc dvb_pll_tuv1236d; 39extern struct dvb_pll_desc dvb_pll_tuv1236d;
40extern struct dvb_pll_desc dvb_pll_tdhu2; 40extern struct dvb_pll_desc dvb_pll_tdhu2;
41extern struct dvb_pll_desc dvb_pll_tbmv30111in; 41extern struct dvb_pll_desc dvb_pll_tbmv30111in;
42extern struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261;
42 43
43int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf, 44int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
44 u32 freq, int bandwidth); 45 u32 freq, int bandwidth);
diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c
index 9d214643b87a..4691ac54bc1d 100644
--- a/drivers/media/dvb/frontends/lgdt330x.c
+++ b/drivers/media/dvb/frontends/lgdt330x.c
@@ -714,10 +714,9 @@ struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config,
714 u8 buf[1]; 714 u8 buf[1];
715 715
716 /* Allocate memory for the internal state */ 716 /* Allocate memory for the internal state */
717 state = (struct lgdt330x_state*) kmalloc(sizeof(struct lgdt330x_state), GFP_KERNEL); 717 state = kzalloc(sizeof(struct lgdt330x_state), GFP_KERNEL);
718 if (state == NULL) 718 if (state == NULL)
719 goto error; 719 goto error;
720 memset(state,0,sizeof(*state));
721 720
722 /* Setup the state */ 721 /* Setup the state */
723 state->config = config; 722 state->config = config;
diff --git a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c
index f0c610f2c2df..aaaec909ddf8 100644
--- a/drivers/media/dvb/frontends/mt352.c
+++ b/drivers/media/dvb/frontends/mt352.c
@@ -535,9 +535,8 @@ struct dvb_frontend* mt352_attach(const struct mt352_config* config,
535 struct mt352_state* state = NULL; 535 struct mt352_state* state = NULL;
536 536
537 /* allocate memory for the internal state */ 537 /* allocate memory for the internal state */
538 state = kmalloc(sizeof(struct mt352_state), GFP_KERNEL); 538 state = kzalloc(sizeof(struct mt352_state), GFP_KERNEL);
539 if (state == NULL) goto error; 539 if (state == NULL) goto error;
540 memset(state,0,sizeof(*state));
541 540
542 /* setup the state */ 541 /* setup the state */
543 state->i2c = i2c; 542 state->i2c = i2c;
diff --git a/drivers/media/dvb/frontends/nxt200x.c b/drivers/media/dvb/frontends/nxt200x.c
index aeafef46e3eb..78d2b93d35b9 100644
--- a/drivers/media/dvb/frontends/nxt200x.c
+++ b/drivers/media/dvb/frontends/nxt200x.c
@@ -1110,10 +1110,9 @@ struct dvb_frontend* nxt200x_attach(const struct nxt200x_config* config,
1110 u8 buf [] = {0,0,0,0,0}; 1110 u8 buf [] = {0,0,0,0,0};
1111 1111
1112 /* allocate memory for the internal state */ 1112 /* allocate memory for the internal state */
1113 state = (struct nxt200x_state*) kmalloc(sizeof(struct nxt200x_state), GFP_KERNEL); 1113 state = kzalloc(sizeof(struct nxt200x_state), GFP_KERNEL);
1114 if (state == NULL) 1114 if (state == NULL)
1115 goto error; 1115 goto error;
1116 memset(state,0,sizeof(*state));
1117 1116
1118 /* setup the state */ 1117 /* setup the state */
1119 state->config = config; 1118 state->config = config;
diff --git a/drivers/media/dvb/pluto2/pluto2.c b/drivers/media/dvb/pluto2/pluto2.c
index bbebd1c4caca..1c5316e209ef 100644
--- a/drivers/media/dvb/pluto2/pluto2.c
+++ b/drivers/media/dvb/pluto2/pluto2.c
@@ -584,11 +584,10 @@ static int __devinit pluto2_probe(struct pci_dev *pdev,
584 struct dmx_demux *dmx; 584 struct dmx_demux *dmx;
585 int ret = -ENOMEM; 585 int ret = -ENOMEM;
586 586
587 pluto = kmalloc(sizeof(struct pluto), GFP_KERNEL); 587 pluto = kzalloc(sizeof(struct pluto), GFP_KERNEL);
588 if (!pluto) 588 if (!pluto)
589 goto out; 589 goto out;
590 590
591 memset(pluto, 0, sizeof(struct pluto));
592 pluto->pdev = pdev; 591 pluto->pdev = pdev;
593 592
594 ret = pci_enable_device(pdev); 593 ret = pci_enable_device(pdev);
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index 8ce4146f55f1..327a8089193b 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -2565,14 +2565,12 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
2565 } 2565 }
2566 2566
2567 /* prepare the av7110 device struct */ 2567 /* prepare the av7110 device struct */
2568 av7110 = kmalloc(sizeof(struct av7110), GFP_KERNEL); 2568 av7110 = kzalloc(sizeof(struct av7110), GFP_KERNEL);
2569 if (!av7110) { 2569 if (!av7110) {
2570 dprintk(1, "out of memory\n"); 2570 dprintk(1, "out of memory\n");
2571 return -ENOMEM; 2571 return -ENOMEM;
2572 } 2572 }
2573 2573
2574 memset(av7110, 0, sizeof(struct av7110));
2575
2576 av7110->card_name = (char*) pci_ext->ext_priv; 2574 av7110->card_name = (char*) pci_ext->ext_priv;
2577 av7110->dev = dev; 2575 av7110->dev = dev;
2578 dev->ext_priv = av7110; 2576 dev->ext_priv = av7110;
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index f9d00452e639..1465c04e49aa 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -37,6 +37,7 @@
37#include "stv0299.h" 37#include "stv0299.h"
38#include "tda10021.h" 38#include "tda10021.h"
39#include "tda1004x.h" 39#include "tda1004x.h"
40#include "dvb-pll.h"
40#include <media/saa7146_vv.h> 41#include <media/saa7146_vv.h>
41#include <linux/module.h> 42#include <linux/module.h>
42#include <linux/errno.h> 43#include <linux/errno.h>
@@ -864,8 +865,117 @@ static struct tda1004x_config philips_tu1216_config = {
864 .request_firmware = philips_tu1216_request_firmware, 865 .request_firmware = philips_tu1216_request_firmware,
865}; 866};
866 867
868static u8 philips_sd1878_inittab[] = {
869 0x01, 0x15,
870 0x02, 0x30,
871 0x03, 0x00,
872 0x04, 0x7d,
873 0x05, 0x35,
874 0x06, 0x40,
875 0x07, 0x00,
876 0x08, 0x43,
877 0x09, 0x02,
878 0x0C, 0x51,
879 0x0D, 0x82,
880 0x0E, 0x23,
881 0x10, 0x3f,
882 0x11, 0x84,
883 0x12, 0xb9,
884 0x15, 0xc9,
885 0x16, 0x19,
886 0x17, 0x8c,
887 0x18, 0x59,
888 0x19, 0xf8,
889 0x1a, 0xfe,
890 0x1c, 0x7f,
891 0x1d, 0x00,
892 0x1e, 0x00,
893 0x1f, 0x50,
894 0x20, 0x00,
895 0x21, 0x00,
896 0x22, 0x00,
897 0x23, 0x00,
898 0x28, 0x00,
899 0x29, 0x28,
900 0x2a, 0x14,
901 0x2b, 0x0f,
902 0x2c, 0x09,
903 0x2d, 0x09,
904 0x31, 0x1f,
905 0x32, 0x19,
906 0x33, 0xfc,
907 0x34, 0x93,
908 0xff, 0xff
909};
910
911static int philips_sd1878_tda8261_pll_set(struct dvb_frontend *fe,
912 struct i2c_adapter *i2c,
913 struct dvb_frontend_parameters *params)
914{
915 u8 buf[4];
916 int rc;
917 struct i2c_msg tuner_msg = {.addr=0x60,.flags=0,.buf=buf,.len=sizeof(buf)};
918
919 if((params->frequency < 950000) || (params->frequency > 2150000))
920 return -EINVAL;
921
922 rc=dvb_pll_configure(&dvb_pll_philips_sd1878_tda8261, buf,
923 params->frequency, 0);
924 if(rc < 0) return rc;
925
926 if(i2c_transfer(i2c, &tuner_msg, 1) != 1)
927 return -EIO;
928
929 return 0;
930}
931
932static int philips_sd1878_ci_set_symbol_rate(struct dvb_frontend *fe,
933 u32 srate, u32 ratio)
934{
935 u8 aclk = 0;
936 u8 bclk = 0;
937 u8 m1;
938
939 aclk = 0xb5;
940 if (srate < 2000000)
941 bclk = 0x86;
942 else if (srate < 5000000)
943 bclk = 0x89;
944 else if (srate < 15000000)
945 bclk = 0x8f;
946 else if (srate < 45000000)
947 bclk = 0x95;
948
949 m1 = 0x14;
950 if (srate < 4000000)
951 m1 = 0x10;
952
953 stv0299_writereg(fe, 0x0e, 0x23);
954 stv0299_writereg(fe, 0x0f, 0x94);
955 stv0299_writereg(fe, 0x10, 0x39);
956 stv0299_writereg(fe, 0x13, aclk);
957 stv0299_writereg(fe, 0x14, bclk);
958 stv0299_writereg(fe, 0x15, 0xc9);
959 stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
960 stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff);
961 stv0299_writereg(fe, 0x21, (ratio) & 0xf0);
962 stv0299_writereg(fe, 0x0f, 0x80 | m1);
867 963
964 return 0;
965}
868 966
967static struct stv0299_config philips_sd1878_config = {
968 .demod_address = 0x68,
969 .inittab = philips_sd1878_inittab,
970 .mclk = 88000000UL,
971 .invert = 0,
972 .skip_reinit = 0,
973 .lock_output = STV0229_LOCKOUTPUT_1,
974 .volt13_op0_op1 = STV0299_VOLT13_OP0,
975 .min_delay_ms = 100,
976 .set_symbol_rate = philips_sd1878_ci_set_symbol_rate,
977 .pll_set = philips_sd1878_tda8261_pll_set,
978};
869 979
870static u8 read_pwm(struct budget_av *budget_av) 980static u8 read_pwm(struct budget_av *budget_av)
871{ 981{
@@ -886,7 +996,10 @@ static u8 read_pwm(struct budget_av *budget_av)
886#define SUBID_DVBS_KNC1_PLUS 0x0011 996#define SUBID_DVBS_KNC1_PLUS 0x0011
887#define SUBID_DVBS_TYPHOON 0x4f56 997#define SUBID_DVBS_TYPHOON 0x4f56
888#define SUBID_DVBS_CINERGY1200 0x1154 998#define SUBID_DVBS_CINERGY1200 0x1154
999#define SUBID_DVBS_CYNERGY1200N 0x1155
889 1000
1001#define SUBID_DVBS_TV_STAR 0x0014
1002#define SUBID_DVBS_TV_STAR_CI 0x0016
890#define SUBID_DVBC_KNC1 0x0020 1003#define SUBID_DVBC_KNC1 0x0020
891#define SUBID_DVBC_KNC1_PLUS 0x0021 1004#define SUBID_DVBC_KNC1_PLUS 0x0021
892#define SUBID_DVBC_CINERGY1200 0x1156 1005#define SUBID_DVBC_CINERGY1200 0x1156
@@ -922,6 +1035,13 @@ static void frontend_init(struct budget_av *budget_av)
922 } 1035 }
923 break; 1036 break;
924 1037
1038 case SUBID_DVBS_TV_STAR:
1039 case SUBID_DVBS_TV_STAR_CI:
1040 case SUBID_DVBS_CYNERGY1200N:
1041 fe = stv0299_attach(&philips_sd1878_config,
1042 &budget_av->budget.i2c_adap);
1043 break;
1044
925 case SUBID_DVBS_KNC1_PLUS: 1045 case SUBID_DVBS_KNC1_PLUS:
926 case SUBID_DVBS_TYPHOON: 1046 case SUBID_DVBS_TYPHOON:
927 fe = stv0299_attach(&typhoon_config, 1047 fe = stv0299_attach(&typhoon_config,
@@ -1027,11 +1147,9 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio
1027 1147
1028 dprintk(2, "dev: %p\n", dev); 1148 dprintk(2, "dev: %p\n", dev);
1029 1149
1030 if (!(budget_av = kmalloc(sizeof(struct budget_av), GFP_KERNEL))) 1150 if (!(budget_av = kzalloc(sizeof(struct budget_av), GFP_KERNEL)))
1031 return -ENOMEM; 1151 return -ENOMEM;
1032 1152
1033 memset(budget_av, 0, sizeof(struct budget_av));
1034
1035 budget_av->has_saa7113 = 0; 1153 budget_av->has_saa7113 = 0;
1036 budget_av->budget.ci_present = 0; 1154 budget_av->budget.ci_present = 0;
1037 1155
@@ -1166,10 +1284,12 @@ static struct saa7146_extension budget_extension;
1166MAKE_BUDGET_INFO(knc1s, "KNC1 DVB-S", BUDGET_KNC1S); 1284MAKE_BUDGET_INFO(knc1s, "KNC1 DVB-S", BUDGET_KNC1S);
1167MAKE_BUDGET_INFO(knc1c, "KNC1 DVB-C", BUDGET_KNC1C); 1285MAKE_BUDGET_INFO(knc1c, "KNC1 DVB-C", BUDGET_KNC1C);
1168MAKE_BUDGET_INFO(knc1t, "KNC1 DVB-T", BUDGET_KNC1T); 1286MAKE_BUDGET_INFO(knc1t, "KNC1 DVB-T", BUDGET_KNC1T);
1287MAKE_BUDGET_INFO(kncxs, "KNC TV STAR DVB-S", BUDGET_TVSTAR);
1169MAKE_BUDGET_INFO(knc1sp, "KNC1 DVB-S Plus", BUDGET_KNC1SP); 1288MAKE_BUDGET_INFO(knc1sp, "KNC1 DVB-S Plus", BUDGET_KNC1SP);
1170MAKE_BUDGET_INFO(knc1cp, "KNC1 DVB-C Plus", BUDGET_KNC1CP); 1289MAKE_BUDGET_INFO(knc1cp, "KNC1 DVB-C Plus", BUDGET_KNC1CP);
1171MAKE_BUDGET_INFO(knc1tp, "KNC1 DVB-T Plus", BUDGET_KNC1TP); 1290MAKE_BUDGET_INFO(knc1tp, "KNC1 DVB-T Plus", BUDGET_KNC1TP);
1172MAKE_BUDGET_INFO(cin1200s, "TerraTec Cinergy 1200 DVB-S", BUDGET_CIN1200S); 1291MAKE_BUDGET_INFO(cin1200s, "TerraTec Cinergy 1200 DVB-S", BUDGET_CIN1200S);
1292MAKE_BUDGET_INFO(cin1200sn, "TerraTec Cinergy 1200 DVB-S", BUDGET_CIN1200S);
1173MAKE_BUDGET_INFO(cin1200c, "Terratec Cinergy 1200 DVB-C", BUDGET_CIN1200C); 1293MAKE_BUDGET_INFO(cin1200c, "Terratec Cinergy 1200 DVB-C", BUDGET_CIN1200C);
1174MAKE_BUDGET_INFO(cin1200t, "Terratec Cinergy 1200 DVB-T", BUDGET_CIN1200T); 1294MAKE_BUDGET_INFO(cin1200t, "Terratec Cinergy 1200 DVB-T", BUDGET_CIN1200T);
1175 1295
@@ -1178,11 +1298,14 @@ static struct pci_device_id pci_tbl[] = {
1178 MAKE_EXTENSION_PCI(knc1s, 0x1131, 0x0010), 1298 MAKE_EXTENSION_PCI(knc1s, 0x1131, 0x0010),
1179 MAKE_EXTENSION_PCI(knc1s, 0x1894, 0x0010), 1299 MAKE_EXTENSION_PCI(knc1s, 0x1894, 0x0010),
1180 MAKE_EXTENSION_PCI(knc1sp, 0x1131, 0x0011), 1300 MAKE_EXTENSION_PCI(knc1sp, 0x1131, 0x0011),
1301 MAKE_EXTENSION_PCI(kncxs, 0x1894, 0x0014),
1302 MAKE_EXTENSION_PCI(kncxs, 0x1894, 0x0016),
1181 MAKE_EXTENSION_PCI(knc1c, 0x1894, 0x0020), 1303 MAKE_EXTENSION_PCI(knc1c, 0x1894, 0x0020),
1182 MAKE_EXTENSION_PCI(knc1cp, 0x1894, 0x0021), 1304 MAKE_EXTENSION_PCI(knc1cp, 0x1894, 0x0021),
1183 MAKE_EXTENSION_PCI(knc1t, 0x1894, 0x0030), 1305 MAKE_EXTENSION_PCI(knc1t, 0x1894, 0x0030),
1184 MAKE_EXTENSION_PCI(knc1tp, 0x1894, 0x0031), 1306 MAKE_EXTENSION_PCI(knc1tp, 0x1894, 0x0031),
1185 MAKE_EXTENSION_PCI(cin1200s, 0x153b, 0x1154), 1307 MAKE_EXTENSION_PCI(cin1200s, 0x153b, 0x1154),
1308 MAKE_EXTENSION_PCI(cin1200sn, 0x153b, 0x1155),
1186 MAKE_EXTENSION_PCI(cin1200c, 0x153b, 0x1156), 1309 MAKE_EXTENSION_PCI(cin1200c, 0x153b, 0x1156),
1187 MAKE_EXTENSION_PCI(cin1200t, 0x153b, 0x1157), 1310 MAKE_EXTENSION_PCI(cin1200t, 0x153b, 0x1157),
1188 { 1311 {
diff --git a/drivers/media/dvb/ttpci/budget.h b/drivers/media/dvb/ttpci/budget.h
index c8d48cfba277..c7bb63c4d98d 100644
--- a/drivers/media/dvb/ttpci/budget.h
+++ b/drivers/media/dvb/ttpci/budget.h
@@ -95,6 +95,7 @@ static struct saa7146_pci_extension_data x_var = { \
95#define BUDGET_KNC1SP 11 95#define BUDGET_KNC1SP 11
96#define BUDGET_KNC1CP 12 96#define BUDGET_KNC1CP 12
97#define BUDGET_KNC1TP 13 97#define BUDGET_KNC1TP 13
98#define BUDGET_TVSTAR 14
98 99
99#define BUDGET_VIDEO_PORTA 0 100#define BUDGET_VIDEO_PORTA 0
100#define BUDGET_VIDEO_PORTB 1 101#define BUDGET_VIDEO_PORTB 1
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 104df610dbe1..5a13c4744f61 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -1489,11 +1489,9 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
1489 1489
1490 if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV; 1490 if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV;
1491 1491
1492 if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL))) 1492 if (!(ttusb = kzalloc(sizeof(struct ttusb), GFP_KERNEL)))
1493 return -ENOMEM; 1493 return -ENOMEM;
1494 1494
1495 memset(ttusb, 0, sizeof(struct ttusb));
1496
1497 ttusb->dev = udev; 1495 ttusb->dev = udev;
1498 ttusb->c = 0; 1496 ttusb->c = 0;
1499 ttusb->mux_state = 0; 1497 ttusb->mux_state = 0;
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index d8966d1d25ee..df831171e03c 100644
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -1606,15 +1606,13 @@ static int ttusb_dec_probe(struct usb_interface *intf,
1606 1606
1607 udev = interface_to_usbdev(intf); 1607 udev = interface_to_usbdev(intf);
1608 1608
1609 if (!(dec = kmalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) { 1609 if (!(dec = kzalloc(sizeof(struct ttusb_dec), GFP_KERNEL))) {
1610 printk("%s: couldn't allocate memory.\n", __FUNCTION__); 1610 printk("%s: couldn't allocate memory.\n", __FUNCTION__);
1611 return -ENOMEM; 1611 return -ENOMEM;
1612 } 1612 }
1613 1613
1614 usb_set_intfdata(intf, (void *)dec); 1614 usb_set_intfdata(intf, (void *)dec);
1615 1615
1616 memset(dec, 0, sizeof(struct ttusb_dec));
1617
1618 switch (le16_to_cpu(id->idProduct)) { 1616 switch (le16_to_cpu(id->idProduct)) {
1619 case 0x1006: 1617 case 0x1006:
1620 ttusb_dec_set_model(dec, TTUSB_DEC3000S); 1618 ttusb_dec_set_model(dec, TTUSB_DEC3000S);