aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorNibble Max <nibble.max@gmail.com>2014-11-26 07:35:14 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-12-04 10:30:29 -0500
commit2adb177e57417cf8409e86bda2c516e5f99a2099 (patch)
treed99a83d219058f9953dfcbb6b92643183f47fac5 /drivers/media/usb
parent0a5a4f32acc131de73c6c4ffc994371384db11fc (diff)
[media] cxusb: remove TechnoTrend CT2-4400 and CT2-4650 devices
Remove TechnoTrend CT2-4400 and CT2-4650 devices from cxusb. They are supported by dvb-usb-dvbsky driver in PATCH 3/3. Signed-off-by: Nibble Max <nibble.max@gmail.com> Reviewed-by: Olli Salonen <olli.salonen@iki.fi> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/dvb-usb/Kconfig1
-rw-r--r--drivers/media/usb/dvb-usb/cxusb.c298
-rw-r--r--drivers/media/usb/dvb-usb/cxusb.h4
3 files changed, 0 insertions, 303 deletions
diff --git a/drivers/media/usb/dvb-usb/Kconfig b/drivers/media/usb/dvb-usb/Kconfig
index 41d3eb922a00..3364200db093 100644
--- a/drivers/media/usb/dvb-usb/Kconfig
+++ b/drivers/media/usb/dvb-usb/Kconfig
@@ -130,7 +130,6 @@ config DVB_USB_CXUSB
130 130
131 Medion MD95700 hybrid USB2.0 device. 131 Medion MD95700 hybrid USB2.0 device.
132 DViCO FusionHDTV (Bluebird) USB2.0 devices 132 DViCO FusionHDTV (Bluebird) USB2.0 devices
133 TechnoTrend TVStick CT2-4400 and CT2-4650 CI devices
134 133
135config DVB_USB_M920X 134config DVB_USB_M920X
136 tristate "Uli m920x DVB-T USB2.0 support" 135 tristate "Uli m920x DVB-T USB2.0 support"
diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
index 643d88f95b39..0f345b1f9014 100644
--- a/drivers/media/usb/dvb-usb/cxusb.c
+++ b/drivers/media/usb/dvb-usb/cxusb.c
@@ -44,7 +44,6 @@
44#include "atbm8830.h" 44#include "atbm8830.h"
45#include "si2168.h" 45#include "si2168.h"
46#include "si2157.h" 46#include "si2157.h"
47#include "sp2.h"
48 47
49/* Max transfer size done by I2C transfer functions */ 48/* Max transfer size done by I2C transfer functions */
50#define MAX_XFER_SIZE 80 49#define MAX_XFER_SIZE 80
@@ -147,22 +146,6 @@ static int cxusb_d680_dmb_gpio_tuner(struct dvb_usb_device *d,
147 } 146 }
148} 147}
149 148
150static int cxusb_tt_ct2_4400_gpio_tuner(struct dvb_usb_device *d, int onoff)
151{
152 u8 o[2], i;
153 int rc;
154
155 o[0] = 0x83;
156 o[1] = onoff;
157 rc = cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, &i, 1);
158
159 if (rc) {
160 deb_info("gpio_write failed.\n");
161 return -EIO;
162 }
163 return 0;
164}
165
166/* I2C */ 149/* I2C */
167static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], 150static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
168 int num) 151 int num)
@@ -524,30 +507,6 @@ static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event,
524 return 0; 507 return 0;
525} 508}
526 509
527static int cxusb_tt_ct2_4400_rc_query(struct dvb_usb_device *d)
528{
529 u8 i[2];
530 int ret;
531 u32 cmd, keycode;
532 u8 rc5_cmd, rc5_addr, rc5_toggle;
533
534 ret = cxusb_ctrl_msg(d, 0x10, NULL, 0, i, 2);
535 if (ret)
536 return ret;
537
538 cmd = (i[0] << 8) | i[1];
539
540 if (cmd != 0xffff) {
541 rc5_cmd = cmd & 0x3F; /* bits 1-6 for command */
542 rc5_addr = (cmd & 0x07C0) >> 6; /* bits 7-11 for address */
543 rc5_toggle = (cmd & 0x0800) >> 11; /* bit 12 for toggle */
544 keycode = (rc5_addr << 8) | rc5_cmd;
545 rc_keydown(d->rc_dev, RC_BIT_RC5, keycode, rc5_toggle);
546 }
547
548 return 0;
549}
550
551static struct rc_map_table rc_map_dvico_mce_table[] = { 510static struct rc_map_table rc_map_dvico_mce_table[] = {
552 { 0xfe02, KEY_TV }, 511 { 0xfe02, KEY_TV },
553 { 0xfe0e, KEY_MP3 }, 512 { 0xfe0e, KEY_MP3 },
@@ -673,70 +632,6 @@ static struct rc_map_table rc_map_d680_dmb_table[] = {
673 { 0x0025, KEY_POWER }, 632 { 0x0025, KEY_POWER },
674}; 633};
675 634
676static int cxusb_tt_ct2_4400_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
677{
678 u8 wbuf[2];
679 u8 rbuf[6];
680 int ret;
681 struct i2c_msg msg[] = {
682 {
683 .addr = 0x51,
684 .flags = 0,
685 .buf = wbuf,
686 .len = 2,
687 }, {
688 .addr = 0x51,
689 .flags = I2C_M_RD,
690 .buf = rbuf,
691 .len = 6,
692 }
693 };
694
695 wbuf[0] = 0x1e;
696 wbuf[1] = 0x00;
697 ret = cxusb_i2c_xfer(&d->i2c_adap, msg, 2);
698
699 if (ret == 2) {
700 memcpy(mac, rbuf, 6);
701 return 0;
702 } else {
703 if (ret < 0)
704 return ret;
705 return -EIO;
706 }
707}
708
709static int cxusb_tt_ct2_4650_ci_ctrl(void *priv, u8 read, int addr,
710 u8 data, int *mem)
711{
712 struct dvb_usb_device *d = priv;
713 u8 wbuf[3];
714 u8 rbuf[2];
715 int ret;
716
717 wbuf[0] = (addr >> 8) & 0xff;
718 wbuf[1] = addr & 0xff;
719
720 if (read) {
721 ret = cxusb_ctrl_msg(d, CMD_SP2_CI_READ, wbuf, 2, rbuf, 2);
722 } else {
723 wbuf[2] = data;
724 ret = cxusb_ctrl_msg(d, CMD_SP2_CI_WRITE, wbuf, 3, rbuf, 1);
725 }
726
727 if (ret)
728 goto err;
729
730 if (read)
731 *mem = rbuf[1];
732
733 return 0;
734err:
735 deb_info("%s: ci usb write returned %d\n", __func__, ret);
736 return ret;
737
738}
739
740static int cxusb_dee1601_demod_init(struct dvb_frontend* fe) 635static int cxusb_dee1601_demod_init(struct dvb_frontend* fe)
741{ 636{
742 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x28 }; 637 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x28 };
@@ -1478,127 +1373,6 @@ static int cxusb_mygica_t230_frontend_attach(struct dvb_usb_adapter *adap)
1478 return 0; 1373 return 0;
1479} 1374}
1480 1375
1481static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap)
1482{
1483 struct dvb_usb_device *d = adap->dev;
1484 struct cxusb_state *st = d->priv;
1485 struct i2c_adapter *adapter;
1486 struct i2c_client *client_demod;
1487 struct i2c_client *client_tuner;
1488 struct i2c_client *client_ci;
1489 struct i2c_board_info info;
1490 struct si2168_config si2168_config;
1491 struct si2157_config si2157_config;
1492 struct sp2_config sp2_config;
1493 u8 o[2], i;
1494
1495 /* reset the tuner */
1496 if (cxusb_tt_ct2_4400_gpio_tuner(d, 0) < 0) {
1497 err("clear tuner gpio failed");
1498 return -EIO;
1499 }
1500 msleep(100);
1501 if (cxusb_tt_ct2_4400_gpio_tuner(d, 1) < 0) {
1502 err("set tuner gpio failed");
1503 return -EIO;
1504 }
1505 msleep(100);
1506
1507 /* attach frontend */
1508 memset(&si2168_config, 0, sizeof(si2168_config));
1509 si2168_config.i2c_adapter = &adapter;
1510 si2168_config.fe = &adap->fe_adap[0].fe;
1511 si2168_config.ts_mode = SI2168_TS_PARALLEL;
1512
1513 /* CT2-4400v2 TS gets corrupted without this */
1514 if (le16_to_cpu(d->udev->descriptor.idProduct) ==
1515 USB_PID_TECHNOTREND_TVSTICK_CT2_4400)
1516 si2168_config.ts_mode |= 0x40;
1517
1518 memset(&info, 0, sizeof(struct i2c_board_info));
1519 strlcpy(info.type, "si2168", I2C_NAME_SIZE);
1520 info.addr = 0x64;
1521 info.platform_data = &si2168_config;
1522 request_module(info.type);
1523 client_demod = i2c_new_device(&d->i2c_adap, &info);
1524 if (client_demod == NULL || client_demod->dev.driver == NULL)
1525 return -ENODEV;
1526
1527 if (!try_module_get(client_demod->dev.driver->owner)) {
1528 i2c_unregister_device(client_demod);
1529 return -ENODEV;
1530 }
1531
1532 st->i2c_client_demod = client_demod;
1533
1534 /* attach tuner */
1535 memset(&si2157_config, 0, sizeof(si2157_config));
1536 si2157_config.fe = adap->fe_adap[0].fe;
1537 memset(&info, 0, sizeof(struct i2c_board_info));
1538 strlcpy(info.type, "si2157", I2C_NAME_SIZE);
1539 info.addr = 0x60;
1540 info.platform_data = &si2157_config;
1541 request_module(info.type);
1542 client_tuner = i2c_new_device(adapter, &info);
1543 if (client_tuner == NULL || client_tuner->dev.driver == NULL) {
1544 module_put(client_demod->dev.driver->owner);
1545 i2c_unregister_device(client_demod);
1546 return -ENODEV;
1547 }
1548 if (!try_module_get(client_tuner->dev.driver->owner)) {
1549 i2c_unregister_device(client_tuner);
1550 module_put(client_demod->dev.driver->owner);
1551 i2c_unregister_device(client_demod);
1552 return -ENODEV;
1553 }
1554
1555 st->i2c_client_tuner = client_tuner;
1556
1557 /* initialize CI */
1558 if (le16_to_cpu(d->udev->descriptor.idProduct) ==
1559 USB_PID_TECHNOTREND_CONNECT_CT2_4650_CI) {
1560
1561 memcpy(o, "\xc0\x01", 2);
1562 cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, &i, 1);
1563 msleep(100);
1564
1565 memcpy(o, "\xc0\x00", 2);
1566 cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, &i, 1);
1567 msleep(100);
1568
1569 memset(&sp2_config, 0, sizeof(sp2_config));
1570 sp2_config.dvb_adap = &adap->dvb_adap;
1571 sp2_config.priv = d;
1572 sp2_config.ci_control = cxusb_tt_ct2_4650_ci_ctrl;
1573 memset(&info, 0, sizeof(struct i2c_board_info));
1574 strlcpy(info.type, "sp2", I2C_NAME_SIZE);
1575 info.addr = 0x40;
1576 info.platform_data = &sp2_config;
1577 request_module(info.type);
1578 client_ci = i2c_new_device(&d->i2c_adap, &info);
1579 if (client_ci == NULL || client_ci->dev.driver == NULL) {
1580 module_put(client_tuner->dev.driver->owner);
1581 i2c_unregister_device(client_tuner);
1582 module_put(client_demod->dev.driver->owner);
1583 i2c_unregister_device(client_demod);
1584 return -ENODEV;
1585 }
1586 if (!try_module_get(client_ci->dev.driver->owner)) {
1587 i2c_unregister_device(client_ci);
1588 module_put(client_tuner->dev.driver->owner);
1589 i2c_unregister_device(client_tuner);
1590 module_put(client_demod->dev.driver->owner);
1591 i2c_unregister_device(client_demod);
1592 return -ENODEV;
1593 }
1594
1595 st->i2c_client_ci = client_ci;
1596
1597 }
1598
1599 return 0;
1600}
1601
1602/* 1376/*
1603 * DViCO has shipped two devices with the same USB ID, but only one of them 1377 * DViCO has shipped two devices with the same USB ID, but only one of them
1604 * needs a firmware download. Check the device class details to see if they 1378 * needs a firmware download. Check the device class details to see if they
@@ -1681,7 +1455,6 @@ static struct dvb_usb_device_properties cxusb_aver_a868r_properties;
1681static struct dvb_usb_device_properties cxusb_d680_dmb_properties; 1455static struct dvb_usb_device_properties cxusb_d680_dmb_properties;
1682static struct dvb_usb_device_properties cxusb_mygica_d689_properties; 1456static struct dvb_usb_device_properties cxusb_mygica_d689_properties;
1683static struct dvb_usb_device_properties cxusb_mygica_t230_properties; 1457static struct dvb_usb_device_properties cxusb_mygica_t230_properties;
1684static struct dvb_usb_device_properties cxusb_tt_ct2_4400_properties;
1685 1458
1686static int cxusb_probe(struct usb_interface *intf, 1459static int cxusb_probe(struct usb_interface *intf,
1687 const struct usb_device_id *id) 1460 const struct usb_device_id *id)
@@ -1714,8 +1487,6 @@ static int cxusb_probe(struct usb_interface *intf,
1714 THIS_MODULE, NULL, adapter_nr) || 1487 THIS_MODULE, NULL, adapter_nr) ||
1715 0 == dvb_usb_device_init(intf, &cxusb_mygica_t230_properties, 1488 0 == dvb_usb_device_init(intf, &cxusb_mygica_t230_properties,
1716 THIS_MODULE, NULL, adapter_nr) || 1489 THIS_MODULE, NULL, adapter_nr) ||
1717 0 == dvb_usb_device_init(intf, &cxusb_tt_ct2_4400_properties,
1718 THIS_MODULE, NULL, adapter_nr) ||
1719 0) 1490 0)
1720 return 0; 1491 return 0;
1721 1492
@@ -1728,13 +1499,6 @@ static void cxusb_disconnect(struct usb_interface *intf)
1728 struct cxusb_state *st = d->priv; 1499 struct cxusb_state *st = d->priv;
1729 struct i2c_client *client; 1500 struct i2c_client *client;
1730 1501
1731 /* remove I2C client for CI */
1732 client = st->i2c_client_ci;
1733 if (client) {
1734 module_put(client->dev.driver->owner);
1735 i2c_unregister_device(client);
1736 }
1737
1738 /* remove I2C client for tuner */ 1502 /* remove I2C client for tuner */
1739 client = st->i2c_client_tuner; 1503 client = st->i2c_client_tuner;
1740 if (client) { 1504 if (client) {
@@ -1773,8 +1537,6 @@ static struct usb_device_id cxusb_table [] = {
1773 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4_REV_2) }, 1537 { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4_REV_2) },
1774 { USB_DEVICE(USB_VID_CONEXANT, USB_PID_CONEXANT_D680_DMB) }, 1538 { USB_DEVICE(USB_VID_CONEXANT, USB_PID_CONEXANT_D680_DMB) },
1775 { USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_D689) }, 1539 { USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_D689) },
1776 { USB_DEVICE(USB_VID_TECHNOTREND, USB_PID_TECHNOTREND_TVSTICK_CT2_4400) },
1777 { USB_DEVICE(USB_VID_TECHNOTREND, USB_PID_TECHNOTREND_CONNECT_CT2_4650_CI) },
1778 { USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230) }, 1540 { USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230) },
1779 {} /* Terminating entry */ 1541 {} /* Terminating entry */
1780}; 1542};
@@ -2422,66 +2184,6 @@ static struct dvb_usb_device_properties cxusb_mygica_d689_properties = {
2422 } 2184 }
2423}; 2185};
2424 2186
2425static struct dvb_usb_device_properties cxusb_tt_ct2_4400_properties = {
2426 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
2427
2428 .usb_ctrl = CYPRESS_FX2,
2429
2430 .size_of_priv = sizeof(struct cxusb_state),
2431
2432 .num_adapters = 1,
2433 .read_mac_address = cxusb_tt_ct2_4400_read_mac_address,
2434
2435 .adapter = {
2436 {
2437 .num_frontends = 1,
2438 .fe = {{
2439 .streaming_ctrl = cxusb_streaming_ctrl,
2440 /* both frontend and tuner attached in the
2441 same function */
2442 .frontend_attach = cxusb_tt_ct2_4400_attach,
2443
2444 /* parameter for the MPEG2-data transfer */
2445 .stream = {
2446 .type = USB_BULK,
2447 .count = 8,
2448 .endpoint = 0x82,
2449 .u = {
2450 .bulk = {
2451 .buffersize = 4096,
2452 }
2453 }
2454 },
2455 } },
2456 },
2457 },
2458
2459 .i2c_algo = &cxusb_i2c_algo,
2460 .generic_bulk_ctrl_endpoint = 0x01,
2461 .generic_bulk_ctrl_endpoint_response = 0x81,
2462
2463 .rc.core = {
2464 .rc_codes = RC_MAP_TT_1500,
2465 .allowed_protos = RC_BIT_RC5,
2466 .rc_query = cxusb_tt_ct2_4400_rc_query,
2467 .rc_interval = 150,
2468 },
2469
2470 .num_device_descs = 2,
2471 .devices = {
2472 {
2473 "TechnoTrend TVStick CT2-4400",
2474 { NULL },
2475 { &cxusb_table[20], NULL },
2476 },
2477 {
2478 "TechnoTrend TT-connect CT2-4650 CI",
2479 { NULL },
2480 { &cxusb_table[21], NULL },
2481 },
2482 }
2483};
2484
2485static struct dvb_usb_device_properties cxusb_mygica_t230_properties = { 2187static struct dvb_usb_device_properties cxusb_mygica_t230_properties = {
2486 .caps = DVB_USB_IS_AN_I2C_ADAPTER, 2188 .caps = DVB_USB_IS_AN_I2C_ADAPTER,
2487 2189
diff --git a/drivers/media/usb/dvb-usb/cxusb.h b/drivers/media/usb/dvb-usb/cxusb.h
index 29f3e2ea2476..527ff7905e15 100644
--- a/drivers/media/usb/dvb-usb/cxusb.h
+++ b/drivers/media/usb/dvb-usb/cxusb.h
@@ -28,14 +28,10 @@
28#define CMD_ANALOG 0x50 28#define CMD_ANALOG 0x50
29#define CMD_DIGITAL 0x51 29#define CMD_DIGITAL 0x51
30 30
31#define CMD_SP2_CI_WRITE 0x70
32#define CMD_SP2_CI_READ 0x71
33
34struct cxusb_state { 31struct cxusb_state {
35 u8 gpio_write_state[3]; 32 u8 gpio_write_state[3];
36 struct i2c_client *i2c_client_demod; 33 struct i2c_client *i2c_client_demod;
37 struct i2c_client *i2c_client_tuner; 34 struct i2c_client *i2c_client_tuner;
38 struct i2c_client *i2c_client_ci;
39}; 35};
40 36
41#endif 37#endif