aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb
diff options
context:
space:
mode:
authorIgor M. Liplianin <liplianin@me.by>2009-12-14 18:24:56 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:24 -0500
commitcd79d33e168dba0d7de32c5bf010e20cff184b2a (patch)
treea9e40f6281e62f27fc7d36e885416b5fef696c46 /drivers/media/dvb/dvb-usb
parentd41592a2a2b9a27425ade3fc2c8526e9e997acd6 (diff)
V4L/DVB (13818): Add Prof 7500 DVB-S2 USB card
The card based on stv0903 demod, stb6100 tuner. Signed-off-by: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r--drivers/media/dvb/dvb-usb/dw2102.c94
1 files changed, 84 insertions, 10 deletions
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c
index 64132c0cf80d..83a35524a82a 100644
--- a/drivers/media/dvb/dvb-usb/dw2102.c
+++ b/drivers/media/dvb/dvb-usb/dw2102.c
@@ -1,6 +1,7 @@
1/* DVB USB framework compliant Linux driver for the 1/* DVB USB framework compliant Linux driver for the
2* DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101, 2* DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101,
3* TeVii S600, S630, S650 Cards 3* TeVii S600, S630, S650,
4* Prof 1100, 7500 Cards
4* Copyright (C) 2008,2009 Igor M. Liplianin (liplianin@me.by) 5* Copyright (C) 2008,2009 Igor M. Liplianin (liplianin@me.by)
5* 6*
6* This program is free software; you can redistribute it and/or modify it 7* This program is free software; you can redistribute it and/or modify it
@@ -469,6 +470,7 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
469 int num) 470 int num)
470{ 471{
471 struct dvb_usb_device *d = i2c_get_adapdata(adap); 472 struct dvb_usb_device *d = i2c_get_adapdata(adap);
473 struct usb_device *udev = d->udev;
472 int ret = 0; 474 int ret = 0;
473 int len, i, j; 475 int len, i, j;
474 476
@@ -488,8 +490,13 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
488 } 490 }
489 case (DW2102_VOLTAGE_CTRL): { 491 case (DW2102_VOLTAGE_CTRL): {
490 u8 obuf[2]; 492 u8 obuf[2];
493
494 obuf[0] = 1;
495 obuf[1] = msg[j].buf[1];/* off-on */
496 ret = dw210x_op_rw(d->udev, 0x8a, 0, 0,
497 obuf, 2, DW210X_WRITE_MSG);
491 obuf[0] = 3; 498 obuf[0] = 3;
492 obuf[1] = msg[j].buf[0]; 499 obuf[1] = msg[j].buf[0];/* 13v-18v */
493 ret = dw210x_op_rw(d->udev, 0x8a, 0, 0, 500 ret = dw210x_op_rw(d->udev, 0x8a, 0, 0,
494 obuf, 2, DW210X_WRITE_MSG); 501 obuf, 2, DW210X_WRITE_MSG);
495 break; 502 break;
@@ -527,6 +534,17 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
527 i += 16; 534 i += 16;
528 len -= 16; 535 len -= 16;
529 } while (len > 0); 536 } while (len > 0);
537 } else if ((udev->descriptor.idProduct == 0x7500)
538 && (j < (num - 1))) {
539 /* write register addr before read */
540 u8 obuf[msg[j].len + 2];
541 obuf[0] = msg[j + 1].len;
542 obuf[1] = (msg[j].addr << 1);
543 memcpy(obuf + 2, msg[j].buf, msg[j].len);
544 ret = dw210x_op_rw(d->udev, 0x92, 0, 0,
545 obuf, msg[j].len + 2,
546 DW210X_WRITE_MSG);
547 break;
530 } else { 548 } else {
531 /* write registers */ 549 /* write registers */
532 u8 obuf[msg[j].len + 2]; 550 u8 obuf[msg[j].len + 2];
@@ -651,18 +669,25 @@ static int s6x0_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
651 669
652static int dw210x_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) 670static int dw210x_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
653{ 671{
654 static u8 command_13v[1] = {0x00}; 672 static u8 command_13v[] = {0x00, 0x01};
655 static u8 command_18v[1] = {0x01}; 673 static u8 command_18v[] = {0x01, 0x01};
656 struct i2c_msg msg[] = { 674 static u8 command_off[] = {0x00, 0x00};
657 {.addr = DW2102_VOLTAGE_CTRL, .flags = 0, 675 struct i2c_msg msg = {
658 .buf = command_13v, .len = 1}, 676 .addr = DW2102_VOLTAGE_CTRL,
677 .flags = 0,
678 .buf = command_off,
679 .len = 2,
659 }; 680 };
660 681
661 struct dvb_usb_adapter *udev_adap = 682 struct dvb_usb_adapter *udev_adap =
662 (struct dvb_usb_adapter *)(fe->dvb->priv); 683 (struct dvb_usb_adapter *)(fe->dvb->priv);
663 if (voltage == SEC_VOLTAGE_18) 684 if (voltage == SEC_VOLTAGE_18)
664 msg[0].buf = command_18v; 685 msg.buf = command_18v;
665 i2c_transfer(&udev_adap->dev->i2c_adap, msg, 1); 686 else if (voltage == SEC_VOLTAGE_13)
687 msg.buf = command_13v;
688
689 i2c_transfer(&udev_adap->dev->i2c_adap, &msg, 1);
690
666 return 0; 691 return 0;
667} 692}
668 693
@@ -735,6 +760,18 @@ static struct stv6110_config dw2104_stv6110_config = {
735 .clk_div = 1, 760 .clk_div = 1,
736}; 761};
737 762
763static struct stv0900_config prof_7500_stv0900_config = {
764 .demod_address = 0x6a,
765 .demod_mode = 0,
766 .xtal = 27000000,
767 .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */
768 .diseqc_mode = 2,/* 2/3 PWM */
769 .tun1_maddress = 0,/* 0x60 */
770 .tun1_adc = 0,/* 2 Vpp */
771 .path1_mode = 3,
772 .tun1_type = 3,
773};
774
738static int dw2104_frontend_attach(struct dvb_usb_adapter *d) 775static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
739{ 776{
740 struct dvb_tuner_ops *tuner_ops = NULL; 777 struct dvb_tuner_ops *tuner_ops = NULL;
@@ -882,6 +919,19 @@ static int s6x0_frontend_attach(struct dvb_usb_adapter *d)
882 return -EIO; 919 return -EIO;
883} 920}
884 921
922static int prof_7500_frontend_attach(struct dvb_usb_adapter *d)
923{
924 d->fe = dvb_attach(stv0900_attach, &prof_7500_stv0900_config,
925 &d->dev->i2c_adap, 0);
926 if (d->fe == NULL)
927 return -EIO;
928 d->fe->ops.set_voltage = dw210x_set_voltage;
929
930 info("Attached STV0900+STB6100A!\n");
931
932 return 0;
933}
934
885static int dw2102_tuner_attach(struct dvb_usb_adapter *adap) 935static int dw2102_tuner_attach(struct dvb_usb_adapter *adap)
886{ 936{
887 dvb_attach(dvb_pll_attach, adap->fe, 0x60, 937 dvb_attach(dvb_pll_attach, adap->fe, 0x60,
@@ -1073,6 +1123,7 @@ static struct usb_device_id dw2102_table[] = {
1073 {USB_DEVICE(0x9022, USB_PID_TEVII_S630)}, 1123 {USB_DEVICE(0x9022, USB_PID_TEVII_S630)},
1074 {USB_DEVICE(0x3011, USB_PID_PROF_1100)}, 1124 {USB_DEVICE(0x3011, USB_PID_PROF_1100)},
1075 {USB_DEVICE(0x9022, USB_PID_TEVII_S660)}, 1125 {USB_DEVICE(0x9022, USB_PID_TEVII_S660)},
1126 {USB_DEVICE(0x3034, 0x7500)},
1076 { } 1127 { }
1077}; 1128};
1078 1129
@@ -1387,9 +1438,30 @@ static struct dvb_usb_device_properties s6x0_properties = {
1387 } 1438 }
1388}; 1439};
1389 1440
1441struct dvb_usb_device_properties *p7500;
1442static struct dvb_usb_device_description d7500 = {
1443 "Prof 7500 USB DVB-S2",
1444 {&dw2102_table[9], NULL},
1445 {NULL},
1446};
1447
1390static int dw2102_probe(struct usb_interface *intf, 1448static int dw2102_probe(struct usb_interface *intf,
1391 const struct usb_device_id *id) 1449 const struct usb_device_id *id)
1392{ 1450{
1451
1452 p7500 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
1453 if (!p7500)
1454 return -ENOMEM;
1455 /* copy default structure */
1456 memcpy(p7500, &s6x0_properties,
1457 sizeof(struct dvb_usb_device_properties));
1458 /* fill only different fields */
1459 p7500->firmware = "dvb-usb-p7500.fw";
1460 p7500->devices[0] = d7500;
1461 p7500->rc_key_map = tbs_rc_keys;
1462 p7500->rc_key_map_size = ARRAY_SIZE(tbs_rc_keys);
1463 p7500->adapter->frontend_attach = prof_7500_frontend_attach;
1464
1393 if (0 == dvb_usb_device_init(intf, &dw2102_properties, 1465 if (0 == dvb_usb_device_init(intf, &dw2102_properties,
1394 THIS_MODULE, NULL, adapter_nr) || 1466 THIS_MODULE, NULL, adapter_nr) ||
1395 0 == dvb_usb_device_init(intf, &dw2104_properties, 1467 0 == dvb_usb_device_init(intf, &dw2104_properties,
@@ -1397,6 +1469,8 @@ static int dw2102_probe(struct usb_interface *intf,
1397 0 == dvb_usb_device_init(intf, &dw3101_properties, 1469 0 == dvb_usb_device_init(intf, &dw3101_properties,
1398 THIS_MODULE, NULL, adapter_nr) || 1470 THIS_MODULE, NULL, adapter_nr) ||
1399 0 == dvb_usb_device_init(intf, &s6x0_properties, 1471 0 == dvb_usb_device_init(intf, &s6x0_properties,
1472 THIS_MODULE, NULL, adapter_nr) ||
1473 0 == dvb_usb_device_init(intf, p7500,
1400 THIS_MODULE, NULL, adapter_nr)) 1474 THIS_MODULE, NULL, adapter_nr))
1401 return 0; 1475 return 0;
1402 1476
@@ -1431,6 +1505,6 @@ MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
1431MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104," 1505MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104,"
1432 " DVB-C 3101 USB2.0," 1506 " DVB-C 3101 USB2.0,"
1433 " TeVii S600, S630, S650, S660 USB2.0," 1507 " TeVii S600, S630, S650, S660 USB2.0,"
1434 " Prof 1100 USB2.0 devices"); 1508 " Prof 1100, 7500 USB2.0 devices");
1435MODULE_VERSION("0.1"); 1509MODULE_VERSION("0.1");
1436MODULE_LICENSE("GPL"); 1510MODULE_LICENSE("GPL");