Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee3c3e46 authored by Olli Salonen's avatar Olli Salonen Committed by Mauro Carvalho Chehab
Browse files

[media] si2157: support selection of IF interface



The chips supported by the si2157 driver have two IF outputs (either
pins 12+13 or pins 9+11). Instead of hardcoding the output to be used
add an option to choose which output shall be used.

As this patch changes the default behaviour, the IF interface is
specified in each driver currently using si2157 driver. This is to
keep bisectability.

Signed-off-by: default avatarOlli Salonen <olli.salonen@iki.fi>
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 7adf99d2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1912,6 +1912,7 @@ static int dvb_register(struct cx23885_tsport *port)
			/* attach tuner */
			memset(&si2157_config, 0, sizeof(si2157_config));
			si2157_config.fe = fe0->dvb.frontend;
			si2157_config.if_port = 1;
			memset(&info, 0, sizeof(struct i2c_board_info));
			strlcpy(info.type, "si2157", I2C_NAME_SIZE);
			info.addr = 0x60;
@@ -1957,6 +1958,7 @@ static int dvb_register(struct cx23885_tsport *port)
		/* attach tuner */
		memset(&si2157_config, 0, sizeof(si2157_config));
		si2157_config.fe = fe0->dvb.frontend;
		si2157_config.if_port = 1;
		memset(&info, 0, sizeof(struct i2c_board_info));
		strlcpy(info.type, "si2157", I2C_NAME_SIZE);
		info.addr = 0x60;
@@ -2093,6 +2095,7 @@ static int dvb_register(struct cx23885_tsport *port)
		/* attach tuner */
		memset(&si2157_config, 0, sizeof(si2157_config));
		si2157_config.fe = fe0->dvb.frontend;
		si2157_config.if_port = 1;
		memset(&info, 0, sizeof(struct i2c_board_info));
		strlcpy(info.type, "si2157", I2C_NAME_SIZE);
		info.addr = 0x60;
@@ -2172,6 +2175,7 @@ static int dvb_register(struct cx23885_tsport *port)
			/* attach tuner */
			memset(&si2157_config, 0, sizeof(si2157_config));
			si2157_config.fe = fe0->dvb.frontend;
			si2157_config.if_port = 1;
			memset(&info, 0, sizeof(struct i2c_board_info));
			strlcpy(info.type, "si2157", I2C_NAME_SIZE);
			info.addr = 0x60;
+3 −0
Original line number Diff line number Diff line
@@ -111,6 +111,7 @@ static struct lgdt3306a_config hauppauge_hvr2255b_config = {

static struct si2157_config hauppauge_hvr2255_tuner_config = {
	.inversion = 1,
	.if_port = 1,
};

static int si2157_attach(struct saa7164_port *port, struct i2c_adapter *adapter,
@@ -665,6 +666,7 @@ int saa7164_dvb_register(struct saa7164_port *port)

			/* attach tuner */
			memset(&si2157_config, 0, sizeof(si2157_config));
			si2157_config.if_port = 1;
			si2157_config.fe = port->dvb.frontend;
			memset(&info, 0, sizeof(struct i2c_board_info));
			strlcpy(info.type, "si2157", I2C_NAME_SIZE);
@@ -710,6 +712,7 @@ int saa7164_dvb_register(struct saa7164_port *port)
			/* attach tuner */
			memset(&si2157_config, 0, sizeof(si2157_config));
			si2157_config.fe = port->dvb.frontend;
			si2157_config.if_port = 1;
			memset(&info, 0, sizeof(struct i2c_board_info));
			strlcpy(info.type, "si2157", I2C_NAME_SIZE);
			info.addr = 0xc0 >> 1;
+1 −0
Original line number Diff line number Diff line
@@ -657,6 +657,7 @@ static int smi_dvbsky_sit2_fe_attach(struct smi_port *port)
	/* attach tuner */
	memset(&si2157_config, 0, sizeof(si2157_config));
	si2157_config.fe = port->fe;
	si2157_config.if_port = 1;

	memset(&client_info, 0, sizeof(struct i2c_board_info));
	strlcpy(client_info.type, "si2157", I2C_NAME_SIZE);
+3 −1
Original line number Diff line number Diff line
@@ -298,7 +298,8 @@ static int si2157_set_params(struct dvb_frontend *fe)
	if (dev->chiptype == SI2157_CHIPTYPE_SI2146)
		memcpy(cmd.args, "\x14\x00\x02\x07\x00\x01", 6);
	else
		memcpy(cmd.args, "\x14\x00\x02\x07\x01\x00", 6);
		memcpy(cmd.args, "\x14\x00\x02\x07\x00\x00", 6);
	cmd.args[4] = dev->if_port;
	cmd.wlen = 6;
	cmd.rlen = 4;
	ret = si2157_cmd_execute(client, &cmd);
@@ -378,6 +379,7 @@ static int si2157_probe(struct i2c_client *client,
	i2c_set_clientdata(client, dev);
	dev->fe = cfg->fe;
	dev->inversion = cfg->inversion;
	dev->if_port = cfg->if_port;
	dev->fw_loaded = false;
	dev->chiptype = (u8)id->driver_data;
	dev->if_frequency = 5000000; /* default value of property 0x0706 */
+6 −0
Original line number Diff line number Diff line
@@ -34,6 +34,12 @@ struct si2157_config {
	 * Spectral Inversion
	 */
	bool inversion;

	/*
	 * Port selection
	 * Select the RF interface to use (pins 9+11 or 12+13)
	 */
	u8 if_port;
};

#endif
Loading