diff options
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dib0700_devices.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dib0700_devices.c | 164 |
1 files changed, 153 insertions, 11 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index 635d30a55078..8ddbadf62194 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include "xc5000.h" | 17 | #include "xc5000.h" |
18 | #include "s5h1411.h" | 18 | #include "s5h1411.h" |
19 | #include "dib0070.h" | 19 | #include "dib0070.h" |
20 | #include "lgdt3305.h" | ||
21 | #include "mxl5007t.h" | ||
20 | 22 | ||
21 | static int force_lna_activation; | 23 | static int force_lna_activation; |
22 | module_param(force_lna_activation, int, 0644); | 24 | module_param(force_lna_activation, int, 0644); |
@@ -262,7 +264,12 @@ static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap) | |||
262 | msleep(10); | 264 | msleep(10); |
263 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); | 265 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
264 | msleep(10); | 266 | msleep(10); |
265 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap,1,18,stk7700d_dib7000p_mt2266_config); | 267 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
268 | stk7700d_dib7000p_mt2266_config) | ||
269 | != 0) { | ||
270 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__); | ||
271 | return -ENODEV; | ||
272 | } | ||
266 | } | 273 | } |
267 | 274 | ||
268 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), | 275 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), |
@@ -284,7 +291,12 @@ static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap) | |||
284 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); | 291 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); |
285 | msleep(10); | 292 | msleep(10); |
286 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | 293 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
287 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap,2,18,stk7700d_dib7000p_mt2266_config); | 294 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, |
295 | stk7700d_dib7000p_mt2266_config) | ||
296 | != 0) { | ||
297 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", __func__); | ||
298 | return -ENODEV; | ||
299 | } | ||
288 | } | 300 | } |
289 | 301 | ||
290 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), | 302 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap,0x80+(adap->id << 1), |
@@ -421,8 +433,12 @@ static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap) | |||
421 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | 433 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
422 | msleep(10); | 434 | msleep(10); |
423 | 435 | ||
424 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, | 436 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
425 | &stk7700ph_dib7700_xc3028_config); | 437 | &stk7700ph_dib7700_xc3028_config) != 0) { |
438 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", | ||
439 | __func__); | ||
440 | return -ENODEV; | ||
441 | } | ||
426 | 442 | ||
427 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, | 443 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, |
428 | &stk7700ph_dib7700_xc3028_config); | 444 | &stk7700ph_dib7700_xc3028_config); |
@@ -1187,8 +1203,12 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) | |||
1187 | msleep(10); | 1203 | msleep(10); |
1188 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | 1204 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
1189 | 1205 | ||
1190 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, | 1206 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 1, 18, |
1191 | &dib7070p_dib7000p_config); | 1207 | &dib7070p_dib7000p_config) != 0) { |
1208 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", | ||
1209 | __func__); | ||
1210 | return -ENODEV; | ||
1211 | } | ||
1192 | 1212 | ||
1193 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, | 1213 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, |
1194 | &dib7070p_dib7000p_config); | 1214 | &dib7070p_dib7000p_config); |
@@ -1244,7 +1264,12 @@ static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap) | |||
1244 | msleep(10); | 1264 | msleep(10); |
1245 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | 1265 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); |
1246 | 1266 | ||
1247 | dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, stk7070pd_dib7000p_config); | 1267 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, 2, 18, |
1268 | stk7070pd_dib7000p_config) != 0) { | ||
1269 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", | ||
1270 | __func__); | ||
1271 | return -ENODEV; | ||
1272 | } | ||
1248 | 1273 | ||
1249 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]); | 1274 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_config[0]); |
1250 | return adap->fe == NULL ? -ENODEV : 0; | 1275 | return adap->fe == NULL ? -ENODEV : 0; |
@@ -1347,6 +1372,72 @@ static int xc5000_tuner_attach(struct dvb_usb_adapter *adap) | |||
1347 | == NULL ? -ENODEV : 0; | 1372 | == NULL ? -ENODEV : 0; |
1348 | } | 1373 | } |
1349 | 1374 | ||
1375 | static struct lgdt3305_config hcw_lgdt3305_config = { | ||
1376 | .i2c_addr = 0x0e, | ||
1377 | .mpeg_mode = LGDT3305_MPEG_PARALLEL, | ||
1378 | .tpclk_edge = LGDT3305_TPCLK_FALLING_EDGE, | ||
1379 | .tpvalid_polarity = LGDT3305_TP_VALID_LOW, | ||
1380 | .deny_i2c_rptr = 0, | ||
1381 | .spectral_inversion = 1, | ||
1382 | .qam_if_khz = 6000, | ||
1383 | .vsb_if_khz = 6000, | ||
1384 | .usref_8vsb = 0x0500, | ||
1385 | }; | ||
1386 | |||
1387 | static struct mxl5007t_config hcw_mxl5007t_config = { | ||
1388 | .xtal_freq_hz = MxL_XTAL_25_MHZ, | ||
1389 | .if_freq_hz = MxL_IF_6_MHZ, | ||
1390 | .invert_if = 1, | ||
1391 | }; | ||
1392 | |||
1393 | /* TIGER-ATSC map: | ||
1394 | GPIO0 - LNA_CTR (H: LNA power enabled, L: LNA power disabled) | ||
1395 | GPIO1 - ANT_SEL (H: VPA, L: MCX) | ||
1396 | GPIO4 - SCL2 | ||
1397 | GPIO6 - EN_TUNER | ||
1398 | GPIO7 - SDA2 | ||
1399 | GPIO10 - DEM_RST | ||
1400 | |||
1401 | MXL is behind LG's i2c repeater. LG is on SCL2/SDA2 gpios on the DIB | ||
1402 | */ | ||
1403 | static int lgdt3305_frontend_attach(struct dvb_usb_adapter *adap) | ||
1404 | { | ||
1405 | struct dib0700_state *st = adap->dev->priv; | ||
1406 | |||
1407 | /* Make use of the new i2c functions from FW 1.20 */ | ||
1408 | st->fw_use_new_i2c_api = 1; | ||
1409 | |||
1410 | st->disable_streaming_master_mode = 1; | ||
1411 | |||
1412 | /* fe power enable */ | ||
1413 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); | ||
1414 | msleep(30); | ||
1415 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); | ||
1416 | msleep(30); | ||
1417 | |||
1418 | /* demod reset */ | ||
1419 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); | ||
1420 | msleep(30); | ||
1421 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); | ||
1422 | msleep(30); | ||
1423 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); | ||
1424 | msleep(30); | ||
1425 | |||
1426 | adap->fe = dvb_attach(lgdt3305_attach, | ||
1427 | &hcw_lgdt3305_config, | ||
1428 | &adap->dev->i2c_adap); | ||
1429 | |||
1430 | return adap->fe == NULL ? -ENODEV : 0; | ||
1431 | } | ||
1432 | |||
1433 | static int mxl5007t_tuner_attach(struct dvb_usb_adapter *adap) | ||
1434 | { | ||
1435 | return dvb_attach(mxl5007t_attach, adap->fe, | ||
1436 | &adap->dev->i2c_adap, 0x60, | ||
1437 | &hcw_mxl5007t_config) == NULL ? -ENODEV : 0; | ||
1438 | } | ||
1439 | |||
1440 | |||
1350 | /* DVB-USB and USB stuff follows */ | 1441 | /* DVB-USB and USB stuff follows */ |
1351 | struct usb_device_id dib0700_usb_id_table[] = { | 1442 | struct usb_device_id dib0700_usb_id_table[] = { |
1352 | /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) }, | 1443 | /* 0 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_STK7700P) }, |
@@ -1396,6 +1487,12 @@ struct usb_device_id dib0700_usb_id_table[] = { | |||
1396 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_EXPRESS) }, | 1487 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_EXPRESS) }, |
1397 | { USB_DEVICE(USB_VID_TERRATEC, | 1488 | { USB_DEVICE(USB_VID_TERRATEC, |
1398 | USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2) }, | 1489 | USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2) }, |
1490 | { USB_DEVICE(USB_VID_SONY, USB_PID_SONY_PLAYTV) }, | ||
1491 | /* 45 */{ USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_PD378S) }, | ||
1492 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_TIGER_ATSC) }, | ||
1493 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_TIGER_ATSC_B210) }, | ||
1494 | { USB_DEVICE(USB_VID_YUAN, USB_PID_YUAN_MC770) }, | ||
1495 | { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_DTT) }, | ||
1399 | { 0 } /* Terminating entry */ | 1496 | { 0 } /* Terminating entry */ |
1400 | }; | 1497 | }; |
1401 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); | 1498 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); |
@@ -1595,7 +1692,7 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1595 | }, | 1692 | }, |
1596 | }, | 1693 | }, |
1597 | 1694 | ||
1598 | .num_device_descs = 9, | 1695 | .num_device_descs = 11, |
1599 | .devices = { | 1696 | .devices = { |
1600 | { "DiBcom STK7070P reference design", | 1697 | { "DiBcom STK7070P reference design", |
1601 | { &dib0700_usb_id_table[15], NULL }, | 1698 | { &dib0700_usb_id_table[15], NULL }, |
@@ -1633,6 +1730,14 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1633 | { &dib0700_usb_id_table[33], NULL }, | 1730 | { &dib0700_usb_id_table[33], NULL }, |
1634 | { NULL }, | 1731 | { NULL }, |
1635 | }, | 1732 | }, |
1733 | { "Elgato EyeTV DTT", | ||
1734 | { &dib0700_usb_id_table[49], NULL }, | ||
1735 | { NULL }, | ||
1736 | }, | ||
1737 | { "Yuan PD378S", | ||
1738 | { &dib0700_usb_id_table[45], NULL }, | ||
1739 | { NULL }, | ||
1740 | }, | ||
1636 | }, | 1741 | }, |
1637 | 1742 | ||
1638 | .rc_interval = DEFAULT_RC_INTERVAL, | 1743 | .rc_interval = DEFAULT_RC_INTERVAL, |
@@ -1661,7 +1766,7 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1661 | } | 1766 | } |
1662 | }, | 1767 | }, |
1663 | 1768 | ||
1664 | .num_device_descs = 5, | 1769 | .num_device_descs = 6, |
1665 | .devices = { | 1770 | .devices = { |
1666 | { "DiBcom STK7070PD reference design", | 1771 | { "DiBcom STK7070PD reference design", |
1667 | { &dib0700_usb_id_table[17], NULL }, | 1772 | { &dib0700_usb_id_table[17], NULL }, |
@@ -1682,8 +1787,16 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1682 | { "Terratec Cinergy DT USB XS Diversity", | 1787 | { "Terratec Cinergy DT USB XS Diversity", |
1683 | { &dib0700_usb_id_table[43], NULL }, | 1788 | { &dib0700_usb_id_table[43], NULL }, |
1684 | { NULL }, | 1789 | { NULL }, |
1790 | }, | ||
1791 | { "Sony PlayTV", | ||
1792 | { &dib0700_usb_id_table[44], NULL }, | ||
1793 | { NULL }, | ||
1685 | } | 1794 | } |
1686 | } | 1795 | }, |
1796 | .rc_interval = DEFAULT_RC_INTERVAL, | ||
1797 | .rc_key_map = dib0700_rc_keys, | ||
1798 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), | ||
1799 | .rc_query = dib0700_rc_query | ||
1687 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 1800 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
1688 | 1801 | ||
1689 | .num_adapters = 1, | 1802 | .num_adapters = 1, |
@@ -1699,7 +1812,7 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1699 | }, | 1812 | }, |
1700 | }, | 1813 | }, |
1701 | 1814 | ||
1702 | .num_device_descs = 5, | 1815 | .num_device_descs = 7, |
1703 | .devices = { | 1816 | .devices = { |
1704 | { "Terratec Cinergy HT USB XE", | 1817 | { "Terratec Cinergy HT USB XE", |
1705 | { &dib0700_usb_id_table[27], NULL }, | 1818 | { &dib0700_usb_id_table[27], NULL }, |
@@ -1725,6 +1838,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1725 | { &dib0700_usb_id_table[39], NULL }, | 1838 | { &dib0700_usb_id_table[39], NULL }, |
1726 | { NULL }, | 1839 | { NULL }, |
1727 | }, | 1840 | }, |
1841 | { "YUAN High-Tech MC770", | ||
1842 | { &dib0700_usb_id_table[48], NULL }, | ||
1843 | { NULL }, | ||
1844 | }, | ||
1728 | }, | 1845 | }, |
1729 | .rc_interval = DEFAULT_RC_INTERVAL, | 1846 | .rc_interval = DEFAULT_RC_INTERVAL, |
1730 | .rc_key_map = dib0700_rc_keys, | 1847 | .rc_key_map = dib0700_rc_keys, |
@@ -1759,6 +1876,31 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1759 | .rc_key_map = dib0700_rc_keys, | 1876 | .rc_key_map = dib0700_rc_keys, |
1760 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), | 1877 | .rc_key_map_size = ARRAY_SIZE(dib0700_rc_keys), |
1761 | .rc_query = dib0700_rc_query | 1878 | .rc_query = dib0700_rc_query |
1879 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | ||
1880 | .num_adapters = 1, | ||
1881 | .adapter = { | ||
1882 | { | ||
1883 | .frontend_attach = lgdt3305_frontend_attach, | ||
1884 | .tuner_attach = mxl5007t_tuner_attach, | ||
1885 | |||
1886 | DIB0700_DEFAULT_STREAMING_CONFIG(0x02), | ||
1887 | |||
1888 | .size_of_priv = sizeof(struct | ||
1889 | dib0700_adapter_state), | ||
1890 | }, | ||
1891 | }, | ||
1892 | |||
1893 | .num_device_descs = 2, | ||
1894 | .devices = { | ||
1895 | { "Hauppauge ATSC MiniCard (B200)", | ||
1896 | { &dib0700_usb_id_table[46], NULL }, | ||
1897 | { NULL }, | ||
1898 | }, | ||
1899 | { "Hauppauge ATSC MiniCard (B210)", | ||
1900 | { &dib0700_usb_id_table[47], NULL }, | ||
1901 | { NULL }, | ||
1902 | }, | ||
1903 | }, | ||
1762 | }, | 1904 | }, |
1763 | }; | 1905 | }; |
1764 | 1906 | ||