aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor M. Liplianin <liplianin@me.by>2011-02-25 16:41:22 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-21 19:32:23 -0400
commit195288da53e03c35f97df8fa08f48f5b625bfb4e (patch)
treef694f49959eec5b5a70ad372e1d416d6ab331c17
parentfeb16e9833ad06ac00f23c1abf1e7d649192e3f5 (diff)
[media] dw2102: use separate firmwares for Prof 1100, TeVii S630, S660
Before this patch we can use only one card type from list due to sharing one firmware name. Now it's fixed. Also driver tries to attach only appropriate demod for this cards. Signed-off-by: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/dvb-usb/dw2102.c72
1 files changed, 58 insertions, 14 deletions
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c
index 21be0cca3c89..f9affdd12d91 100644
--- a/drivers/media/dvb/dvb-usb/dw2102.c
+++ b/drivers/media/dvb/dvb-usb/dw2102.c
@@ -886,7 +886,7 @@ static int dw3101_frontend_attach(struct dvb_usb_adapter *d)
886 return -EIO; 886 return -EIO;
887} 887}
888 888
889static int s6x0_frontend_attach(struct dvb_usb_adapter *d) 889static int zl100313_frontend_attach(struct dvb_usb_adapter *d)
890{ 890{
891 d->fe = dvb_attach(mt312_attach, &zl313_config, 891 d->fe = dvb_attach(mt312_attach, &zl313_config,
892 &d->dev->i2c_adap); 892 &d->dev->i2c_adap);
@@ -899,6 +899,11 @@ static int s6x0_frontend_attach(struct dvb_usb_adapter *d)
899 } 899 }
900 } 900 }
901 901
902 return -EIO;
903}
904
905static int stv0288_frontend_attach(struct dvb_usb_adapter *d)
906{
902 d->fe = dvb_attach(stv0288_attach, &earda_config, 907 d->fe = dvb_attach(stv0288_attach, &earda_config,
903 &d->dev->i2c_adap); 908 &d->dev->i2c_adap);
904 if (d->fe != NULL) { 909 if (d->fe != NULL) {
@@ -910,6 +915,11 @@ static int s6x0_frontend_attach(struct dvb_usb_adapter *d)
910 } 915 }
911 } 916 }
912 917
918 return -EIO;
919}
920
921static int ds3000_frontend_attach(struct dvb_usb_adapter *d)
922{
913 d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config, 923 d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
914 &d->dev->i2c_adap); 924 &d->dev->i2c_adap);
915 if (d->fe != NULL) { 925 if (d->fe != NULL) {
@@ -1418,7 +1428,7 @@ static struct dvb_usb_device_properties s6x0_properties = {
1418 .read_mac_address = s6x0_read_mac_address, 1428 .read_mac_address = s6x0_read_mac_address,
1419 .adapter = { 1429 .adapter = {
1420 { 1430 {
1421 .frontend_attach = s6x0_frontend_attach, 1431 .frontend_attach = zl100313_frontend_attach,
1422 .streaming_ctrl = NULL, 1432 .streaming_ctrl = NULL,
1423 .tuner_attach = NULL, 1433 .tuner_attach = NULL,
1424 .stream = { 1434 .stream = {
@@ -1433,23 +1443,29 @@ static struct dvb_usb_device_properties s6x0_properties = {
1433 }, 1443 },
1434 } 1444 }
1435 }, 1445 },
1436 .num_device_descs = 3, 1446 .num_device_descs = 1,
1437 .devices = { 1447 .devices = {
1438 {"TeVii S630 USB", 1448 {"TeVii S630 USB",
1439 {&dw2102_table[6], NULL}, 1449 {&dw2102_table[6], NULL},
1440 {NULL}, 1450 {NULL},
1441 }, 1451 },
1442 {"Prof 1100 USB ",
1443 {&dw2102_table[7], NULL},
1444 {NULL},
1445 },
1446 {"TeVii S660 USB",
1447 {&dw2102_table[8], NULL},
1448 {NULL},
1449 },
1450 } 1452 }
1451}; 1453};
1452 1454
1455struct dvb_usb_device_properties *p1100;
1456static struct dvb_usb_device_description d1100 = {
1457 "Prof 1100 USB ",
1458 {&dw2102_table[7], NULL},
1459 {NULL},
1460};
1461
1462struct dvb_usb_device_properties *s660;
1463static struct dvb_usb_device_description d660 = {
1464 "TeVii S660 USB",
1465 {&dw2102_table[8], NULL},
1466 {NULL},
1467};
1468
1453struct dvb_usb_device_properties *p7500; 1469struct dvb_usb_device_properties *p7500;
1454static struct dvb_usb_device_description d7500 = { 1470static struct dvb_usb_device_description d7500 = {
1455 "Prof 7500 USB DVB-S2", 1471 "Prof 7500 USB DVB-S2",
@@ -1460,14 +1476,38 @@ static struct dvb_usb_device_description d7500 = {
1460static int dw2102_probe(struct usb_interface *intf, 1476static int dw2102_probe(struct usb_interface *intf,
1461 const struct usb_device_id *id) 1477 const struct usb_device_id *id)
1462{ 1478{
1479 p1100 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
1480 if (!p1100)
1481 return -ENOMEM;
1482 /* copy default structure */
1483 memcpy(p1100, &s6x0_properties,
1484 sizeof(struct dvb_usb_device_properties));
1485 /* fill only different fields */
1486 p1100->firmware = "dvb-usb-p1100.fw";
1487 p1100->devices[0] = d1100;
1488 p1100->rc.legacy.rc_map_table = rc_map_tbs_table;
1489 p1100->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table);
1490 p1100->adapter->frontend_attach = stv0288_frontend_attach;
1491
1492 s660 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
1493 if (!s660) {
1494 kfree(p1100);
1495 return -ENOMEM;
1496 }
1497 memcpy(s660, &s6x0_properties,
1498 sizeof(struct dvb_usb_device_properties));
1499 s660->firmware = "dvb-usb-s660.fw";
1500 s660->devices[0] = d660;
1501 s660->adapter->frontend_attach = ds3000_frontend_attach;
1463 1502
1464 p7500 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL); 1503 p7500 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
1465 if (!p7500) 1504 if (!p7500) {
1505 kfree(p1100);
1506 kfree(s660);
1466 return -ENOMEM; 1507 return -ENOMEM;
1467 /* copy default structure */ 1508 }
1468 memcpy(p7500, &s6x0_properties, 1509 memcpy(p7500, &s6x0_properties,
1469 sizeof(struct dvb_usb_device_properties)); 1510 sizeof(struct dvb_usb_device_properties));
1470 /* fill only different fields */
1471 p7500->firmware = "dvb-usb-p7500.fw"; 1511 p7500->firmware = "dvb-usb-p7500.fw";
1472 p7500->devices[0] = d7500; 1512 p7500->devices[0] = d7500;
1473 p7500->rc.legacy.rc_map_table = rc_map_tbs_table; 1513 p7500->rc.legacy.rc_map_table = rc_map_tbs_table;
@@ -1482,6 +1522,10 @@ static int dw2102_probe(struct usb_interface *intf,
1482 THIS_MODULE, NULL, adapter_nr) || 1522 THIS_MODULE, NULL, adapter_nr) ||
1483 0 == dvb_usb_device_init(intf, &s6x0_properties, 1523 0 == dvb_usb_device_init(intf, &s6x0_properties,
1484 THIS_MODULE, NULL, adapter_nr) || 1524 THIS_MODULE, NULL, adapter_nr) ||
1525 0 == dvb_usb_device_init(intf, p1100,
1526 THIS_MODULE, NULL, adapter_nr) ||
1527 0 == dvb_usb_device_init(intf, s660,
1528 THIS_MODULE, NULL, adapter_nr) ||
1485 0 == dvb_usb_device_init(intf, p7500, 1529 0 == dvb_usb_device_init(intf, p7500,
1486 THIS_MODULE, NULL, adapter_nr)) 1530 THIS_MODULE, NULL, adapter_nr))
1487 return 0; 1531 return 0;