View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,24 @@
+#ifndef MTV23X_H
+#define MTV23X_H
+#include <linux/dvb/frontend.h>
+
+
+/*TS mode*/
+//#define RTV_TSIF_FORMAT_0 /* Serial: EN_high, CLK_rising */
+//#define RTV_TSIF_FORMAT_1 /* Serial: EN_high, CLK_falling */ //
+//#define RTV_TSIF_FORMAT_2 /* Serial: EN_low, CLK_rising */
+//#define RTV_TSIF_FORMAT_3 /* Serial: EN_low, CLK_falling */
+//#define RTV_TSIF_FORMAT_4 /* Serial: EN_high, CLK_rising + 1CLK add */
+//#define RTV_TSIF_FORMAT_5 /* Serial: EN_high, CLK_falling + 1CLK add */
+//#define RTV_TSIF_FORMAT_6 /* Parallel: EN_high, CLK_rising */
+//#define RTV_TSIF_FORMAT_7 /* Parallel: EN_high, CLK_falling */
+
+struct mtv23x_config{
+ int ts_mode; // 0:serial 1:parallel
+ int clk_freq; //32000khz , 19200khz
+ u16 i2c_wr_max;
+
+ struct dvb_frontend **fe;
+};
+
+#endif
View
@@ -0,0 +1,95 @@
+#ifndef MTV23X_PRIV_H
+#define MTV23X_PRIV_H
+
+#include "dvb_frontend.h"
+#include "mtv23x.h"
+#include <linux/regmap.h>
+
+/* Do not modify the order and value! */
+enum E_RTV_SERVICE_TYPE {
+ RTV_SERVICE_INVALID = -1,
+ RTV_SERVICE_UHF_ISDBT_1seg = 0, /* ISDB-T 1seg */
+ RTV_SERVICE_UHF_ISDBT_13seg = 1, /* ISDB-T fullseg */
+ RTV_SERVICE_VHF_ISDBTmm_1seg = 2, /* ISDB-Tmm 1seg */
+ RTV_SERVICE_VHF_ISDBTmm_13seg = 3, /* ISDB-Tmm 13seg */
+ RTV_SERVICE_VHF_ISDBTsb_1seg = 4, /* ISDB-Tsb 1seg */
+ RTV_SERVICE_VHF_ISDBTsb_3seg = 5, /* ISDB-Tsb 3seg */
+ RTV_SERVICE_DVBT = 6, /* DVB-T */
+ MAX_NUM_RTV_SERVICE
+};
+
+
+struct mtv23x_dev {
+ struct i2c_client *client;
+ struct regmap *regmap;
+ struct dvb_frontend fe;
+ u16 i2c_wr_max;
+
+ int ts_mode;
+ int clk_freq;//u:KHZ
+
+ bool rtv_1seglpmode;
+
+ enum E_RTV_SERVICE_TYPE svc_type;
+};
+
+#define TOP_PAGE 0x00
+#define HOST_PAGE 0x00
+#define OFDM_PAGE 0x01
+#define SHAD_PAGE 0x02
+#define FEC_PAGE 0x03
+#define DATA_PAGE 0x04
+#define FEC2_PAGE 0x06
+#define LPOFDM_PAGE 0x07
+#define SPI_CTRL_PAGE 0x0E
+#define RF_PAGE 0x0F
+
+#define MAP_SEL_REG 0x03
+
+enum E_RTV_BANDWIDTH_TYPE {
+ RTV_BW_MODE_5MHZ = 0, /* DVB_T */
+ RTV_BW_MODE_6MHZ, /* DVB_T, FULLSEG, ISDB-Tmm */
+ RTV_BW_MODE_7MHZ, /* DVB_T, FULLSEG */
+ RTV_BW_MODE_8MHZ, /* DVB_T, FULLSEG */
+ RTV_BW_MODE_430KHZ, /* 1SEG at 6MHz BW */
+ RTV_BW_MODE_500KHZ, /* 1SEG at 7MHz BW */
+ RTV_BW_MODE_571KHZ, /* 1SEG at 8MHz BW */
+ RTV_BW_MODE_857KHZ, /* DAB */
+ RTV_BW_MODE_1290KHZ, /* 3SEG */
+ MAX_NUM_RTV_BW_MODE_TYPE
+};
+
+
+
+struct RTV_REG_INIT_INFO {
+ u8 bReg;
+ u8 bVal;
+};
+
+struct RTV_ADC_CFG_INFO {
+ u8 bData2A;
+ u8 bData6E;
+ u8 bData70;
+ u8 bData71;
+ u8 bData75;
+ u32 dwTNCO;
+ u32 dwPNCO;
+ u32 dwCFREQGAIN;
+ u16 dwGAIN;
+};
+
+#define RTV_ISDBT_OFDM_LOCK_MASK 0x1
+#define RTV_ISDBT_TMCC_LOCK_MASK 0x2
+#define RTV_ISDBT_CHANNEL_LOCK_OK \
+ (RTV_ISDBT_OFDM_LOCK_MASK|RTV_ISDBT_TMCC_LOCK_MASK)
+
+
+#define RSSI_UINT(val) (s32)((val)*10)
+
+#define RSSI_RFAGC_VAL(rfagc, coeffi)\
+ ((rfagc) * RSSI_UINT(coeffi))
+
+#define RSSI_GVBB_VAL(gvbb, coeffi)\
+ ((gvbb) * RSSI_UINT(coeffi))
+
+#endif
View
@@ -18,8 +18,41 @@
#include "tbsecp3.h"
struct tbsecp3_board tbsecp3_boards[] = {
+ [TBSECP3_BOARD_TBS6814] = {
+ .name = "Turbosight TBS 6814 (Quad ISDB-T/DVBT)",
+ .i2c_speed = 39,
+ .eeprom_i2c = 1,
+ .adapters = 4,
+ .adap_config ={
+
+ {
+ .ts_in = 0,
+ .i2c_bus_nr = 0,
+ .gpio.demod_reset.lvl = TBSECP3_GPIODEF_LOW,
+ .gpio.demod_reset.nr = TBSECP3_GPIO_PIN(0, 0),
+ },
+ {
+ .ts_in = 1,
+ .i2c_bus_nr = 1,
+ .gpio.demod_reset.lvl = TBSECP3_GPIODEF_LOW,
+ .gpio.demod_reset.nr = TBSECP3_GPIO_PIN(1, 0),
+ },
+ {
+ .ts_in = 2,
+ .i2c_bus_nr = 2,
+ .gpio.demod_reset.lvl = TBSECP3_GPIODEF_LOW,
+ .gpio.demod_reset.nr = TBSECP3_GPIO_PIN(2, 0),
+ },
+ {
+ .ts_in = 3,
+ .i2c_bus_nr = 3,
+ .gpio.demod_reset.lvl = TBSECP3_GPIODEF_LOW,
+ .gpio.demod_reset.nr = TBSECP3_GPIO_PIN(3, 0),
+ }
+ },
+ },
[TBSECP3_BOARD_TBS6209] = {
- .name = "Turbosight TBS 6209 (Octa DVB-T/T2/C2/C(j83-a/b/c) ISDB-T)",
+ .name = "Turbosight TBS 6209 (Octa DVB-T/T2/C2/C(j83-a/b/c)/ISDB-T)",
.i2c_speed = 39,
.eeprom_i2c = 0,
.adapters = 8,
View
@@ -328,6 +328,7 @@ static const struct pci_device_id tbsecp3_id_table[] = {
TBSECP3_ID(TBSECP3_BOARD_TBS6281SE),
TBSECP3_ID(TBSECP3_BOARD_TBS6704),
TBSECP3_ID(TBSECP3_BOARD_TBS6209),
+ TBSECP3_ID(TBSECP3_BOARD_TBS6814),
{0}
};
MODULE_DEVICE_TABLE(pci, tbsecp3_id_table);
View
@@ -33,6 +33,8 @@
#include "mn88436.h"
#include "mxl603.h"
+#include "mtv23x.h"
+
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
struct sec_priv {
@@ -362,7 +364,7 @@ static int tbsecp3_frontend_attach(struct tbsecp3_adapter *adapter)
struct si2157_config si2157_config;
struct mn88436_config mn88436_config;
struct mxl603_config mxl603_config;
-
+ struct mtv23x_config mtv23x_config;
//struct av201x_config av201x_config;
struct i2c_board_info info;
@@ -379,6 +381,28 @@ static int tbsecp3_frontend_attach(struct tbsecp3_adapter *adapter)
set_mac_address(adapter);
switch (pci->subsystem_vendor) {
+ case 0x6814:
+ memset(&mtv23x_config, 0, sizeof(mtv23x_config));
+ mtv23x_config.fe = &adapter->fe;
+ mtv23x_config.clk_freq = 32000;
+ mtv23x_config.ts_mode = 6;
+ mtv23x_config.i2c_wr_max = 32;
+
+ memset(&info, 0, sizeof(struct i2c_board_info));
+ strlcpy(info.type, "mtv23x", I2C_NAME_SIZE);
+ info.addr = (adapter->nr%2)? 0x44 : 0x43;
+ info.platform_data = &mtv23x_config;
+ request_module(info.type);
+ client_demod = i2c_new_device(i2c, &info);
+ if (client_demod == NULL ||
+ client_demod->dev.driver == NULL)
+ goto frontend_atach_fail;
+ if (!try_module_get(client_demod->dev.driver->owner)) {
+ i2c_unregister_device(client_demod);
+ goto frontend_atach_fail;
+ }
+ adapter->i2c_client_demod = client_demod;
+ break;
case 0x6209:
/* attach demod */
memset(&si2183_config, 0, sizeof(si2183_config));
View
@@ -56,6 +56,7 @@
#define TBSECP3_BOARD_TBS6281SE 0x6281
#define TBSECP3_BOARD_TBS6704 0x6704
#define TBSECP3_BOARD_TBS6209 0x6209
+#define TBSECP3_BOARD_TBS6814 0x6814
#define TBSECP3_MAX_ADAPTERS (8)
#define TBSECP3_MAX_I2C_BUS (4)