All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cx25840 6.5MHz carrier detection fixes
@ 2009-09-25 21:16 Aleksandr V. Piskunov
  2009-09-26 20:12 ` Andy Walls
  2009-09-27 14:56 ` Andy Walls
  0 siblings, 2 replies; 4+ messages in thread
From: Aleksandr V. Piskunov @ 2009-09-25 21:16 UTC (permalink / raw)
  To: linux-media

cx25840:
Disable 6.5MHz carrier autodetection for PAL, always assume its DK.
Only try to autodetect 6.5MHz carrier for SECAM if user accepts both
system DK and L.

Signed-off-by: Aleksandr V. Piskunov <alexandr.v.piskunov@gmail.com>

diff --git a/linux/drivers/media/video/cx25840/cx25840-core.c b/linux/drivers/media/video/cx25840/cx25840-core.c
--- a/linux/drivers/media/video/cx25840/cx25840-core.c
+++ b/linux/drivers/media/video/cx25840/cx25840-core.c
@@ -647,13 +647,30 @@
                }
                cx25840_write(client, 0x80b, 0x00);
        } else if (std & V4L2_STD_PAL) {
-               /* Follow tuner change procedure for PAL */
+               /* Autodetect audio standard and audio system */
                cx25840_write(client, 0x808, 0xff);
-               cx25840_write(client, 0x80b, 0x10);
+               /* Since system PAL-L is pretty much non-existant and
+                  not used by any public broadcast network, force
+                  6.5 MHz carrier to be interpreted as System DK,
+                  this avoids DK audio detection instability */
+               cx25840_write(client, 0x80b, 0x00);
        } else if (std & V4L2_STD_SECAM) {
-               /* Select autodetect for SECAM */
+               /* Autodetect audio standard and audio system */
                cx25840_write(client, 0x808, 0xff);
-               cx25840_write(client, 0x80b, 0x10);
+               /* If only one of SECAM-DK / SECAM-L is required, then force
+                  6.5MHz carrier, else autodetect it */
+               if ((std & V4L2_STD_SECAM_DK) &&
+                   !(std & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC))) {
+                       /* 6.5 MHz carrier to be interpreted as System DK */
+                       cx25840_write(client, 0x80b, 0x00);
+               } else if (!(std & V4L2_STD_SECAM_DK) &&
+                          (std & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC))) {
+                       /* 6.5 MHz carrier to be interpreted as System L */
+                       cx25840_write(client, 0x80b, 0x08);
+               } else {
+                       /* 6.5 MHz carrier to be autodetected */
+                       cx25840_write(client, 0x80b, 0x10);
+               }
        }

        cx25840_and_or(client, 0x810, ~0x01, 0);


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-27 14:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-25 21:16 [PATCH] cx25840 6.5MHz carrier detection fixes Aleksandr V. Piskunov
2009-09-26 20:12 ` Andy Walls
2009-09-26 22:21   ` Aleksandr V. Piskunov
2009-09-27 14:56 ` Andy Walls

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.