From patchwork Mon Dec 13 18:19:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 5044 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Mon, 13 Dec 2010 16:20:27 -0200 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1PSD0d-0000l6-1s for mchehab@gaivota; Mon, 13 Dec 2010 16:20:27 -0200 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Mon, 13 Dec 2010 16:20:27 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PSCzq-0008AJ-UW; Mon, 13 Dec 2010 18:19:39 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757558Ab0LMSTh (ORCPT + 1 other); Mon, 13 Dec 2010 13:19:37 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:57896 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757501Ab0LMSTg (ORCPT ); Mon, 13 Dec 2010 13:19:36 -0500 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id BCFFF1C08A54; Mon, 13 Dec 2010 19:19:34 +0100 (CET) X-Auth-Info: B+v/WOEUrFw8ubwX1pL6JO2RsRtjfNWGHxY4MVcBjb0= Received: from localhost (p4FE3F5CB.dip.t-dialin.net [79.227.245.203]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 945401C000AC; Mon, 13 Dec 2010 19:19:34 +0100 (CET) From: Anatolij Gustschin To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , Hans Verkuil , Detlev Zundel Subject: [PATCH 1/2] media: saa7115: allow input standard autodetection for SAA7113 Date: Mon, 13 Dec 2010 19:19:36 +0100 Message-Id: <1292264377-31877-1-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.1 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab Autodetect input's standard using field frequency detection feature (FIDT in status byte at 0x1F) of the SAA7113. Signed-off-by: Anatolij Gustschin --- 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; + + return 0; + } + if (state->ident != V4L2_IDENT_SAA7115) return 0; reg1e = saa711x_read(sd, R_1E_STATUS_BYTE_1_VD_DEC);