From patchwork Tue Sep 18 10:53:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 1471941 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3F48F400EC for ; Tue, 18 Sep 2012 10:53:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757963Ab2IRKxr (ORCPT ); Tue, 18 Sep 2012 06:53:47 -0400 Received: from ams-iport-3.cisco.com ([144.254.224.146]:42705 "EHLO ams-iport-3.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757961Ab2IRKx2 (ORCPT ); Tue, 18 Sep 2012 06:53:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2714; q=dns/txt; s=iport; t=1347965608; x=1349175208; h=from:to:cc:subject:date:message-id; bh=stNQu2f9GIVBF8FSYtynufcWXwOaDakZecSpDTnBaJM=; b=V1JsX71yUCF3CljJ88Rqd0dOPm/JEmUncqRTSzdrN5mDa9QDzGVdvWXv SFzoVHMXZa0UySeXYN0dJbaVlQlCaeXvYqqxjZJOsl4n3bhJsnf4bzOMr K6sbfaIy2nfHtjpqpREaJBnsh08BawQOKsi3wLZv4yecTNyNaOpp9REYC Q=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EALJRWFCQ/khR/2dsb2JhbABFvDOBB4IhAQEEEgEUUhBRVxkih16aIqA1jmqDHwOVYok1hQOBaYJo X-IronPort-AV: E=Sophos;i="4.80,442,1344211200"; d="scan'208";a="8120097" Received: from ams-core-1.cisco.com ([144.254.72.81]) by ams-iport-3.cisco.com with ESMTP; 18 Sep 2012 10:53:27 +0000 Received: from cobaltpc1.cisco.com (dhcp-10-54-92-107.cisco.com [10.54.92.107]) by ams-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id q8IArQ4R012350; Tue, 18 Sep 2012 10:53:27 GMT From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Prabhakar Lad , DLOS Subject: [RFCv1 PATCH 03/11] vpif_capture: move input_idx to channel_obj. Date: Tue, 18 Sep 2012 12:53:05 +0200 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1347965593-16746-1-git-send-email-hans.verkuil@cisco.com> References: <1347965593-16746-1-git-send-email-hans.verkuil@cisco.com> In-Reply-To: References: Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org input_idx does not belong to video_obj. Move it where it belongs. Also remove the bogus code in the open() function that suddenly changes the input to 0 for no reason. Signed-off-by: Hans Verkuil --- drivers/media/video/davinci/vpif_capture.c | 9 ++------- drivers/media/video/davinci/vpif_capture.h | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c index 313f461..eec687c 100644 --- a/drivers/media/video/davinci/vpif_capture.c +++ b/drivers/media/video/davinci/vpif_capture.c @@ -880,8 +880,6 @@ static int vpif_open(struct file *filep) if (vpif_obj.sd[i]) { /* the sub device is registered */ ch->curr_subdev_info = &config->subdev_info[i]; - /* make first input as the current input */ - vid_ch->input_idx = 0; break; } } @@ -1427,10 +1425,8 @@ static int vpif_g_input(struct file *file, void *priv, unsigned int *index) { struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; - struct video_obj *vid_ch = &ch->video; - - *index = vid_ch->input_idx; + *index = ch->input_idx; return 0; } @@ -1447,7 +1443,6 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index) struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; - struct video_obj *vid_ch = &ch->video; struct vpif_subdev_info *subdev_info; int ret = 0, sd_index = 0; u32 input = 0, output = 0; @@ -1502,7 +1497,7 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index) return ret; } } - vid_ch->input_idx = index; + ch->input_idx = index; ch->curr_subdev_info = subdev_info; ch->curr_sd_index = sd_index; /* copy interface parameters to vpif */ diff --git a/drivers/media/video/davinci/vpif_capture.h b/drivers/media/video/davinci/vpif_capture.h index de19c80..cf954f8 100644 --- a/drivers/media/video/davinci/vpif_capture.h +++ b/drivers/media/video/davinci/vpif_capture.h @@ -55,8 +55,6 @@ struct video_obj { /* Currently selected or default standard */ v4l2_std_id stdid; struct v4l2_dv_timings dv_timings; - /* This is to track the last input that is passed to application */ - u32 input_idx; }; struct vpif_cap_buffer { @@ -122,6 +120,8 @@ struct channel_obj { enum vpif_channel_id channel_id; /* index into sd table */ int curr_sd_index; + /* Current input */ + u32 input_idx; /* ptr to current sub device information */ struct vpif_subdev_info *curr_subdev_info; /* vpif configuration params */