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

Commit d9cd2d9b authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (4314): Set the Auxiliary Byte when tuning LG H06xF in analog mode



With the LG H06xF tuners, an auxiliary byte must be sent after the
standard four-byte i2c sequence. The code that does this is currently in
the wrong place, causing random bytes to be written to the tuner over
i2c in the set_type function.
This patch moves this code from set_type to default_set_tv_freq.

Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent a62c61d3
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -196,14 +196,6 @@ static void set_type(struct i2c_client *c, unsigned int type,
		i2c_master_send(c, buffer, 4);
		default_tuner_init(c);
		break;
	case TUNER_LG_TDVS_H06XF:
		/* Set the Auxiliary Byte. */
		buffer[2] &= ~0x20;
		buffer[2] |= 0x18;
		buffer[3] = 0x20;
		i2c_master_send(c, buffer, 4);
		default_tuner_init(c);
		break;
	case TUNER_PHILIPS_TD1316:
		buffer[0] = 0x0b;
		buffer[1] = 0xdc;
+17 −2
Original line number Diff line number Diff line
@@ -339,7 +339,20 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
	if (4 != (rc = i2c_master_send(c,buffer,4)))
		tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);

	if (t->type == TUNER_MICROTUNE_4042FI5) {
	switch (t->type) {
	case TUNER_LG_TDVS_H06XF:
		/* Set the Auxiliary Byte. */
		buffer[0] = buffer[2];
		buffer[0] &= ~0x20;
		buffer[0] |= 0x18;
		buffer[1] = 0x20;
		tuner_dbg("tv 0x%02x 0x%02x\n",buffer[0],buffer[1]);

		if (2 != (rc = i2c_master_send(c,buffer,2)))
			tuner_warn("i2c i/o error: rc == %d (should be 2)\n",rc);
		break;
	case TUNER_MICROTUNE_4042FI5:
	{
		// FIXME - this may also work for other tuners
		unsigned long timeout = jiffies + msecs_to_jiffies(1);
		u8 status_byte = 0;
@@ -368,6 +381,8 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)

		if (4 != (rc = i2c_master_send(c,buffer,4)))
			tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);
		break;
	}
	}
}