TeVii S482

From LinuxTVWiki
Revision as of 21:54, 11 February 2015 by Dewolff (talk | contribs) (Patch against vanilla kernel)
Jump to navigation Jump to search
TeVii S482 Card

A dual DVB-S2 PCIe card from TeVii.

Hardware/Features

  • PCIe x1 low profile
  • Dual Tuner
  • The card consists of a USB Host Controller and two TeVii S660 equivalent cards.
  • LNB power supply via floppy connector

The Retail packaging includes full-height and low profile brackets, an IR receiver cable, an IR handset (incl. 2 AAA batteries), a windows drivers CD and an install manual.

Components Used

  • RF Tuner (twice): Montage Don't know
  • Demodulator (twice): Montage M88DS3103
  • USB Peripheral Controller (twice): Cypress CY7C68013A-56
  • PCIe bridge/USB Host Controller: MosChip MCS9990CV-AA
  • Crystal clock: (twice) YXC 24.0SDK + YXC 12.0SDK


Identification

lspci -nnk:

01:00.0 USB controller [0c03]: NetMos Technology MCS9990 PCIe to 4‐Port USB 2.0 Host Controller [9710:9990]
	Subsystem: Device [a000:4000]
	Kernel driver in use: ohci_hcd
01:00.1 USB controller [0c03]: NetMos Technology MCS9990 PCIe to 4‐Port USB 2.0 Host Controller [9710:9990]
	Subsystem: Device [a000:4000]
	Kernel driver in use: ehci_hcd
01:00.2 USB controller [0c03]: NetMos Technology MCS9990 PCIe to 4‐Port USB 2.0 Host Controller [9710:9990]
	Subsystem: Device [a000:4000]
	Kernel driver in use: ohci_hcd
01:00.3 USB controller [0c03]: NetMos Technology MCS9990 PCIe to 4‐Port USB 2.0 Host Controller [9710:9990]
	Subsystem: Device [a000:4000]
	Kernel driver in use: ehci_hcd
01:00.4 USB controller [0c03]: NetMos Technology MCS9990 PCIe to 4‐Port USB 2.0 Host Controller [9710:9990]
	Subsystem: Device [a000:4000]
	Kernel driver in use: ohci_hcd
01:00.5 USB controller [0c03]: NetMos Technology MCS9990 PCIe to 4‐Port USB 2.0 Host Controller [9710:9990]
	Subsystem: Device [a000:4000]
	Kernel driver in use: ehci_hcd
01:00.6 USB controller [0c03]: NetMos Technology MCS9990 PCIe to 4‐Port USB 2.0 Host Controller [9710:9990]
	Subsystem: Device [a000:4000]
	Kernel driver in use: ohci_hcd
01:00.7 USB controller [0c03]: NetMos Technology MCS9990 PCIe to 4‐Port USB 2.0 Host Controller [9710:9990]
	Subsystem: Device [a000:4000]
	Kernel driver in use: ehci_hcd


lsusb:

 Bus 010 Device 002: ID 9022:d483 TeVii Technology Ltd. 
 Bus 011 Device 002: ID 9022:d484 TeVii Technology Ltd. 


Once the module/firmware is loaded it's listed as two TeVii S660 cards.

Linux support

The s2-liplianin v4l branch includes support for the card.

It works in 3.2 kernel.

For kernel > 3.10 (tested with 3.19 vanilla) you can apply the following patch to the vanilla kernel:

diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
index 1a3df10..82d35c6 100644
--- a/drivers/media/usb/dvb-usb/dw2102.c
+++ b/drivers/media/usb/dvb-usb/dw2102.c
@@ -31,6 +31,9 @@
 #include "m88rs2000.h"
 #include "tda18271.h"
 #include "cxd2820r.h"
+#include "m88ds3103.h"
+#include "m88ts2022.h"
+
 
 /* Max transfer size done by I2C transfer functions */
 #define MAX_XFER_SIZE  64
@@ -71,6 +74,14 @@
 #define USB_PID_TEVII_S480_2 0xd482
 #endif
 
+#ifndef USB_PID_TEVII_S482_1
+#define USB_PID_TEVII_S482_1 0xd483
+#endif
+
+#ifndef USB_PID_TEVII_S482_2
+#define USB_PID_TEVII_S482_2 0xd484
+#endif
+
 #ifndef USB_PID_PROF_1100
 #define USB_PID_PROF_1100 0xb012
 #endif
@@ -1117,6 +1128,19 @@ static struct tda18271_config tda18271_config = {
 	.gate = TDA18271_GATE_DIGITAL,
 };
 
