]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] v4l: vsp1: Don't setup control handler when starting streaming
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 1 Nov 2015 14:58:29 +0000 (12:58 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 13 Apr 2016 20:42:45 +0000 (17:42 -0300)
The control handler set operations don't program the hardware anymore,
there's thus no need to call them when starting the stream.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/vsp1/vsp1_bru.c
drivers/media/platform/vsp1/vsp1_entity.c
drivers/media/platform/vsp1/vsp1_entity.h
drivers/media/platform/vsp1/vsp1_rpf.c
drivers/media/platform/vsp1/vsp1_sru.c
drivers/media/platform/vsp1/vsp1_wpf.c

index 4c1bd0419e1266bf9820812bf76a06b5ded24e2e..27a9043b11e2ba61eac19e789658f1950e48a20f 100644 (file)
@@ -66,11 +66,8 @@ static int bru_s_stream(struct v4l2_subdev *subdev, int enable)
        struct v4l2_mbus_framefmt *format;
        unsigned int flags;
        unsigned int i;
-       int ret;
 
-       ret = vsp1_entity_set_streaming(&bru->entity, enable);
-       if (ret < 0)
-               return ret;
+       vsp1_entity_set_streaming(&bru->entity, enable);
 
        if (!enable)
                return 0;
index a94f544dcc77a8e3334ad50ad44ed5da638cbbb2..6b425ae9aba373cfa00eda7b518250651dc3394d 100644 (file)
@@ -45,29 +45,13 @@ bool vsp1_entity_is_streaming(struct vsp1_entity *entity)
        return streaming;
 }
 
-int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming)
+void vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming)
 {
        unsigned long flags;
-       int ret;
 
        spin_lock_irqsave(&entity->lock, flags);
        entity->streaming = streaming;
        spin_unlock_irqrestore(&entity->lock, flags);
-
-       if (!streaming)
-               return 0;
-
-       if (!entity->vsp1->info->uapi || !entity->subdev.ctrl_handler)
-               return 0;
-
-       ret = v4l2_ctrl_handler_setup(entity->subdev.ctrl_handler);
-       if (ret < 0) {
-               spin_lock_irqsave(&entity->lock, flags);
-               entity->streaming = false;
-               spin_unlock_irqrestore(&entity->lock, flags);
-       }
-
-       return ret;
 }
 
 void vsp1_entity_route_setup(struct vsp1_entity *source)
index 259880e524fee6875050308425375949a4a8384b..c0d6db82ebfb7c8ddbc4a6f3ffcb53331d7ca5fa 100644 (file)
@@ -101,7 +101,7 @@ void vsp1_entity_init_formats(struct v4l2_subdev *subdev,
                              struct v4l2_subdev_pad_config *cfg);
 
 bool vsp1_entity_is_streaming(struct vsp1_entity *entity);
-int vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming);
+void vsp1_entity_set_streaming(struct vsp1_entity *entity, bool streaming);
 
 void vsp1_entity_route_setup(struct vsp1_entity *source);
 
index 9ccfb572b4a5a9edf5d7650ca4c22d98c888ab33..48870b257a81e2460cd337c61f2999e20a2a289f 100644 (file)
@@ -45,11 +45,8 @@ static int rpf_s_stream(struct v4l2_subdev *subdev, int enable)
        const struct v4l2_rect *crop = &rpf->crop;
        u32 pstride;
        u32 infmt;
-       int ret;
 
-       ret = vsp1_entity_set_streaming(&rpf->entity, enable);
-       if (ret < 0)
-               return ret;
+       vsp1_entity_set_streaming(&rpf->entity, enable);
 
        if (!enable)
                return 0;
index ec4741efc7f89cc329ef67c870dc4a5e06387a7d..15fc562a52dad18bc937849135ee4482cc9c5cae 100644 (file)
@@ -113,11 +113,8 @@ static int sru_s_stream(struct v4l2_subdev *subdev, int enable)
        struct v4l2_mbus_framefmt *input;
        struct v4l2_mbus_framefmt *output;
        u32 ctrl0;
-       int ret;
 
-       ret = vsp1_entity_set_streaming(&sru->entity, enable);
-       if (ret < 0)
-               return ret;
+       vsp1_entity_set_streaming(&sru->entity, enable);
 
        if (!enable)
                return 0;
index 2135cca2490e7986a95b9dbe6a2f5860c4faa93e..d68c90d45232851a04cf526258e280c82b97861e 100644 (file)
@@ -46,11 +46,8 @@ static int wpf_s_stream(struct v4l2_subdev *subdev, int enable)
        unsigned int i;
        u32 srcrpf = 0;
        u32 outfmt = 0;
-       int ret;
 
-       ret = vsp1_entity_set_streaming(&wpf->entity, enable);
-       if (ret < 0)
-               return ret;
+       vsp1_entity_set_streaming(&wpf->entity, enable);
 
        if (!enable) {
                vsp1_write(vsp1, VI6_WPF_IRQ_ENB(wpf->entity.index), 0);