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

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

[media] si2168: add ts_mode setting and move to si2168_init



Luis Alves submitted a TS mode patch to si2168 earlier, but the
patch was rejected due to a small issue. Here is a working version.
Also, setting of TS mode is moved from si2168_set_frontend to
si2168_init.

This patch adds the TS mode as a config option for the si2168 demod:
- ts_mode added to config struct.
- Possible (interesting) values are
   * Parallel mode = 0x06
   * Serial mode = 0x03

Currently the modules using this demod only use parallel mode.
Patches for these modules later in this patch series.

Signed-off-by: default avatarOlli Salonen <olli.salonen@iki.fi>
Reviewed-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 79d09330
Loading
Loading
Loading
Loading
+10 −7
Original line number Original line Diff line number Diff line
@@ -296,13 +296,6 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
	if (ret)
	if (ret)
		goto err;
		goto err;


	memcpy(cmd.args, "\x14\x00\x01\x10\x16\x00", 6);
	cmd.wlen = 6;
	cmd.rlen = 4;
	ret = si2168_cmd_execute(s, &cmd);
	if (ret)
		goto err;

	memcpy(cmd.args, "\x14\x00\x09\x10\xe3\x18", 6);
	memcpy(cmd.args, "\x14\x00\x09\x10\xe3\x18", 6);
	cmd.wlen = 6;
	cmd.wlen = 6;
	cmd.rlen = 4;
	cmd.rlen = 4;
@@ -464,6 +457,15 @@ static int si2168_init(struct dvb_frontend *fe)
	dev_info(&s->client->dev, "found a '%s' in warm state\n",
	dev_info(&s->client->dev, "found a '%s' in warm state\n",
			si2168_ops.info.name);
			si2168_ops.info.name);


	/* set ts mode */
	memcpy(cmd.args, "\x14\x00\x01\x10\x10\x00", 6);
	cmd.args[4] |= s->ts_mode;
	cmd.wlen = 6;
	cmd.rlen = 4;
	ret = si2168_cmd_execute(s, &cmd);
	if (ret)
		goto err;

	s->active = true;
	s->active = true;


	return 0;
	return 0;
@@ -630,6 +632,7 @@ static int si2168_probe(struct i2c_client *client,


	*config->i2c_adapter = s->adapter;
	*config->i2c_adapter = s->adapter;
	*config->fe = &s->fe;
	*config->fe = &s->fe;
	s->ts_mode = config->ts_mode;


	i2c_set_clientdata(client, s);
	i2c_set_clientdata(client, s);


+6 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,12 @@ struct si2168_config {
	 * returned by driver
	 * returned by driver
	 */
	 */
	struct i2c_adapter **i2c_adapter;
	struct i2c_adapter **i2c_adapter;

	/* TS mode */
	u8 ts_mode;
};
};


#define SI2168_TS_PARALLEL	0x06
#define SI2168_TS_SERIAL	0x03

#endif
#endif
+1 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ struct si2168 {
	fe_delivery_system_t delivery_system;
	fe_delivery_system_t delivery_system;
	fe_status_t fe_status;
	fe_status_t fe_status;
	bool active;
	bool active;
	u8 ts_mode;
};
};


/* firmare command struct */
/* firmare command struct */