Commit 2c0ddd17 authored by Mats Randgaard's avatar Mats Randgaard Committed by Mauro Carvalho Chehab

[media] vpif_cap/disp: Cleanup, improved comments

Signed-off-by: default avatarMats Randgaard <mats.randgaard@cisco.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarMurali Karicheri <mkaricheri@gmail.com>
Acked-by: default avatarVaibhav Hiremath <hvaibhav@ti.com>
Acked-by: default avatarManjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c027e165
...@@ -577,11 +577,10 @@ struct vpif_channel_config_params { ...@@ -577,11 +577,10 @@ struct vpif_channel_config_params {
char name[VPIF_MAX_NAME]; /* Name of the mode */ char name[VPIF_MAX_NAME]; /* Name of the mode */
u16 width; /* Indicates width of the image */ u16 width; /* Indicates width of the image */
u16 height; /* Indicates height of the image */ u16 height; /* Indicates height of the image */
u8 frm_fmt; /* Indicates whether this is interlaced u8 frm_fmt; /* Interlaced (0) or progressive (1) */
* or progressive format */ u8 ycmux_mode; /* This mode requires one (0) or two (1)
u8 ycmux_mode; /* Indicates whether this mode requires channels */
* single or two channels */ u16 eav2sav; /* length of eav 2 sav */
u16 eav2sav; /* length of sav 2 eav */
u16 sav2eav; /* length of sav 2 eav */ u16 sav2eav; /* length of sav 2 eav */
u16 l1, l3, l5, l7, l9, l11; /* Other parameter configurations */ u16 l1, l3, l5, l7, l9, l11; /* Other parameter configurations */
u16 vsize; /* Vertical size of the image */ u16 vsize; /* Vertical size of the image */
...@@ -589,8 +588,8 @@ struct vpif_channel_config_params { ...@@ -589,8 +588,8 @@ struct vpif_channel_config_params {
* is in BT or in CCD/CMOS */ * is in BT or in CCD/CMOS */
u8 vbi_supported; /* Indicates whether this mode u8 vbi_supported; /* Indicates whether this mode
* supports capturing vbi or not */ * supports capturing vbi or not */
u8 hd_sd; u8 hd_sd; /* HDTV (1) or SDTV (0) format */
v4l2_std_id stdid; v4l2_std_id stdid; /* SDTV format */
u32 dv_preset; /* HDTV format */ u32 dv_preset; /* HDTV format */
}; };
......
...@@ -422,14 +422,12 @@ static int vpif_update_std_info(struct channel_obj *ch) ...@@ -422,14 +422,12 @@ static int vpif_update_std_info(struct channel_obj *ch)
struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
struct vpif_params *vpifparams = &ch->vpifparams; struct vpif_params *vpifparams = &ch->vpifparams;
const struct vpif_channel_config_params *config; const struct vpif_channel_config_params *config;
struct vpif_channel_config_params *std_info; struct vpif_channel_config_params *std_info = &vpifparams->std_info;
struct video_obj *vid_ch = &ch->video; struct video_obj *vid_ch = &ch->video;
int index; int index;
vpif_dbg(2, debug, "vpif_update_std_info\n"); vpif_dbg(2, debug, "vpif_update_std_info\n");
std_info = &vpifparams->std_info;
for (index = 0; index < vpif_ch_params_count; index++) { for (index = 0; index < vpif_ch_params_count; index++) {
config = &ch_params[index]; config = &ch_params[index];
if (config->hd_sd == 0) { if (config->hd_sd == 0) {
...@@ -458,6 +456,7 @@ static int vpif_update_std_info(struct channel_obj *ch) ...@@ -458,6 +456,7 @@ static int vpif_update_std_info(struct channel_obj *ch)
common->fmt.fmt.pix.bytesperline = std_info->width; common->fmt.fmt.pix.bytesperline = std_info->width;
vpifparams->video_params.hpitch = std_info->width; vpifparams->video_params.hpitch = std_info->width;
vpifparams->video_params.storage_mode = std_info->frm_fmt; vpifparams->video_params.storage_mode = std_info->frm_fmt;
return 0; return 0;
} }
...@@ -1692,7 +1691,7 @@ static int vpif_s_fmt_vid_cap(struct file *file, void *priv, ...@@ -1692,7 +1691,7 @@ static int vpif_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_pix_format *pixfmt; struct v4l2_pix_format *pixfmt;
int ret = 0; int ret = 0;
vpif_dbg(2, debug, "VIDIOC_S_FMT\n"); vpif_dbg(2, debug, "%s\n", __func__);
/* If streaming is started, return error */ /* If streaming is started, return error */
if (common->started) { if (common->started) {
...@@ -2336,9 +2335,9 @@ static __init int vpif_probe(struct platform_device *pdev) ...@@ -2336,9 +2335,9 @@ static __init int vpif_probe(struct platform_device *pdev)
if (vpif_obj.sd[i]) if (vpif_obj.sd[i])
vpif_obj.sd[i]->grp_id = 1 << i; vpif_obj.sd[i]->grp_id = 1 << i;
} }
v4l2_info(&vpif_obj.v4l2_dev, "DM646x VPIF Capture driver"
" initialized\n");
v4l2_info(&vpif_obj.v4l2_dev,
"DM646x VPIF capture driver initialized\n");
return 0; return 0;
probe_subdev_out: probe_subdev_out:
......
...@@ -580,7 +580,10 @@ static void vpif_config_addr(struct channel_obj *ch, int muxmode) ...@@ -580,7 +580,10 @@ static void vpif_config_addr(struct channel_obj *ch, int muxmode)
static int vpif_mmap(struct file *filep, struct vm_area_struct *vma) static int vpif_mmap(struct file *filep, struct vm_area_struct *vma)
{ {
struct vpif_fh *fh = filep->private_data; struct vpif_fh *fh = filep->private_data;
struct common_obj *common = &fh->channel->common[VPIF_VIDEO_INDEX]; struct channel_obj *ch = fh->channel;
struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]);
vpif_dbg(2, debug, "vpif_mmap\n");
return videobuf_mmap_mapper(&common->buffer_queue, vma); return videobuf_mmap_mapper(&common->buffer_queue, vma);
} }
...@@ -692,7 +695,12 @@ static int vpif_release(struct file *filep) ...@@ -692,7 +695,12 @@ static int vpif_release(struct file *filep)
} }
/* functions implementing ioctls */ /* functions implementing ioctls */
/**
* vpif_querycap() - QUERYCAP handler
* @file: file ptr
* @priv: file handle
* @cap: ptr to v4l2_capability structure
*/
static int vpif_querycap(struct file *file, void *priv, static int vpif_querycap(struct file *file, void *priv,
struct v4l2_capability *cap) struct v4l2_capability *cap)
{ {
...@@ -1873,6 +1881,8 @@ static __init int vpif_probe(struct platform_device *pdev) ...@@ -1873,6 +1881,8 @@ static __init int vpif_probe(struct platform_device *pdev)
vpif_obj.sd[i]->grp_id = 1 << i; vpif_obj.sd[i]->grp_id = 1 << i;
} }
v4l2_info(&vpif_obj.v4l2_dev,
"DM646x VPIF display driver initialized\n");
return 0; return 0;
probe_subdev_out: probe_subdev_out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment