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: 1527991 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by patchwork2.kernel.org (Postfix) with ESMTP id 03856DF280 for ; Sat, 29 Sep 2012 06:49:58 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8T6nwRD008666 for ; Sat, 29 Sep 2012 01:49:58 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8T6nwBK007873 for ; Sat, 29 Sep 2012 01:49:58 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Sat, 29 Sep 2012 01:49:57 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8T6nwDm008331 for ; Sat, 29 Sep 2012 01:49:58 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 4021180648 for ; Sat, 29 Sep 2012 01:49:57 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 92E4F80626 for ; Tue, 18 Sep 2012 05:53:30 -0500 (CDT) Received: from white.ext.ti.com (white.ext.ti.com [192.94.93.38]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8IArU0J019172 for ; Tue, 18 Sep 2012 05:53:30 -0500 (CDT) Received: from psmtp.com (na3sys009amx226.postini.com [74.125.149.110]) by white.ext.ti.com (8.13.7/8.13.7) with SMTP id q8IArTS8012660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 18 Sep 2012 05:53:29 -0500 Received: from ams-iport-3.cisco.com ([144.254.224.146]) (using TLSv1) by na3sys009amx226.postini.com ([74.125.148.10]) with SMTP; Tue, 18 Sep 2012 10:53:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2714; q=dns/txt; s=iport; t=1347965609; x=1349175209; h=from:to:cc:subject:date:message-id; bh=stNQu2f9GIVBF8FSYtynufcWXwOaDakZecSpDTnBaJM=; b=nHrRDeiMi3o7THpxQx06XaLuQ7m+CpQx9JSBRd82o+daHyl42Q5D/0GD MbE/8h5902ilSVg+QpWTh/v2FE8NICC4g74twlgMfdqgT0k3ChLylWyNS tNN0I/a+TqPVJbAB1/z+BYhEyid85BG7koDoE9GfVyzlQE9Bqeky/AvyO 4=; 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: 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: References: X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-dkim: 1 skipped:not-enabled X-pstn-settings: 2 (0.5000:0.0003) s cv gt3 GT2 gt1 r p m c X-pstn-addresses: from [82/3] X-Mailman-Approved-At: Sat, 29 Sep 2012 01:48:44 -0500 CC: DLOS X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com 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 */