From patchwork Tue Oct 13 15:12:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 53429 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9DFEEbs025858 for ; Tue, 13 Oct 2009 15:14:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760199AbZJMPNp (ORCPT ); Tue, 13 Oct 2009 11:13:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760163AbZJMPNl (ORCPT ); Tue, 13 Oct 2009 11:13:41 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:56826 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750914AbZJMPNj (ORCPT ); Tue, 13 Oct 2009 11:13:39 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9DFD0ZN013319 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 13 Oct 2009 10:13:03 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id n9DFCxHt028402; Tue, 13 Oct 2009 20:42:59 +0530 (IST) From: hvaibhav@ti.com To: linux-media@vger.kernel.org Cc: Vaibhav Hiremath , Brijesh Jadav Subject: [PATCH 6/6] TVP514x:Switch to automode for s_input/querystd Date: Tue, 13 Oct 2009 20:42:59 +0530 Message-Id: <1255446779-16969-1-git-send-email-hvaibhav@ti.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c index 2443726..0b0412d 100644 --- a/drivers/media/video/tvp514x.c +++ b/drivers/media/video/tvp514x.c @@ -523,10 +523,18 @@ static int tvp514x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std_id) enum tvp514x_std current_std; enum tvp514x_input input_sel; u8 sync_lock_status, lock_mask; + int err; if (std_id == NULL) return -EINVAL; + err = tvp514x_write_reg(sd, REG_VIDEO_STD, + VIDEO_STD_AUTO_SWITCH_BIT); + if (err < 0) + return err; + + msleep(LOCK_RETRY_DELAY); + /* get the current standard */ current_std = tvp514x_get_current_std(sd); if (current_std == STD_INVALID) @@ -643,6 +651,15 @@ static int tvp514x_s_routing(struct v4l2_subdev *sd, /* Index out of bound */ return -EINVAL; + /* Since this api is goint to detect the input, it is required + to set the standard in the auto switch mode */ + err = tvp514x_write_reg(sd, REG_VIDEO_STD, + VIDEO_STD_AUTO_SWITCH_BIT); + if (err < 0) + return err; + + msleep(LOCK_RETRY_DELAY); + input_sel = input; output_sel = output;