From patchwork Thu Sep 20 12:06:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 1483941 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by patchwork2.kernel.org (Postfix) with ESMTP id 2E93FDF2D2 for ; Thu, 20 Sep 2012 12:10:16 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8KC8UlK007936; Thu, 20 Sep 2012 07:08:30 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8KC8UTY012227; Thu, 20 Sep 2012 07:08:30 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Thu, 20 Sep 2012 07:08:29 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8KC8TD8015665; Thu, 20 Sep 2012 07:08:29 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id D682B80628; Thu, 20 Sep 2012 07:08:29 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 0CA4B80626 for ; Thu, 20 Sep 2012 07:07:19 -0500 (CDT) Received: from white.ext.ti.com (white.ext.ti.com [192.94.93.38]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id q8KC7IsK001566 for ; Thu, 20 Sep 2012 07:07:18 -0500 (CDT) Received: from psmtp.com (na3sys009amx188.postini.com [74.125.149.169]) by white.ext.ti.com (8.13.7/8.13.7) with SMTP id q8KC7Io6020786 for ; Thu, 20 Sep 2012 07:07:18 -0500 Received: from smtp-vbr11.xs4all.nl ([194.109.24.31]) by na3sys009amx188.postini.com ([74.125.148.10]) with SMTP; Thu, 20 Sep 2012 05:07:18 PDT Received: from alastor.dyndns.org (166.80-203-20.nextgentel.com [80.203.20.166] (may be forged)) (authenticated bits=0) by smtp-vbr11.xs4all.nl (8.13.8/8.13.8) with ESMTP id q8KC6dPK034078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 20 Sep 2012 14:06:40 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) Received: from tschai.lan (tschai.lan [192.168.1.10]) (Authenticated sender: hans) by alastor.dyndns.org (Postfix) with ESMTPSA id 7425235C0147; Thu, 20 Sep 2012 14:06:38 +0200 (CEST) From: Hans Verkuil To: Subject: [RFCv2 PATCH 04/14] vpif_display: move output_id to channel_obj. Date: Thu, 20 Sep 2012 14:06:23 +0200 Message-ID: <6a7bc216d840fc980ee43506d1af6345c602990d.1348142407.git.hans.verkuil@cisco.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <15fd87671d173ae4b943df4114aafb55d7e958fa.1348142407.git.hans.verkuil@cisco.com> References: <15fd87671d173ae4b943df4114aafb55d7e958fa.1348142407.git.hans.verkuil@cisco.com> X-Virus-Scanned: by XS4ALL Virus Scanner 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: 0 skipped:not-enabled X-pstn-settings: 2 (0.5000:0.5000) s cv gt3 gt2 gt1 r p m c X-pstn-addresses: from [82/3] CC: Hans Verkuil , 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@linux.davincidsp.com From: Hans Verkuil The output index does not belong to video_obj, it belongs to channel_obj. Also rename to output_idx to be consistent with the input_idx name used in vpif_capture. Signed-off-by: Hans Verkuil --- drivers/media/platform/davinci/vpif_display.c | 17 ++++++----------- drivers/media/platform/davinci/vpif_display.h | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index 2c06778..f394599 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -1231,7 +1231,6 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i) { struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; - struct video_obj *vid_ch = &ch->video; struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; int ret = 0; @@ -1246,7 +1245,7 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i) if (ret < 0) vpif_err("Failed to set output standard\n"); - vid_ch->output_id = i; + ch->output_idx = i; return ret; } @@ -1254,9 +1253,8 @@ static int vpif_g_output(struct file *file, void *priv, unsigned int *i) { struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; - struct video_obj *vid_ch = &ch->video; - *i = vid_ch->output_id; + *i = ch->output_idx; return 0; } @@ -1291,9 +1289,8 @@ vpif_enum_dv_timings(struct file *file, void *priv, { struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; - struct video_obj *vid_ch = &ch->video; - return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], + return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], video, enum_dv_timings, timings); } @@ -1320,7 +1317,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, } /* Configure subdevice timings, if any */ - ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], + ret = v4l2_subdev_call(vpif_obj.sd[ch->output_idx], video, s_dv_timings, timings); if (ret == -ENOIOCTLCMD) { vpif_dbg(2, debug, "Custom DV timings not supported by " @@ -1451,9 +1448,8 @@ static int vpif_dbg_g_register(struct file *file, void *priv, struct v4l2_dbg_register *reg){ struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; - struct video_obj *vid_ch = &ch->video; - return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core, + return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core, g_register, reg); } @@ -1470,9 +1466,8 @@ static int vpif_dbg_s_register(struct file *file, void *priv, struct v4l2_dbg_register *reg){ struct vpif_fh *fh = priv; struct channel_obj *ch = fh->channel; - struct video_obj *vid_ch = &ch->video; - return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core, + return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core, s_register, reg); } #endif diff --git a/drivers/media/platform/davinci/vpif_display.h b/drivers/media/platform/davinci/vpif_display.h index 8654002..805704c 100644 --- a/drivers/media/platform/davinci/vpif_display.h +++ b/drivers/media/platform/davinci/vpif_display.h @@ -62,7 +62,6 @@ struct video_obj { v4l2_std_id stdid; /* Currently selected or default * standard */ struct v4l2_dv_timings dv_timings; - u32 output_id; /* Current output id */ }; struct vpif_disp_buffer { @@ -125,6 +124,7 @@ struct channel_obj { * which is being displayed */ u8 initialized; /* flag to indicate whether * encoder is initialized */ + u32 output_idx; /* Current output index */ enum vpif_channel_id channel_id;/* Identifies channel */ struct vpif_params vpifparams;