Skip to content

Commit

Permalink
cx23885: add support for TeVii S472 DVB-S2 tuner
Browse files Browse the repository at this point in the history
TeVii S472 is a PCIe DVB-S/DVB-S2 tuner.

PCIe bridge: CX23885
Demodulator: Montage M88DS3103
Tuner: Montage M88TS2022

Firmware is required for the demodulator:
http://palosaari.fi/linux/v4l-dvb/firmware/M88DS3103/3.B/
  • Loading branch information
trsqr committed Apr 25, 2016
1 parent e07d46e commit b59f25b
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Documentation/video4linux/CARDLIST.cx23885
Expand Up @@ -52,3 +52,6 @@
51 -> DVBSky T982 [4254:0982]
52 -> Hauppauge WinTV-HVR5525 [0070:f038]
53 -> Hauppauge WinTV Starburst [0070:c12a]
54 -> Viewcast 260e [1576:0260]
55 -> Viewcast 460e [1576:0460]
56 -> TeVii S472 [d472:9022]
9 changes: 9 additions & 0 deletions drivers/media/pci/cx23885/cx23885-cards.c
Expand Up @@ -609,6 +609,10 @@ struct cx23885_board cx23885_boards[] = {
.name = "TeVii S471",
.portb = CX23885_MPEG_DVB,
},
[CX23885_BOARD_TEVII_S472] = {
.name = "TeVii S472",
.portb = CX23885_MPEG_DVB,
},
[CX23885_BOARD_PROF_8000] = {
.name = "Prof Revolution DVB-S2 8000",
.portb = CX23885_MPEG_DVB,
Expand Down Expand Up @@ -988,6 +992,10 @@ struct cx23885_subid cx23885_subids[] = {
.subvendor = 0xd471,
.subdevice = 0x9022,
.card = CX23885_BOARD_TEVII_S471,
}, {
.subvendor = 0xd472,
.subdevice = 0x9022,
.card = CX23885_BOARD_TEVII_S472,
}, {
.subvendor = 0x8000,
.subdevice = 0x3034,
Expand Down Expand Up @@ -2062,6 +2070,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
break;
case CX23885_BOARD_TEVII_S470:
case CX23885_BOARD_TEVII_S471:
case CX23885_BOARD_TEVII_S472:
case CX23885_BOARD_DVBWORLD_2005:
case CX23885_BOARD_PROF_8000:
case CX23885_BOARD_DVBSKY_T980C:
Expand Down
46 changes: 46 additions & 0 deletions drivers/media/pci/cx23885/cx23885-dvb.c
Expand Up @@ -923,6 +923,19 @@ static const struct m88ds3103_config hauppauge_hvr5525_m88ds3103_config = {
.agc = 0x99,
};

static const struct m88ds3103_config tevii_s472_m88ds3103_config = {
.i2c_addr = 0x68,
.clock = 27000000,
.i2c_wr_max = 33,
.clock_out = 0,
.ts_mode = M88DS3103_TS_PARALLEL,
.ts_clk = 16000,
.ts_clk_pol = 0,
.lnb_en_pol = 0,
.lnb_hv_pol = 1,
.agc = 0x99,
};

static int netup_altera_fpga_rw(void *device, int flag, int data, int read)
{
struct cx23885_dev *dev = (struct cx23885_dev *)device;
Expand Down Expand Up @@ -1780,6 +1793,39 @@ static int dvb_register(struct cx23885_tsport *port)
dvb_attach(ts2020_attach, fe0->dvb.frontend,
&tevii_ts2020_config, &i2c_bus->i2c_adap);
break;
case CX23885_BOARD_TEVII_S472:
i2c_bus = &dev->i2c_bus[1];

/* attach frontend */
fe0->dvb.frontend = dvb_attach(m88ds3103_attach,
&tevii_s472_m88ds3103_config,
&i2c_bus->i2c_adap, &adapter);
if (fe0->dvb.frontend == NULL)
break;

/* attach tuner */
memset(&ts2020_config, 0, sizeof(ts2020_config));
ts2020_config.fe = fe0->dvb.frontend;
ts2020_config.get_agc_pwm = m88ds3103_get_agc_pwm;
memset(&info, 0, sizeof(struct i2c_board_info));
strlcpy(info.type, "ts2020", I2C_NAME_SIZE);
info.addr = 0x60;
info.platform_data = &ts2020_config;
request_module(info.type);
client_tuner = i2c_new_device(adapter, &info);
if (client_tuner == NULL || client_tuner->dev.driver == NULL)
goto frontend_detach;
if (!try_module_get(client_tuner->dev.driver->owner)) {
i2c_unregister_device(client_tuner);
goto frontend_detach;
}

/* delegate signal strength measurement to tuner */
fe0->dvb.frontend->ops.read_signal_strength =
fe0->dvb.frontend->ops.tuner_ops.get_rf_strength;

port->i2c_client_tuner = client_tuner;
break;
case CX23885_BOARD_PROF_8000:
i2c_bus = &dev->i2c_bus[0];

Expand Down
1 change: 1 addition & 0 deletions drivers/media/pci/cx23885/cx23885.h
Expand Up @@ -103,6 +103,7 @@
#define CX23885_BOARD_HAUPPAUGE_STARBURST 53
#define CX23885_BOARD_VIEWCAST_260E 54
#define CX23885_BOARD_VIEWCAST_460E 55
#define CX23885_BOARD_TEVII_S472 56

#define GPIO_0 0x00000001
#define GPIO_1 0x00000002
Expand Down

0 comments on commit b59f25b

Please sign in to comment.