Commit 59d0b2bf authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] v4l: vsp1: Don't setup control handler when starting streaming

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: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent d884a8b2
......@@ -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;
......
......@@ -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)
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
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