Linux Media Controller development
 help / color / mirror / Atom feed
From: Marton Balint <cus@fazekas.hu>
To: linux-media@vger.kernel.org
Cc: mchehab@infradead.org
Subject: [PATCH 3 of 3] cx88: avoid reprogramming every audio register on A2 stereo/mono change
Date: Wed, 01 Apr 2009 00:01:53 +0200	[thread overview]
Message-ID: <119acaa1dee387960325.1238536913@roadrunner.athome> (raw)
In-Reply-To: <patchbomb.1238536910@roadrunner.athome>

# HG changeset patch
# User Marton Balint <cus@fazekas.hu>
# Date 1238535357 -7200
# Node ID 119acaa1dee387960325ba637c6257af2b0fd3af
# Parent  d2cbecf047e8f45f49f20bd19b95dfd86c134e33
cx88: avoid reprogramming every audio register on A2 stereo/mono change

From: Marton Balint <cus@fazekas.hu>

This patch changes cx88_set_stereo to avoid resetting all of the audio
registers on stereo/mono change if the audio standard is A2, and set only the
AUD_CTL register. The benefit of this method is that it eliminates the annoying
clicking noise on setting the audio mode to stereo or mono.

The driver had used the same method 1.5 years ago (and for FM radio it still
does), but a pretty big cleanup commit changed it to the "complete audio reset"
method, although the reason for this move was not clear. (If somebody knows why
it was necessary, please let me know!)

The original commit: http://linuxtv.org/hg/v4l-dvb/rev/ffe313541d7d

Priority: normal

Signed-off-by: Marton Balint <cus@fazekas.hu>

diff -r d2cbecf047e8 -r 119acaa1dee3 linux/drivers/media/video/cx88/cx88-tvaudio.c
--- a/linux/drivers/media/video/cx88/cx88-tvaudio.c	Tue Mar 31 03:21:56 2009 +0200
+++ b/linux/drivers/media/video/cx88/cx88-tvaudio.c	Tue Mar 31 23:35:57 2009 +0200
@@ -938,20 +938,18 @@
 				set_audio_standard_A2(core, EN_A2_FORCE_MONO1);
 			} else {
 				/* TODO: Add A2 autodection */
+				mask = 0x3f;
 				switch (mode) {
 				case V4L2_TUNER_MODE_MONO:
 				case V4L2_TUNER_MODE_LANG1:
-					set_audio_standard_A2(core,
-							      EN_A2_FORCE_MONO1);
+					ctl = EN_A2_FORCE_MONO1;
 					break;
 				case V4L2_TUNER_MODE_LANG2:
-					set_audio_standard_A2(core,
-							      EN_A2_FORCE_MONO2);
+					ctl = EN_A2_FORCE_MONO2;
 					break;
 				case V4L2_TUNER_MODE_STEREO:
 				case V4L2_TUNER_MODE_LANG1_LANG2:
-					set_audio_standard_A2(core,
-							      EN_A2_FORCE_STEREO);
+					ctl = EN_A2_FORCE_STEREO;
 					break;
 				}
 			}

      parent reply	other threads:[~2009-03-31 22:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31 22:01 [PATCH 0 of 3] cx88: add stereo/sap detection for A2 Marton Balint
2009-03-31 22:01 ` [PATCH 1 of 3] cx88: Add support for stereo and sap " Marton Balint
2009-04-05 22:02   ` Mauro Carvalho Chehab
2009-04-06  0:36     ` Marton Balint
2009-04-06  1:23       ` Mauro Carvalho Chehab
2009-03-31 22:01 ` [PATCH 2 of 3] cx88: audio thread: if stereo detection is hw supported don't do it manually Marton Balint
2009-03-31 22:01 ` Marton Balint [this message]

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=119acaa1dee387960325.1238536913@roadrunner.athome \
    --to=cus@fazekas.hu \
    --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