diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-09-18 07:18:47 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-26 17:00:02 -0300 |
commit | 0598c17b784a324c1759e44a3260c476b04f4725 (patch) | |
tree | 11cec482be9e220fa66a57419391dcf1b8794f46 /drivers/media/platform/davinci/vpif_display.c | |
parent | e34db0661dc7945e5412a568f38dd170c78099d1 (diff) |
[media] vpif: replace preset with the timings API
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/davinci/vpif_display.c')
-rw-r--r-- | drivers/media/platform/davinci/vpif_display.c | 104 |
1 files changed, 13 insertions, 91 deletions
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index ff6e43293ce4..8003c56487bb 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -499,12 +499,6 @@ static int vpif_update_std_info(struct channel_obj *ch) memcpy(std_info, config, sizeof(*config)); break; } - } else { - vpif_dbg(2, debug, "HD format\n"); - if (config->dv_preset == vid_ch->dv_preset) { - memcpy(std_info, config, sizeof(*config)); - break; - } } } @@ -523,10 +517,10 @@ static int vpif_update_resolution(struct channel_obj *ch) struct vpif_params *vpifparams = &ch->vpifparams; struct vpif_channel_config_params *std_info = &vpifparams->std_info; - if (!vid_ch->stdid && !vid_ch->dv_preset && !vid_ch->bt_timings.height) + if (!vid_ch->stdid && !vid_ch->dv_timings.bt.height) return -EINVAL; - if (vid_ch->stdid || vid_ch->dv_preset) { + if (vid_ch->stdid) { if (vpif_update_std_info(ch)) return -EINVAL; } @@ -1055,9 +1049,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id) /* Call encoder subdevice function to set the standard */ ch->video.stdid = *std_id; - ch->video.dv_preset = V4L2_DV_INVALID; - memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings)); - + memset(&ch->video.dv_timings, 0, sizeof(ch->video.dv_timings)); /* Get the information about the standard */ if (vpif_update_resolution(ch)) return -EINVAL; @@ -1287,88 +1279,24 @@ static int vpif_s_priority(struct file *file, void *priv, enum v4l2_priority p) } /** - * vpif_enum_dv_presets() - ENUM_DV_PRESETS handler + * vpif_enum_dv_timings() - ENUM_DV_TIMINGS handler * @file: file ptr * @priv: file handle - * @preset: input preset + * @timings: input timings */ -static int vpif_enum_dv_presets(struct file *file, void *priv, - struct v4l2_dv_enum_preset *preset) +static int +vpif_enum_dv_timings(struct file *file, void *priv, + struct v4l2_enum_dv_timings *timings) { 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], - video, enum_dv_presets, preset); + video, enum_dv_timings, timings); } /** - * vpif_s_dv_presets() - S_DV_PRESETS handler - * @file: file ptr - * @priv: file handle - * @preset: input preset - */ -static int vpif_s_dv_preset(struct file *file, void *priv, - struct v4l2_dv_preset *preset) -{ - 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; - int ret = 0; - - if (common->started) { - vpif_dbg(1, debug, "streaming in progress\n"); - return -EBUSY; - } - - ret = v4l2_prio_check(&ch->prio, fh->prio); - if (ret != 0) - return ret; - - fh->initialized = 1; - - /* Call encoder subdevice function to set the standard */ - if (mutex_lock_interruptible(&common->lock)) - return -ERESTARTSYS; - - ch->video.dv_preset = preset->preset; - ch->video.stdid = V4L2_STD_UNKNOWN; - memset(&ch->video.bt_timings, 0, sizeof(ch->video.bt_timings)); - - /* Get the information about the standard */ - if (vpif_update_resolution(ch)) { - ret = -EINVAL; - } else { - /* Configure the default format information */ - vpif_config_format(ch); - - ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], - video, s_dv_preset, preset); - } - - mutex_unlock(&common->lock); - - return ret; -} -/** - * vpif_g_dv_presets() - G_DV_PRESETS handler - * @file: file ptr - * @priv: file handle - * @preset: input preset - */ -static int vpif_g_dv_preset(struct file *file, void *priv, - struct v4l2_dv_preset *preset) -{ - struct vpif_fh *fh = priv; - struct channel_obj *ch = fh->channel; - - preset->preset = ch->video.dv_preset; - - return 0; -} -/** * vpif_s_dv_timings() - S_DV_TIMINGS handler * @file: file ptr * @priv: file handle @@ -1382,7 +1310,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, struct vpif_params *vpifparams = &ch->vpifparams; struct vpif_channel_config_params *std_info = &vpifparams->std_info; struct video_obj *vid_ch = &ch->video; - struct v4l2_bt_timings *bt = &vid_ch->bt_timings; + struct v4l2_bt_timings *bt = &vid_ch->dv_timings.bt; int ret; if (timings->type != V4L2_DV_BT_656_1120) { @@ -1418,7 +1346,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, return -EINVAL; } - *bt = timings->bt; + vid_ch->dv_timings = *timings; /* Configure video port timings */ @@ -1462,10 +1390,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, std_info->vbi_supported = 0; std_info->hd_sd = 1; std_info->stdid = 0; - std_info->dv_preset = V4L2_DV_INVALID; - vid_ch->stdid = 0; - vid_ch->dv_preset = V4L2_DV_INVALID; return 0; } @@ -1482,9 +1407,8 @@ static int vpif_g_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; - struct v4l2_bt_timings *bt = &vid_ch->bt_timings; - timings->bt = *bt; + *timings = vid_ch->dv_timings; return 0; } @@ -1588,9 +1512,7 @@ static const struct v4l2_ioctl_ops vpif_ioctl_ops = { .vidioc_s_output = vpif_s_output, .vidioc_g_output = vpif_g_output, .vidioc_cropcap = vpif_cropcap, - .vidioc_enum_dv_presets = vpif_enum_dv_presets, - .vidioc_s_dv_preset = vpif_s_dv_preset, - .vidioc_g_dv_preset = vpif_g_dv_preset, + .vidioc_enum_dv_timings = vpif_enum_dv_timings, .vidioc_s_dv_timings = vpif_s_dv_timings, .vidioc_g_dv_timings = vpif_g_dv_timings, .vidioc_g_chip_ident = vpif_g_chip_ident, |