From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Anatolij Gustschin <agust@denx.de>
Cc: linux-media@vger.kernel.org, Hans Verkuil <hverkuil@xs4all.nl>,
Detlev Zundel <dzu@denx.de>
Subject: Re: [1/2] media: saa7115: allow input standard autodetection for SAA7113
Date: Wed, 22 Dec 2010 14:50:27 -0200 [thread overview]
Message-ID: <4D122C53.4070300@redhat.com> (raw)
In-Reply-To: <1292264377-31877-1-git-send-email-agust@denx.de>
Em 13-12-2010 16:19, Anatolij Gustschin escreveu:
> Autodetect input's standard using field frequency detection
> feature (FIDT in status byte at 0x1F) of the SAA7113.
>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
>
> ---
> drivers/media/video/saa7115.c | 12 ++++++++++++
> 1 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
> index 301c62b..f28a4c7 100644
> --- a/drivers/media/video/saa7115.c
> +++ b/drivers/media/video/saa7115.c
> @@ -1348,6 +1348,18 @@ static int saa711x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
> int reg1e;
>
> *std = V4L2_STD_ALL;
> +
> + if (state->ident == V4L2_IDENT_SAA7113) {
> + int reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC);
> +
> + if (reg1f & 0x20)
> + *std = V4L2_STD_NTSC;
> + else
> + *std = V4L2_STD_PAL;
This is wrong. The meaning of bit 5 of reg 0x1f is if the standard is 50Hz
or 60Hz based (so, it detects the monocromatic standard, not the color
standard). So, instead, it should be doing:
if (reg1f & 0x20)
*std = V4L2_STD_525_60;
else
*std = V4L2_STD_625_50;
Also, this kind of detection could be used also for the other supported chips
on this driver (I checked datasheets of saa7111/saa7111a/saa7114/saa7118).
So, the better is to code it as:
if (state->ident != V4L2_IDENT_SAA7115) {
int reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC);
if (reg1f & 0x20)
*std = V4L2_STD_525_60;
else
*std = V4L2_STD_625_50;
return 0;
}
> +
> + return 0;
> + }
> +
> if (state->ident != V4L2_IDENT_SAA7115)
> return 0;
> reg1e = saa711x_read(sd, R_1E_STATUS_BYTE_1_VD_DEC);
>
next prev parent reply other threads:[~2010-12-22 16:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-13 18:19 [PATCH 1/2] media: saa7115: allow input standard autodetection for SAA7113 Anatolij Gustschin
2010-12-13 18:19 ` [PATCH 2/2] media: fsl_viu: add VIDIOC_QUERYSTD and VIDIOC_G_STD support Anatolij Gustschin
2010-12-22 17:03 ` [2/2] " Mauro Carvalho Chehab
2010-12-22 16:50 ` Mauro Carvalho Chehab [this message]
2010-12-22 20:31 ` [PATCH v2 1/2] media: saa7115: allow input standard autodetection for more chips Anatolij Gustschin
2010-12-22 20:31 ` [PATCH v2 2/2] media: fsl_viu: add VIDIOC_QUERYSTD and VIDIOC_G_STD support Anatolij Gustschin
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=4D122C53.4070300@redhat.com \
--to=mchehab@redhat.com \
--cc=agust@denx.de \
--cc=dzu@denx.de \
--cc=hverkuil@xs4all.nl \
--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.