mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: mchehab@infradead.org
To: linux-kernel@vger.kernel.org
Cc: linux-dvb-maintainer@linuxtv.org,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: [PATCH 04/18] V4L/DVB (4729): Fix VIDIOC_G_FMT for NTSC in cx25840.
Date: Sat, 14 Oct 2006 09:00:50 -0300	[thread overview]
Message-ID: <20061014120050.PS35870300004@infradead.org> (raw)
In-Reply-To: <20061014115356.PS36551000000@infradead.org>


From: Hans Verkuil <hverkuil@xs4all.nl>

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

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---

 drivers/media/video/cx25840/cx25840-vbi.c |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/media/video/cx25840/cx25840-vbi.c b/drivers/media/video/cx25840/cx25840-vbi.c
index 48014a2..f85f208 100644
--- a/drivers/media/video/cx25840/cx25840-vbi.c
+++ b/drivers/media/video/cx25840/cx25840-vbi.c
@@ -235,6 +235,7 @@ int cx25840_vbi(struct i2c_client *clien
 			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,13 +247,25 @@ int cx25840_vbi(struct i2c_client *clien
 		if ((cx25840_read(client, 0x404) & 0x10) == 0)
 			break;
 
-		for (i = 7; i <= 23; i++) {
-			u8 v = cx25840_read(client, 0x424 + i - 7);
+		if (is_pal) {
+			for (i = 7; i <= 23; i++) {
+				u8 v = cx25840_read(client, 0x424 + i - 7);
+
+				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];
+			}
+		}
+		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];
+				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;
 	}


  parent reply	other threads:[~2006-10-14 12:07 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-14 11:53 [PATCH 00/18] V4L/DVB fixes mchehab
2006-10-14 12:00 ` [PATCH 08/18] V4L/DVB (4734): Tda826x: fix frontend selection for dvb_attach mchehab
2006-10-14 12:16   ` Adrian Bunk
2006-10-14 18:10     ` Michael Krufky
2006-10-14 18:33       ` Adrian Bunk
2006-10-14 18:57         ` Michael Krufky
2006-10-14 19:14           ` Adrian Bunk
2006-10-15  1:55             ` Mauro Carvalho Chehab
2006-10-15 12:38               ` Adrian Bunk
2006-10-16  0:01                 ` [v4l-dvb-maintainer] " Trent Piepho
2006-10-14 12:00 ` [PATCH 02/18] V4L/DVB (4725): Fix vivi compile on parisc mchehab
2006-10-14 12:00 ` [PATCH 03/18] V4L/DVB (4727): Support status readout for saa713x based FM radio mchehab
2006-10-14 12:00 ` [PATCH 01/18] V4L/DVB (4692): Add WinTV-HVR3000 DVB-T support mchehab
2006-10-14 12:00 ` [PATCH 09/18] V4L/DVB (4738): Bt8xx/dvb-bt8xx.c: check kmalloc() return value mchehab
2006-10-14 12:00 ` [PATCH 06/18] V4L/DVB (4732): Fix spelling error in Kconfig help text for DVB_CORE_ATTACH mchehab
2006-10-14 12:00 ` [PATCH 07/18] V4L/DVB (4733): Tda10086: fix frontend selection for dvb_attach mchehab
2006-10-14 12:14   ` Adrian Bunk
2006-10-14 18:12     ` Michael Krufky
2006-10-14 18:33       ` Adrian Bunk
2006-10-14 12:00 ` [PATCH 05/18] V4L/DVB (4731a): Kconfig: restore pvrusb2 menu items mchehab
2006-10-14 12:00 ` mchehab [this message]
2006-10-14 12:00 ` [PATCH 17/18] V4L/DVB (4748): Fixed oops for Nova-T USB2 mchehab
2006-10-14 12:00 ` [PATCH 14/18] V4L/DVB (4743): Fix oops in VIDIOC_G_PARM mchehab
2006-10-14 12:00 ` [PATCH 11/18] V4L/DVB (4740): Fixed an if-block to avoid floating with debug-messages mchehab
2006-10-14 12:00 ` [PATCH 10/18] V4L/DVB (4739): SECAM support for saa7113 into saa7115 mchehab
2006-10-14 12:00 ` [PATCH 12/18] V4L/DVB (4741): {ov511,stv680}: handle sysfs errors mchehab
2006-10-14 12:00 ` [PATCH 18/18] V4L/DVB (4750): AGC command1/2 is board specific mchehab
2006-10-14 12:00 ` [PATCH 15/18] V4L/DVB (4744): The Samsung TCPN2121P30A does not have a tda9887 mchehab
2006-10-14 12:00 ` [PATCH 16/18] V4L/DVB (4746): HM12 is YUV 4:2:0, not YUV 4:1:1 mchehab
2006-10-14 12:00 ` [PATCH 13/18] V4L/DVB (4742): Drivers/media/video: handle sysfs errors mchehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061014120050.PS35870300004@infradead.org \
    --to=mchehab@infradead.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-dvb-maintainer@linuxtv.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®