diff options
author | Mats Randgaard <mats.randgaard@cisco.com> | 2010-12-16 10:17:45 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-01-19 08:28:19 -0500 |
commit | 2c0ddd17741383009c53cf557d6526848c8bb917 (patch) | |
tree | 7c2aa63013f664743a8f3046362912c894384d19 | |
parent | c027e165d2d901ecab485da5fee72ddce5da0297 (diff) |
[media] vpif_cap/disp: Cleanup, improved comments
Signed-off-by: Mats Randgaard <mats.randgaard@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Murali Karicheri <mkaricheri@gmail.com>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
Acked-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/davinci/vpif.h | 13 | ||||
-rw-r--r-- | drivers/media/video/davinci/vpif_capture.c | 13 | ||||
-rw-r--r-- | drivers/media/video/davinci/vpif_display.c | 16 |
3 files changed, 25 insertions, 17 deletions
diff --git a/drivers/media/video/davinci/vpif.h b/drivers/media/video/davinci/vpif.h index b6695bee3c59..10550bd93b06 100644 --- a/drivers/media/video/davinci/vpif.h +++ b/drivers/media/video/davinci/vpif.h | |||
@@ -577,11 +577,10 @@ struct vpif_channel_config_params { | |||
577 | char name[VPIF_MAX_NAME]; /* Name of the mode */ | 577 | char name[VPIF_MAX_NAME]; /* Name of the mode */ |
578 | u16 width; /* Indicates width of the image */ | 578 | u16 width; /* Indicates width of the image */ |
579 | u16 height; /* Indicates height of the image */ | 579 | u16 height; /* Indicates height of the image */ |
580 | u8 frm_fmt; /* Indicates whether this is interlaced | 580 | u8 frm_fmt; /* Interlaced (0) or progressive (1) */ |
581 | * or progressive format */ | 581 | u8 ycmux_mode; /* This mode requires one (0) or two (1) |
582 | u8 ycmux_mode; /* Indicates whether this mode requires | 582 | channels */ |
583 | * single or two channels */ | 583 | u16 eav2sav; /* length of eav 2 sav */ |
584 | u16 eav2sav; /* length of sav 2 eav */ | ||
585 | u16 sav2eav; /* length of sav 2 eav */ | 584 | u16 sav2eav; /* length of sav 2 eav */ |
586 | u16 l1, l3, l5, l7, l9, l11; /* Other parameter configurations */ | 585 | u16 l1, l3, l5, l7, l9, l11; /* Other parameter configurations */ |
587 | u16 vsize; /* Vertical size of the image */ | 586 | u16 vsize; /* Vertical size of the image */ |
@@ -589,8 +588,8 @@ struct vpif_channel_config_params { | |||
589 | * is in BT or in CCD/CMOS */ | 588 | * is in BT or in CCD/CMOS */ |
590 | u8 vbi_supported; /* Indicates whether this mode | 589 | u8 vbi_supported; /* Indicates whether this mode |
591 | * supports capturing vbi or not */ | 590 | * supports capturing vbi or not */ |
592 | u8 hd_sd; | 591 | u8 hd_sd; /* HDTV (1) or SDTV (0) format */ |
593 | v4l2_std_id stdid; | 592 | v4l2_std_id stdid; /* SDTV format */ |
594 | u32 dv_preset; /* HDTV format */ | 593 | u32 dv_preset; /* HDTV format */ |
595 | }; | 594 | }; |
596 | 595 | ||
diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c index be2b9919937c..f8e65909dc37 100644 --- a/drivers/media/video/davinci/vpif_capture.c +++ b/drivers/media/video/davinci/vpif_capture.c | |||
@@ -329,7 +329,7 @@ static void vpif_schedule_next_buffer(struct common_obj *common) | |||
329 | * @dev_id: dev_id ptr | 329 | * @dev_id: dev_id ptr |
330 | * | 330 | * |
331 | * It changes status of the captured buffer, takes next buffer from the queue | 331 | * It changes status of the captured buffer, takes next buffer from the queue |
332 | * and sets its address in VPIF registers | 332 | * and sets its address in VPIF registers |
333 | */ | 333 | */ |
334 | static irqreturn_t vpif_channel_isr(int irq, void *dev_id) | 334 | static irqreturn_t vpif_channel_isr(int irq, void *dev_id) |
335 | { | 335 | { |
@@ -422,14 +422,12 @@ static int vpif_update_std_info(struct channel_obj *ch) | |||
422 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; | 422 | struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; |
423 | struct vpif_params *vpifparams = &ch->vpifparams; | 423 | struct vpif_params *vpifparams = &ch->vpifparams; |
424 | const struct vpif_channel_config_params *config; | 424 | const struct vpif_channel_config_params *config; |
425 | struct vpif_channel_config_params *std_info; | 425 | struct vpif_channel_config_params *std_info = &vpifparams->std_info; |
426 | struct video_obj *vid_ch = &ch->video; | 426 | struct video_obj *vid_ch = &ch->video; |
427 | int index; | 427 | int index; |
428 | 428 | ||
429 | vpif_dbg(2, debug, "vpif_update_std_info\n"); | 429 | vpif_dbg(2, debug, "vpif_update_std_info\n"); |
430 | 430 | ||
431 | std_info = &vpifparams->std_info; | ||
432 | |||
433 | for (index = 0; index < vpif_ch_params_count; index++) { | 431 | for (index = 0; index < vpif_ch_params_count; index++) { |
434 | config = &ch_params[index]; | 432 | config = &ch_params[index]; |
435 | if (config->hd_sd == 0) { | 433 | if (config->hd_sd == 0) { |
@@ -458,6 +456,7 @@ static int vpif_update_std_info(struct channel_obj *ch) | |||
458 | common->fmt.fmt.pix.bytesperline = std_info->width; | 456 | common->fmt.fmt.pix.bytesperline = std_info->width; |
459 | vpifparams->video_params.hpitch = std_info->width; | 457 | vpifparams->video_params.hpitch = std_info->width; |
460 | vpifparams->video_params.storage_mode = std_info->frm_fmt; | 458 | vpifparams->video_params.storage_mode = std_info->frm_fmt; |
459 | |||
461 | return 0; | 460 | return 0; |
462 | } | 461 | } |
463 | 462 | ||
@@ -1692,7 +1691,7 @@ static int vpif_s_fmt_vid_cap(struct file *file, void *priv, | |||
1692 | struct v4l2_pix_format *pixfmt; | 1691 | struct v4l2_pix_format *pixfmt; |
1693 | int ret = 0; | 1692 | int ret = 0; |
1694 | 1693 | ||
1695 | vpif_dbg(2, debug, "VIDIOC_S_FMT\n"); | 1694 | vpif_dbg(2, debug, "%s\n", __func__); |
1696 | 1695 | ||
1697 | /* If streaming is started, return error */ | 1696 | /* If streaming is started, return error */ |
1698 | if (common->started) { | 1697 | if (common->started) { |
@@ -2336,9 +2335,9 @@ static __init int vpif_probe(struct platform_device *pdev) | |||
2336 | if (vpif_obj.sd[i]) | 2335 | if (vpif_obj.sd[i]) |
2337 | vpif_obj.sd[i]->grp_id = 1 << i; | 2336 | vpif_obj.sd[i]->grp_id = 1 << i; |
2338 | } | 2337 | } |
2339 | v4l2_info(&vpif_obj.v4l2_dev, "DM646x VPIF Capture driver" | ||
2340 | " initialized\n"); | ||
2341 | 2338 | ||
2339 | v4l2_info(&vpif_obj.v4l2_dev, | ||
2340 | "DM646x VPIF capture driver initialized\n"); | ||
2342 | return 0; | 2341 | return 0; |
2343 | 2342 | ||
2344 | probe_subdev_out: | 2343 | probe_subdev_out: |
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c index 44a885878ebf..7cb70d916f4b 100644 --- a/drivers/media/video/davinci/vpif_display.c +++ b/drivers/media/video/davinci/vpif_display.c | |||
@@ -580,7 +580,10 @@ static void vpif_config_addr(struct channel_obj *ch, int muxmode) | |||
580 | static int vpif_mmap(struct file *filep, struct vm_area_struct *vma) | 580 | static int vpif_mmap(struct file *filep, struct vm_area_struct *vma) |
581 | { | 581 | { |
582 | struct vpif_fh *fh = filep->private_data; | 582 | struct vpif_fh *fh = filep->private_data; |
583 | struct common_obj *common = &fh->channel->common[VPIF_VIDEO_INDEX]; | 583 | struct channel_obj *ch = fh->channel; |
584 | struct common_obj *common = &(ch->common[VPIF_VIDEO_INDEX]); | ||
585 | |||
586 | vpif_dbg(2, debug, "vpif_mmap\n"); | ||
584 | 587 | ||
585 | return videobuf_mmap_mapper(&common->buffer_queue, vma); | 588 | return videobuf_mmap_mapper(&common->buffer_queue, vma); |
586 | } | 589 | } |
@@ -692,7 +695,12 @@ static int vpif_release(struct file *filep) | |||
692 | } | 695 | } |
693 | 696 | ||
694 | /* functions implementing ioctls */ | 697 | /* functions implementing ioctls */ |
695 | 698 | /** | |
699 | * vpif_querycap() - QUERYCAP handler | ||
700 | * @file: file ptr | ||
701 | * @priv: file handle | ||
702 | * @cap: ptr to v4l2_capability structure | ||
703 | */ | ||
696 | static int vpif_querycap(struct file *file, void *priv, | 704 | static int vpif_querycap(struct file *file, void *priv, |
697 | struct v4l2_capability *cap) | 705 | struct v4l2_capability *cap) |
698 | { | 706 | { |
@@ -1106,7 +1114,7 @@ static int vpif_streamon(struct file *file, void *priv, | |||
1106 | if (ret < 0) | 1114 | if (ret < 0) |
1107 | return ret; | 1115 | return ret; |
1108 | 1116 | ||
1109 | /* Call videobuf_streamon to start streaming in videobuf */ | 1117 | /* Call videobuf_streamon to start streaming in videobuf */ |
1110 | ret = videobuf_streamon(&common->buffer_queue); | 1118 | ret = videobuf_streamon(&common->buffer_queue); |
1111 | if (ret < 0) { | 1119 | if (ret < 0) { |
1112 | vpif_err("videobuf_streamon\n"); | 1120 | vpif_err("videobuf_streamon\n"); |
@@ -1873,6 +1881,8 @@ static __init int vpif_probe(struct platform_device *pdev) | |||
1873 | vpif_obj.sd[i]->grp_id = 1 << i; | 1881 | vpif_obj.sd[i]->grp_id = 1 << i; |
1874 | } | 1882 | } |
1875 | 1883 | ||
1884 | v4l2_info(&vpif_obj.v4l2_dev, | ||
1885 | "DM646x VPIF display driver initialized\n"); | ||
1876 | return 0; | 1886 | return 0; |
1877 | 1887 | ||
1878 | probe_subdev_out: | 1888 | probe_subdev_out: |