From patchwork Mon Jan 4 14:02:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hiremath, Vaibhav" X-Patchwork-Id: 2400 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Mon, 04 Jan 2010 14:03:28 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Tue, 05 Jan 2010 12:05:54 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NRnWq-0008C6-75; Mon, 04 Jan 2010 14:03:28 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753427Ab0ADODQ (ORCPT + 1 other); Mon, 4 Jan 2010 09:03:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753386Ab0ADODO (ORCPT ); Mon, 4 Jan 2010 09:03:14 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:45602 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752842Ab0ADODM (ORCPT ); Mon, 4 Jan 2010 09:03:12 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o04E39DA013740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Jan 2010 08:03:11 -0600 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o04E32WR015051; Mon, 4 Jan 2010 19:33:04 +0530 (IST) From: hvaibhav@ti.com To: linux-media@vger.kernel.org Cc: linux-omap@vger.kernel.org, hverkuil@xs4all.nl, davinci-linux-open-source@linux.davincidsp.com, m-karicheri2@ti.com, Vaibhav Hiremath Subject: [PATCH 2/9] TVP514x:Switch to automode for querystd Date: Mon, 4 Jan 2010 19:32:55 +0530 Message-Id: <1262613782-20463-3-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 From: Vaibhav Hiremath Driver should switch to AutoSwitch mode on QUERYSTD ioctls. It has been observed that, if user configure the standard explicitely then driver preserves the old settings, but query_std must detect the standard instead of returning old settings. Signed-off-by: Vaibhav Hiremath --- drivers/media/video/tvp514x.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c index 26b4e71..4cf3593 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)