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

Commit e0abc8cd authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (4729): Fix VIDIOC_G_FMT for NTSC in cx25840.



VIDIOC_G_FMT returned the sliced VBI types in the wrong lines for NTSC
(three lines too low).

Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 2e7cf3ea
Loading
Loading
Loading
Loading
+19 −6
Original line number Diff line number Diff line
@@ -235,6 +235,7 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
			0, 0, V4L2_SLICED_VPS, 0, 0,	/* 9 */
			0, 0, 0, 0
		};
		int is_pal = !(cx25840_get_v4lstd(client) & V4L2_STD_525_60);
		int i;

		fmt = arg;
@@ -246,6 +247,7 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
		if ((cx25840_read(client, 0x404) & 0x10) == 0)
			break;

		if (is_pal) {
			for (i = 7; i <= 23; i++) {
				u8 v = cx25840_read(client, 0x424 + i - 7);

@@ -254,6 +256,17 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
				svbi->service_set |=
					svbi->service_lines[0][i] | svbi->service_lines[1][i];
			}
		}
		else {
			for (i = 10; i <= 21; i++) {
				u8 v = cx25840_read(client, 0x424 + i - 10);

				svbi->service_lines[0][i] = lcr2vbi[v >> 4];
				svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
				svbi->service_set |=
					svbi->service_lines[0][i] | svbi->service_lines[1][i];
			}
		}
		break;
	}