Linux Media Controller development
 help / color / mirror / Atom feed
From: "Daniel Glöckner" <daniel-gl@gmx.net>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: linux-media@vger.kernel.org, "Daniel Glöckner" <daniel-gl@gmx.net>
Subject: [PATCH 9/9] tvaudio: don't report mono when stereo is received
Date: Sun, 10 Jun 2012 03:43:58 +0200	[thread overview]
Message-ID: <1339292638-12205-10-git-send-email-daniel-gl@gmx.net> (raw)
In-Reply-To: <20120609214100.GA1598@minime.bse>

The V4L2 spec says reporting mono and stereo at the same time means
the hardware can not distinguish between the two. So when we can,
we should report only one of them.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
---
 drivers/media/video/tvaudio.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index f3ce93a..1e61cbf 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -383,7 +383,7 @@ static int tda9840_getmode(struct CHIPSTATE *chip)
 	if (val & TDA9840_DS_DUAL)
 		mode |= V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
 	if (val & TDA9840_ST_STEREO)
-		mode |= V4L2_TUNER_SUB_STEREO;
+		mode = V4L2_TUNER_SUB_STEREO;
 
 	v4l2_dbg(1, debug, sd, "tda9840_getmode(): raw chip read: %d, return: %d\n",
 		val, mode);
@@ -541,7 +541,7 @@ static int  tda985x_getmode(struct CHIPSTATE *chip)
 	mode = V4L2_TUNER_SUB_MONO;
 	val = chip_read(chip);
 	if (val & TDA985x_STP)
-		mode |= V4L2_TUNER_SUB_STEREO;
+		mode = V4L2_TUNER_SUB_STEREO;
 	if (val & TDA985x_SAPP)
 		mode |= V4L2_TUNER_SUB_SAP;
 	return mode;
@@ -700,7 +700,7 @@ static int tda9873_getmode(struct CHIPSTATE *chip)
 	val = chip_read(chip);
 	mode = V4L2_TUNER_SUB_MONO;
 	if (val & TDA9873_STEREO)
-		mode |= V4L2_TUNER_SUB_STEREO;
+		mode = V4L2_TUNER_SUB_STEREO;
 	if (val & TDA9873_DUAL)
 		mode |= V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
 	v4l2_dbg(1, debug, sd, "tda9873_getmode(): raw chip read: %d, return: %d\n",
@@ -918,12 +918,12 @@ static int tda9874a_getmode(struct CHIPSTATE *chip)
 		 * external 4052 multiplexer in audio_hook().
 		 */
 		if(nsr & 0x02) /* NSR.S/MB=1 */
-			mode |= V4L2_TUNER_SUB_STEREO;
+			mode = V4L2_TUNER_SUB_STEREO;
 		if(nsr & 0x01) /* NSR.D/SB=1 */
 			mode |= V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
 	} else {
 		if(dsr & 0x02) /* DSR.IDSTE=1 */
-			mode |= V4L2_TUNER_SUB_STEREO;
+			mode = V4L2_TUNER_SUB_STEREO;
 		if(dsr & 0x04) /* DSR.IDDUA=1 */
 			mode |= V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
 	}
@@ -1350,7 +1350,7 @@ static int ta8874z_getmode(struct CHIPSTATE *chip)
 	if (val & TA8874Z_B1){
 		mode |= V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
 	}else if (!(val & TA8874Z_B0)){
-		mode |= V4L2_TUNER_SUB_STEREO;
+		mode = V4L2_TUNER_SUB_STEREO;
 	}
 	/* v4l_dbg(1, debug, chip->c, "ta8874z_getmode(): raw chip read: 0x%02x, return: 0x%02x\n", val, mode); */
 	return mode;
-- 
1.7.0.5


  parent reply	other threads:[~2012-06-10  1:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06  7:06 question about bt8xx/bttv-audio-hook.c, tvaudio.c Julia Lawall
2012-06-09  8:05 ` Hans Verkuil
2012-06-09 21:41   ` Daniel Glöckner
2012-06-10  1:43     ` Some tvaudio fixes Daniel Glöckner
2012-06-10  6:28       ` Hans Verkuil
2012-06-17 11:53         ` [PATCH] tvaudio: rename getmode and setmode Daniel Glöckner
2012-06-17 12:08           ` Hans Verkuil
2012-06-10  1:43     ` [PATCH 1/9] tvaudio: fix TDA9873 constants Daniel Glöckner
2012-06-10  1:43     ` [PATCH 2/9] tvaudio: fix tda8425_setmode Daniel Glöckner
2012-06-10  1:43     ` [PATCH 3/9] tvaudio: use V4L2_TUNER_MODE_SAP for TDA985x SAP Daniel Glöckner
2012-06-10  1:43     ` [PATCH 4/9] tvaudio: remove watch_stereo Daniel Glöckner
2012-06-10  1:43     ` [PATCH 5/9] tvaudio: don't use thread for TA8874Z Daniel Glöckner
2012-06-10  1:43     ` [PATCH 6/9] tvaudio: use V4L2_TUNER_SUB_* for bitfields Daniel Glöckner
2012-06-10  1:43     ` [PATCH 7/9] tvaudio: obey V4L2 tuner audio matrix Daniel Glöckner
2012-06-10  1:43     ` [PATCH 8/9] tvaudio: support V4L2_TUNER_MODE_LANG1_LANG2 Daniel Glöckner
2012-06-10  1:43     ` Daniel Glöckner [this message]
2012-06-10 16:55   ` question about bt8xx/bttv-audio-hook.c, tvaudio.c Julia Lawall

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=1339292638-12205-10-git-send-email-daniel-gl@gmx.net \
    --to=daniel-gl@gmx.net \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.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