diff options
author | Olli Salonen <olli.salonen@iki.fi> | 2014-09-29 03:44:16 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-10-30 09:46:04 -0400 |
commit | 82c10276d4e86fa51b89cf62a1cf6ed12d543843 (patch) | |
tree | 7b746239b6d98fe6789d5c51e8197197ce1a1da8 /drivers/media/pci | |
parent | 61110fbab1f083249ac0ac7090526798d8815210 (diff) |
[media] cx23855: add support for DVBSky T980C (no CI support)
This patch adds basic support for DVBSky T980C card. CI interface is not supported.
DVBSky T980C is a PCIe card with the following components:
- CX23885 PCIe bridge
- Si2168-A20 demodulator
- Si2158-A20 tuner
- CIMaX SP2 CI chip
The demodulator and tuner need firmware. They're the same as used with TT CT2-4650 CI:
https://www.mail-archive.com/linux-media@vger.kernel.org/msg78033.html
Signed-off-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/pci')
-rw-r--r-- | drivers/media/pci/cx23885/cx23885-cards.c | 40 | ||||
-rw-r--r-- | drivers/media/pci/cx23885/cx23885-dvb.c | 61 | ||||
-rw-r--r-- | drivers/media/pci/cx23885/cx23885.h | 1 |
3 files changed, 102 insertions, 0 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-cards.c b/drivers/media/pci/cx23885/cx23885-cards.c index 88c257d1161b..e8965e63eb09 100644 --- a/drivers/media/pci/cx23885/cx23885-cards.c +++ b/drivers/media/pci/cx23885/cx23885-cards.c | |||
@@ -680,6 +680,10 @@ struct cx23885_board cx23885_boards[] = { | |||
680 | .portb = CX23885_MPEG_DVB, | 680 | .portb = CX23885_MPEG_DVB, |
681 | .portc = CX23885_MPEG_DVB, | 681 | .portc = CX23885_MPEG_DVB, |
682 | }, | 682 | }, |
683 | [CX23885_BOARD_DVBSKY_T980C] = { | ||
684 | .name = "DVBSky T980C", | ||
685 | .portb = CX23885_MPEG_DVB, | ||
686 | }, | ||
683 | }; | 687 | }; |
684 | const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards); | 688 | const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards); |
685 | 689 | ||
@@ -939,6 +943,10 @@ struct cx23885_subid cx23885_subids[] = { | |||
939 | .subvendor = 0x4254, | 943 | .subvendor = 0x4254, |
940 | .subdevice = 0x9580, | 944 | .subdevice = 0x9580, |
941 | .card = CX23885_BOARD_DVBSKY_T9580, | 945 | .card = CX23885_BOARD_DVBSKY_T9580, |
946 | }, { | ||
947 | .subvendor = 0x4254, | ||
948 | .subdevice = 0x980c, | ||
949 | .card = CX23885_BOARD_DVBSKY_T980C, | ||
942 | }, | 950 | }, |
943 | }; | 951 | }; |
944 | const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids); | 952 | const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids); |
@@ -1541,6 +1549,36 @@ void cx23885_gpio_setup(struct cx23885_dev *dev) | |||
1541 | mdelay(100); | 1549 | mdelay(100); |
1542 | cx23885_gpio_set(dev, GPIO_2 | GPIO_11); | 1550 | cx23885_gpio_set(dev, GPIO_2 | GPIO_11); |
1543 | break; | 1551 | break; |
1552 | case CX23885_BOARD_DVBSKY_T980C: | ||
1553 | /* | ||
1554 | * GPIO-0 INTA from CiMax, input | ||
1555 | * GPIO-1 reset CiMax, output, high active | ||
1556 | * GPIO-2 reset demod, output, low active | ||
1557 | * GPIO-3 to GPIO-10 data/addr for CAM | ||
1558 | * GPIO-11 ~CS0 to CiMax1 | ||
1559 | * GPIO-12 ~CS1 to CiMax2 | ||
1560 | * GPIO-13 ADL0 load LSB addr | ||
1561 | * GPIO-14 ADL1 load MSB addr | ||
1562 | * GPIO-15 ~RDY from CiMax | ||
1563 | * GPIO-17 ~RD to CiMax | ||
1564 | * GPIO-18 ~WR to CiMax | ||
1565 | */ | ||
1566 | |||
1567 | cx_set(GP0_IO, 0x00060002); /* GPIO 1/2 as output */ | ||
1568 | cx_clear(GP0_IO, 0x00010004); /* GPIO 0 as input */ | ||
1569 | mdelay(100); /* reset delay */ | ||
1570 | cx_set(GP0_IO, 0x00060004); /* GPIO as out, reset high */ | ||
1571 | cx_clear(GP0_IO, 0x00010002); | ||
1572 | cx_write(MC417_CTL, 0x00000037); /* enable GPIO3-18 pins */ | ||
1573 | |||
1574 | /* GPIO-15 IN as ~ACK, rest as OUT */ | ||
1575 | cx_write(MC417_OEN, 0x00001000); | ||
1576 | |||
1577 | /* ~RD, ~WR high; ADL0, ADL1 low; ~CS0, ~CS1 high */ | ||
1578 | cx_write(MC417_RWD, 0x0000c300); | ||
1579 | |||
1580 | /* enable irq */ | ||
1581 | cx_write(GPIO_ISM, 0x00000000); /* INTERRUPTS active low */ | ||
1544 | } | 1582 | } |
1545 | } | 1583 | } |
1546 | 1584 | ||
@@ -1817,6 +1855,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
1817 | case CX23885_BOARD_TEVII_S471: | 1855 | case CX23885_BOARD_TEVII_S471: |
1818 | case CX23885_BOARD_DVBWORLD_2005: | 1856 | case CX23885_BOARD_DVBWORLD_2005: |
1819 | case CX23885_BOARD_PROF_8000: | 1857 | case CX23885_BOARD_PROF_8000: |
1858 | case CX23885_BOARD_DVBSKY_T980C: | ||
1820 | ts1->gen_ctrl_val = 0x5; /* Parallel */ | 1859 | ts1->gen_ctrl_val = 0x5; /* Parallel */ |
1821 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ | 1860 | ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ |
1822 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; | 1861 | ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; |
@@ -1935,6 +1974,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
1935 | case CX23885_BOARD_TBS_6980: | 1974 | case CX23885_BOARD_TBS_6980: |
1936 | case CX23885_BOARD_TBS_6981: | 1975 | case CX23885_BOARD_TBS_6981: |
1937 | case CX23885_BOARD_DVBSKY_T9580: | 1976 | case CX23885_BOARD_DVBSKY_T9580: |
1977 | case CX23885_BOARD_DVBSKY_T980C: | ||
1938 | dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, | 1978 | dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
1939 | &dev->i2c_bus[2].i2c_adap, | 1979 | &dev->i2c_bus[2].i2c_adap, |
1940 | "cx25840", 0x88 >> 1, NULL); | 1980 | "cx25840", 0x88 >> 1, NULL); |
diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c index 4cb90317ff45..062854d30a75 100644 --- a/drivers/media/pci/cx23885/cx23885-dvb.c +++ b/drivers/media/pci/cx23885/cx23885-dvb.c | |||
@@ -1680,6 +1680,52 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1680 | break; | 1680 | break; |
1681 | } | 1681 | } |
1682 | break; | 1682 | break; |
1683 | case CX23885_BOARD_DVBSKY_T980C: | ||
1684 | i2c_bus = &dev->i2c_bus[1]; | ||
1685 | |||
1686 | /* attach frontend */ | ||
1687 | memset(&si2168_config, 0, sizeof(si2168_config)); | ||
1688 | si2168_config.i2c_adapter = &adapter; | ||
1689 | si2168_config.fe = &fe0->dvb.frontend; | ||
1690 | si2168_config.ts_mode = SI2168_TS_PARALLEL; | ||
1691 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
1692 | strlcpy(info.type, "si2168", I2C_NAME_SIZE); | ||
1693 | info.addr = 0x64; | ||
1694 | info.platform_data = &si2168_config; | ||
1695 | request_module(info.type); | ||
1696 | client_demod = i2c_new_device(&i2c_bus->i2c_adap, &info); | ||
1697 | if (client_demod == NULL || | ||
1698 | client_demod->dev.driver == NULL) | ||
1699 | goto frontend_detach; | ||
1700 | if (!try_module_get(client_demod->dev.driver->owner)) { | ||
1701 | i2c_unregister_device(client_demod); | ||
1702 | goto frontend_detach; | ||
1703 | } | ||
1704 | port->i2c_client_demod = client_demod; | ||
1705 | |||
1706 | /* attach tuner */ | ||
1707 | memset(&si2157_config, 0, sizeof(si2157_config)); | ||
1708 | si2157_config.fe = fe0->dvb.frontend; | ||
1709 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
1710 | strlcpy(info.type, "si2157", I2C_NAME_SIZE); | ||
1711 | info.addr = 0x60; | ||
1712 | info.platform_data = &si2157_config; | ||
1713 | request_module(info.type); | ||
1714 | client_tuner = i2c_new_device(adapter, &info); | ||
1715 | if (client_tuner == NULL || | ||
1716 | client_tuner->dev.driver == NULL) { | ||
1717 | module_put(client_demod->dev.driver->owner); | ||
1718 | i2c_unregister_device(client_demod); | ||
1719 | goto frontend_detach; | ||
1720 | } | ||
1721 | if (!try_module_get(client_tuner->dev.driver->owner)) { | ||
1722 | i2c_unregister_device(client_tuner); | ||
1723 | module_put(client_demod->dev.driver->owner); | ||
1724 | i2c_unregister_device(client_demod); | ||
1725 | goto frontend_detach; | ||
1726 | } | ||
1727 | port->i2c_client_tuner = client_tuner; | ||
1728 | break; | ||
1683 | default: | 1729 | default: |
1684 | printk(KERN_INFO "%s: The frontend of your DVB/ATSC card " | 1730 | printk(KERN_INFO "%s: The frontend of your DVB/ATSC card " |
1685 | " isn't supported yet\n", | 1731 | " isn't supported yet\n", |
@@ -1770,6 +1816,21 @@ static int dvb_register(struct cx23885_tsport *port) | |||
1770 | (port->nr-1) * 8, 6); | 1816 | (port->nr-1) * 8, 6); |
1771 | break; | 1817 | break; |
1772 | } | 1818 | } |
1819 | case CX23885_BOARD_DVBSKY_T980C: { | ||
1820 | u8 eeprom[256]; /* 24C02 i2c eeprom */ | ||
1821 | |||
1822 | if (port->nr != 1) | ||
1823 | break; | ||
1824 | |||
1825 | /* Read entire EEPROM */ | ||
1826 | dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1; | ||
1827 | tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom, | ||
1828 | sizeof(eeprom)); | ||
1829 | printk(KERN_INFO "DVBSky T980C MAC address: %pM\n", | ||
1830 | eeprom + 0xc0); | ||
1831 | memcpy(port->frontends.adapter.proposed_mac, eeprom + 0xc0, 6); | ||
1832 | break; | ||
1833 | } | ||
1773 | } | 1834 | } |
1774 | 1835 | ||
1775 | return ret; | 1836 | return ret; |
diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h index 6c35e6115969..33b1e26847a2 100644 --- a/drivers/media/pci/cx23885/cx23885.h +++ b/drivers/media/pci/cx23885/cx23885.h | |||
@@ -93,6 +93,7 @@ | |||
93 | #define CX23885_BOARD_HAUPPAUGE_IMPACTVCBE 43 | 93 | #define CX23885_BOARD_HAUPPAUGE_IMPACTVCBE 43 |
94 | #define CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2 44 | 94 | #define CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2 44 |
95 | #define CX23885_BOARD_DVBSKY_T9580 45 | 95 | #define CX23885_BOARD_DVBSKY_T9580 45 |
96 | #define CX23885_BOARD_DVBSKY_T980C 46 | ||
96 | 97 | ||
97 | #define GPIO_0 0x00000001 | 98 | #define GPIO_0 0x00000001 |
98 | #define GPIO_1 0x00000002 | 99 | #define GPIO_1 0x00000002 |