]> git.karo-electronics.de Git - linux-beck.git/commitdiff
V4L/DVB (11396): cx88: avoid reprogramming every audio register on A2 stereo/mono...
authorMarton Balint <cus@fazekas.hu>
Tue, 31 Mar 2009 22:01:53 +0000 (19:01 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 16 Jun 2009 22:14:18 +0000 (19:14 -0300)
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

Signed-off-by: Marton Balint <cus@fazekas.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx88/cx88-tvaudio.c

index 0a8699fa7292c6e51b49a8de4f7607715892009e..e8316cf7f32f70b8e76b78eac4569b205cddf15d 100644 (file)
@@ -916,20 +916,18 @@ void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual)
                                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;
                                }
                        }