+static const struct m88ds3103_config s482_m88ds3103_config = {
+	.i2c_addr = 0x68,
+	.clock = 27000000,
+	.i2c_wr_max = 33,
+	.clock_out = 0,
+	.ts_mode = M88DS3103_TS_CI,
+	.ts_clk = 16000,
+	.ts_clk_pol = 0,
+	.agc = 0x99,
+	.lnb_hv_pol = 1,
+	.lnb_en_pol = 1,
+	 };
+
 static u8 m88rs2000_inittab[] = {
 	DEMOD_WRITE, 0x9a, 0x30,
 	DEMOD_WRITE, 0x00, 0x01,
@@ -1386,6 +1410,83 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d)
 	return -EIO;
 }
 
+static int m88ds3103_frontend_attach(struct dvb_usb_adapter *d)
+{
+	u8 obuf[3] = { 0xe, 0x80, 0 };
+	u8 ibuf[] = { 0 };
+
+	/* demod I2C adapter */
+	struct i2c_adapter *i2c_adapter;
+	struct i2c_client *client;
+	struct i2c_board_info info;
+	struct m88ts2022_config m88ts2022_config = {
+		.clock = 27000000,
+		 };
+	memset(&info, 0, sizeof(struct i2c_board_info));
+	if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+		err("command 0x0e transfer failed.");
+
+	obuf[0] = 0xe;
+	obuf[1] = 0x02;
+	obuf[2] = 1;
+
+	if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+		err("command 0x0e transfer failed.");
+	msleep(300);
+
+	obuf[0] = 0xe;
+	obuf[1] = 0x83;
+	obuf[2] = 0;
+
+	if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+		err("command 0x0e transfer failed.");
+
+	obuf[0] = 0xe;
+	obuf[1] = 0x83;
+	obuf[2] = 1;
+
+	if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
+		err("command 0x0e transfer failed.");
+
+	obuf[0] = 0x51;
+
+	if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
+		err("command 0x51 transfer failed.");
+	d->fe_adap[0].fe = dvb_attach(m88ds3103_attach,
+		&s482_m88ds3103_config,
+		&d->dev->i2c_adap,
+		&i2c_adapter);
+	if (d->fe_adap[0].fe == NULL)
+		return -EIO;
+	/* attach tuner */
+	m88ts2022_config.fe = d->fe_adap[0].fe;
+	strlcpy(info.type, "m88ts2022", I2C_NAME_SIZE);
+	info.addr = 0x60;
+	info.platform_data = &m88ts2022_config;
+	request_module("m88ts2022");
+	client = i2c_new_device(i2c_adapter, &info);
+	if (client == NULL || client->dev.driver == NULL) {
+		dvb_frontend_detach(d->fe_adap[0].fe);
+		goto fail_attach;
+	}
+	if (!try_module_get(client->dev.driver->owner)) {
+		        i2c_unregister_device(client);
+				dvb_frontend_detach(d->fe_adap[0].fe);
+		        goto fail_attach;
+	}
+	info("attached m88ds3103/m88ts2022!\n");
+
+	/* delegate signal strength measurement to tuner */
+
+	d->fe_adap[0].fe->ops.read_signal_strength =
+		d->fe_adap[0].fe->ops.tuner_ops.get_rf_strength;
+
+	return 0;
+fail_attach:
+	info("Failed to attach m88ds3103/m88ts2022!\n");
+	return -EIO;
+}
+
 static int t220_frontend_attach(struct dvb_usb_adapter *d)
 {
 	u8 obuf[3] = { 0xe, 0x87, 0 };
@@ -1557,6 +1658,8 @@ enum dw2102_table_entry {
 	TEVII_S480_2,
 	X3M_SPC1400HD,
 	TEVII_S421,
+	TEVII_S482_1,
+	TEVII_S482_2,
 	TEVII_S632,
 	TERRATEC_CINERGY_S2_R2,
 	GOTVIEW_SAT_HD,
@@ -1580,7 +1683,9 @@ static struct usb_device_id dw2102_table[] = {
 	[TEVII_S480_2] = {USB_DEVICE(0x9022, USB_PID_TEVII_S480_2)},
 	[X3M_SPC1400HD] = {USB_DEVICE(0x1f4d, 0x3100)},
 	[TEVII_S421] = {USB_DEVICE(0x9022, USB_PID_TEVII_S421)},
-	[TEVII_S632] = {USB_DEVICE(0x9022, USB_PID_TEVII_S632)},
+	[TEVII_S482_1] = { USB_DEVICE(0x9022, USB_PID_TEVII_S482_1) },
+	[TEVII_S482_2] = { USB_DEVICE(0x9022, USB_PID_TEVII_S482_2) },
+	[TEVII_S632] = { USB_DEVICE(0x9022, USB_PID_TEVII_S632) },
 	[TERRATEC_CINERGY_S2_R2] = {USB_DEVICE(USB_VID_TERRATEC, 0x00b0)},
 	[GOTVIEW_SAT_HD] = {USB_DEVICE(0x1FE1, USB_PID_GOTVIEW_SAT_HD)},
 	[GENIATECH_T220] = {USB_DEVICE(0x1f4d, 0xD220)},
@@ -2012,6 +2117,59 @@ static struct dvb_usb_device_properties su3000_properties = {
 	}
 };
 
+static struct dvb_usb_device_properties m88ds3103_properties = {
+	.caps = DVB_USB_IS_AN_I2C_ADAPTER,
+	.usb_ctrl = DEVICE_SPECIFIC,
+	.size_of_priv = sizeof(struct su3000_state),
+	.power_ctrl = su3000_power_ctrl,
+	.num_adapters = 1,
+	.identify_state = su3000_identify_state,
+	.i2c_algo = &su3000_i2c_algo,
+
+	.rc.core = {
+		.rc_interval = 150,
+		.rc_codes = RC_MAP_TEVII_NEC,
+		.module_name = "dw2102",
+		.allowed_protos = RC_BIT_NEC,
+		.rc_query = dw2102_rc_query,
+	},
+
+	.read_mac_address = su3000_read_mac_address,
+
+	.generic_bulk_ctrl_endpoint = 0x01,
+
+	.adapter = {
+		{
+			.num_frontends = 1,
+			.fe = { {
+					.streaming_ctrl = su3000_streaming_ctrl,
+					.frontend_attach = m88ds3103_frontend_attach,
+					.stream = {
+						.type = USB_BULK,
+						.count = 8,
+						.endpoint = 0x82,
+						.u = {
+							.bulk = {
+								.buffersize = 4096,
+							}
+						}
+					}
+				} },
+		}
+		},
+		.num_device_descs = 2,
+		.devices = {
+			{ "TeVii S482.1 USB",
+			{ &dw2102_table[TEVII_S482_1], NULL },
+			{ NULL },
+			},
+			{ "TeVii S482.2 USB",
+			{ &dw2102_table[TEVII_S482_2], NULL },
+			{ NULL },
+			},
+			}
+};
+
 static struct dvb_usb_device_properties t220_properties = {
 	.caps = DVB_USB_IS_AN_I2C_ADAPTER,
 	.usb_ctrl = DEVICE_SPECIFIC,
@@ -2131,11 +2289,13 @@ static int dw2102_probe(struct usb_interface *intf,
 	    0 == dvb_usb_device_init(intf, p7500,
 			THIS_MODULE, NULL, adapter_nr) ||
 	    0 == dvb_usb_device_init(intf, s421,
-			THIS_MODULE, NULL, adapter_nr) ||
-	    0 == dvb_usb_device_init(intf, &su3000_properties,
-			 THIS_MODULE, NULL, adapter_nr) ||
+			THIS_MODULE, NULL, adapter_nr)  ||
 	    0 == dvb_usb_device_init(intf, &t220_properties,
-			 THIS_MODULE, NULL, adapter_nr))
+			THIS_MODULE, NULL, adapter_nr) ||
+		0 == dvb_usb_device_init(intf, &m88ds3103_properties,
+			THIS_MODULE, NULL, adapter_nr) ||
+		0 == dvb_usb_device_init(intf, &su3000_properties,
+			THIS_MODULE, NULL, adapter_nr))
 		return 0;
 
 	return -ENODEV;
