aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2011-06-15 14:58:48 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-08-29 11:38:51 -0400
commit69d232ae8e95a229e7544989d6014e875deeb121 (patch)
tree62cf4402ced27602fc1c7d2be90d6b8d4d4aa3aa
parenteab00a0da292fa7118aaf20da78e834866de00ae (diff)
[media] omap3isp: ccdc: Use generic frame sync event instead of private HS_VS event
The ccdc block in the omap3isp produces events whenever it starts receiving a new frame. A private HS_VS event was used for this previously. Now, the generic V4L2_EVENT_FRAME_SYNC event is being used for the purpose. This patch also provides the frame sequence number to user space. Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--Documentation/video4linux/omap3isp.txt9
-rw-r--r--drivers/media/video/omap3isp/ispccdc.c11
-rw-r--r--include/linux/omap3isp.h2
3 files changed, 14 insertions, 8 deletions
diff --git a/Documentation/video4linux/omap3isp.txt b/Documentation/video4linux/omap3isp.txt
index 69be2c782b98..5dd1439b61fd 100644
--- a/Documentation/video4linux/omap3isp.txt
+++ b/Documentation/video4linux/omap3isp.txt
@@ -70,10 +70,11 @@ Events
70The OMAP 3 ISP driver does support the V4L2 event interface on CCDC and 70The OMAP 3 ISP driver does support the V4L2 event interface on CCDC and
71statistics (AEWB, AF and histogram) subdevs. 71statistics (AEWB, AF and histogram) subdevs.
72 72
73The CCDC subdev produces V4L2_EVENT_OMAP3ISP_HS_VS type event on HS_VS 73The CCDC subdev produces V4L2_EVENT_FRAME_SYNC type event on HS_VS
74interrupt which is used to signal frame start. The event is triggered exactly 74interrupt which is used to signal frame start. Earlier version of this
75when the reception of the first line of the frame starts in the CCDC module. 75driver used V4L2_EVENT_OMAP3ISP_HS_VS for this purpose. The event is
76The event can be subscribed on the CCDC subdev. 76triggered exactly when the reception of the first line of the frame starts
77in the CCDC module. The event can be subscribed on the CCDC subdev.
77 78
78(When using parallel interface one must pay account to correct configuration 79(When using parallel interface one must pay account to correct configuration
79of the VS signal polarity. This is automatically correct when using the serial 80of the VS signal polarity. This is automatically correct when using the serial
diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c
index 9d3459de04b2..40b141c86c62 100644
--- a/drivers/media/video/omap3isp/ispccdc.c
+++ b/drivers/media/video/omap3isp/ispccdc.c
@@ -1404,11 +1404,14 @@ static int __ccdc_handle_stopping(struct isp_ccdc_device *ccdc, u32 event)
1404 1404
1405static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc) 1405static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc)
1406{ 1406{
1407 struct isp_pipeline *pipe =
1408 to_isp_pipeline(&ccdc->video_out.video.entity);
1407 struct video_device *vdev = &ccdc->subdev.devnode; 1409 struct video_device *vdev = &ccdc->subdev.devnode;
1408 struct v4l2_event event; 1410 struct v4l2_event event;
1409 1411
1410 memset(&event, 0, sizeof(event)); 1412 memset(&event, 0, sizeof(event));
1411 event.type = V4L2_EVENT_OMAP3ISP_HS_VS; 1413 event.type = V4L2_EVENT_FRAME_SYNC;
1414 event.u.frame_sync.frame_sequence = atomic_read(&pipe->frame_number);
1412 1415
1413 v4l2_event_queue(vdev, &event); 1416 v4l2_event_queue(vdev, &event);
1414} 1417}
@@ -1690,7 +1693,11 @@ static long ccdc_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
1690static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh, 1693static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
1691 struct v4l2_event_subscription *sub) 1694 struct v4l2_event_subscription *sub)
1692{ 1695{
1693 if (sub->type != V4L2_EVENT_OMAP3ISP_HS_VS) 1696 if (sub->type != V4L2_EVENT_FRAME_SYNC)
1697 return -EINVAL;
1698
1699 /* line number is zero at frame start */
1700 if (sub->id != 0)
1694 return -EINVAL; 1701 return -EINVAL;
1695 1702
1696 return v4l2_event_subscribe(fh, sub, OMAP3ISP_CCDC_NEVENTS); 1703 return v4l2_event_subscribe(fh, sub, OMAP3ISP_CCDC_NEVENTS);
diff --git a/include/linux/omap3isp.h b/include/linux/omap3isp.h
index b6111f8cd49a..c73a34c3434d 100644
--- a/include/linux/omap3isp.h
+++ b/include/linux/omap3isp.h
@@ -62,14 +62,12 @@
62 * V4L2_EVENT_OMAP3ISP_AEWB: AEWB statistics data ready 62 * V4L2_EVENT_OMAP3ISP_AEWB: AEWB statistics data ready
63 * V4L2_EVENT_OMAP3ISP_AF: AF statistics data ready 63 * V4L2_EVENT_OMAP3ISP_AF: AF statistics data ready
64 * V4L2_EVENT_OMAP3ISP_HIST: Histogram statistics data ready 64 * V4L2_EVENT_OMAP3ISP_HIST: Histogram statistics data ready
65 * V4L2_EVENT_OMAP3ISP_HS_VS: Horizontal/vertical synchronization detected
66 */ 65 */
67 66
68#define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100) 67#define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100)
69#define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1) 68#define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1)
70#define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2) 69#define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2)
71#define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3) 70#define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3)
72#define V4L2_EVENT_OMAP3ISP_HS_VS (V4L2_EVENT_OMAP3ISP_CLASS | 0x4)
73 71
74struct omap3isp_stat_event_status { 72struct omap3isp_stat_event_status {
75 __u32 frame_number; 73 __u32 frame_number;