All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Walls <awalls@radix.net>
To: "Aleksandr V. Piskunov" <aleksandr.v.piskunov@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] cx25840 6.5MHz carrier detection fixes
Date: Sun, 27 Sep 2009 10:56:56 -0400	[thread overview]
Message-ID: <1254063416.3152.28.camel@palomino.walls.org> (raw)
In-Reply-To: <20090925211621.GA15452@moon>

On Sat, 2009-09-26 at 00:16 +0300, Aleksandr V. Piskunov wrote:
> 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>

Aleksandr,

Looks good for CX2584[0123] chips.

It is not right for CX2388[578] or CX2310[12] chips, but the original
code doesn't do the right thing anyway for those chips, AFAICT.  In
those chips auto-detection of DK vs. L for 6.5 MHz sound carriers
doesn't appear to exist, and hence the bit positions and meanings have
changed slightly.  Your fix get us closer to doing the right thing for
those devices.  The rest of the fix for those devices is for another
day...

Reviewed-by: Andy Walls <awalls@radix.net>


> 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);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


      parent reply	other threads:[~2009-09-27 14:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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=1254063416.3152.28.camel@palomino.walls.org \
    --to=awalls@radix.net \
    --cc=aleksandr.v.piskunov@gmail.com \
    --cc=linux-media@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 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.