]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/commitdiff
[media] omap3isp: ccdc: Use generic frame sync event instead of private HS_VS event
authorSakari Ailus <sakari.ailus@iki.fi>
Wed, 15 Jun 2011 18:58:48 +0000 (15:58 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 29 Aug 2011 15:38:51 +0000 (12:38 -0300)
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>
Documentation/video4linux/omap3isp.txt
drivers/media/video/omap3isp/ispccdc.c
include/linux/omap3isp.h

index 69be2c782b989b5616596be15c70b3dd42c4e669..5dd1439b61fd512b94b3404f959e824ab3816f4d 100644 (file)
@@ -70,10 +70,11 @@ Events
 The OMAP 3 ISP driver does support the V4L2 event interface on CCDC and
 statistics (AEWB, AF and histogram) subdevs.
 
-The CCDC subdev produces V4L2_EVENT_OMAP3ISP_HS_VS type event on HS_VS
-interrupt which is used to signal frame start. The event is triggered exactly
-when the reception of the first line of the frame starts in the CCDC module.
-The event can be subscribed on the CCDC subdev.
+The CCDC subdev produces V4L2_EVENT_FRAME_SYNC type event on HS_VS
+interrupt which is used to signal frame start. Earlier version of this
+driver used V4L2_EVENT_OMAP3ISP_HS_VS for this purpose. The event is
+triggered exactly when the reception of the first line of the frame starts
+in the CCDC module. The event can be subscribed on the CCDC subdev.
 
 (When using parallel interface one must pay account to correct configuration
 of the VS signal polarity. This is automatically correct when using the serial
index 9d3459de04b2b5f48b6ede40d53468de8ab8a155..40b141c86c62c67c1a9f7d76b428ac329073700e 100644 (file)
@@ -1404,11 +1404,14 @@ static int __ccdc_handle_stopping(struct isp_ccdc_device *ccdc, u32 event)
 
 static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc)
 {
+       struct isp_pipeline *pipe =
+               to_isp_pipeline(&ccdc->video_out.video.entity);
        struct video_device *vdev = &ccdc->subdev.devnode;
        struct v4l2_event event;
 
        memset(&event, 0, sizeof(event));
-       event.type = V4L2_EVENT_OMAP3ISP_HS_VS;
+       event.type = V4L2_EVENT_FRAME_SYNC;
+       event.u.frame_sync.frame_sequence = atomic_read(&pipe->frame_number);
 
        v4l2_event_queue(vdev, &event);
 }
@@ -1690,7 +1693,11 @@ static long ccdc_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
 static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
                                struct v4l2_event_subscription *sub)
 {
-       if (sub->type != V4L2_EVENT_OMAP3ISP_HS_VS)
+       if (sub->type != V4L2_EVENT_FRAME_SYNC)
+               return -EINVAL;
+
+       /* line number is zero at frame start */
+       if (sub->id != 0)
                return -EINVAL;
 
        return v4l2_event_subscribe(fh, sub, OMAP3ISP_CCDC_NEVENTS);
index b6111f8cd49a0976025680a6a295e40038a47774..c73a34c3434d75150cc4f6440e3ba3a5a8ffc47f 100644 (file)
  * V4L2_EVENT_OMAP3ISP_AEWB: AEWB statistics data ready
  * V4L2_EVENT_OMAP3ISP_AF: AF statistics data ready
  * V4L2_EVENT_OMAP3ISP_HIST: Histogram statistics data ready
- * V4L2_EVENT_OMAP3ISP_HS_VS: Horizontal/vertical synchronization detected
  */
 
 #define V4L2_EVENT_OMAP3ISP_CLASS      (V4L2_EVENT_PRIVATE_START | 0x100)
 #define V4L2_EVENT_OMAP3ISP_AEWB       (V4L2_EVENT_OMAP3ISP_CLASS | 0x1)
 #define V4L2_EVENT_OMAP3ISP_AF         (V4L2_EVENT_OMAP3ISP_CLASS | 0x2)
 #define V4L2_EVENT_OMAP3ISP_HIST       (V4L2_EVENT_OMAP3ISP_CLASS | 0x3)
-#define V4L2_EVENT_OMAP3ISP_HS_VS      (V4L2_EVENT_OMAP3ISP_CLASS | 0x4)
 
 struct omap3isp_stat_event_status {
        __u32 frame_number;