@@ -2153,7 +2313,7 @@ module_usb_driver(dw2102_driver);
 MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
 MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104,"
 			" DVB-C 3101 USB2.0,"
-			" TeVii S600, S630, S650, S660, S480, S421, S632"
+			" TeVii S600, S630, S650, S660, S480, S482, S421, S632"
 			" Prof 1100, 7500 USB2.0,"
 			" Geniatech SU3000, T220 devices");
 MODULE_VERSION("0.1");

Howto compile

 cd /usr/src/
 rm -rf s2-liplianin-v39
 hg clone https://bitbucket.org/liplianin/s2-liplianin-v39
 cd s2-liplianin-v39
 make release
 make

Install

mkdir -p /lib/modules/`uname -r`/updates/v4l
cp -f ./v4l/*.ko /lib/modules/`uname -r`/updates/v4l/
depmod -a
reboot

Uninstall

rm -rf /lib/modules/`uname -r`/updates/v4l
depmod -a
reboot

You must confirm to use the correct firmware from Tevii [1], wich normally is automatically installed by the driver:

cd /usr/local/src
wget http://www.tevii.com/s2_liplianin_1.tar
tar xvf s2_liplianin_1.tar
cd tevii_s2_liplianin-eb8a914cd499/linux/firmware/
md5sum dvb-usb-s660.fw
#2946e99fe3a4973ba905fcf59111cf40  dvb-usb-s660.fw
cp dvb-usb-s660.fw /lib/firmware/

Driver Status

05.10.2014 just work with liplianin drivers, not ported to Linux kernel

06.01.2015 It just compile in 3.2 kernel (Debian Wheezy) for me. The image and audio is bad in some channels.

          I try with Astra 19.2E:
                     CNN Int. works great
                     BBC World works bad

External Links

Official Website