aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vimc/vimc-capture.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/vimc/vimc-capture.c')
-rw-r--r--drivers/media/platform/vimc/vimc-capture.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/drivers/media/platform/vimc/vimc-capture.c b/drivers/media/platform/vimc/vimc-capture.c
index 9adb06d7e13d..93f6a0916329 100644
--- a/drivers/media/platform/vimc/vimc-capture.c
+++ b/drivers/media/platform/vimc/vimc-capture.c
@@ -132,31 +132,6 @@ static void vimc_cap_return_all_buffers(struct vimc_cap_device *vcap,
132 spin_unlock(&vcap->qlock); 132 spin_unlock(&vcap->qlock);
133} 133}
134 134
135static int vimc_cap_pipeline_s_stream(struct vimc_cap_device *vcap, int enable)
136{
137 struct v4l2_subdev *sd;
138 struct media_pad *pad;
139 int ret;
140
141 /* Start the stream in the subdevice direct connected */
142 pad = media_entity_remote_pad(&vcap->vdev.entity.pads[0]);
143
144 /*
145 * if it is a raw node from vimc-core, there is nothing to activate
146 * TODO: remove this when there are no more raw nodes in the
147 * core and return error instead
148 */
149 if (pad->entity->obj_type == MEDIA_ENTITY_TYPE_BASE)
150 return 0;
151
152 sd = media_entity_to_v4l2_subdev(pad->entity);
153 ret = v4l2_subdev_call(sd, video, s_stream, enable);
154 if (ret && ret != -ENOIOCTLCMD)
155 return ret;
156
157 return 0;
158}
159
160static int vimc_cap_start_streaming(struct vb2_queue *vq, unsigned int count) 135static int vimc_cap_start_streaming(struct vb2_queue *vq, unsigned int count)
161{ 136{
162 struct vimc_cap_device *vcap = vb2_get_drv_priv(vq); 137 struct vimc_cap_device *vcap = vb2_get_drv_priv(vq);
@@ -173,7 +148,7 @@ static int vimc_cap_start_streaming(struct vb2_queue *vq, unsigned int count)
173 } 148 }
174 149
175 /* Enable streaming from the pipe */ 150 /* Enable streaming from the pipe */
176 ret = vimc_cap_pipeline_s_stream(vcap, 1); 151 ret = vimc_pipeline_s_stream(&vcap->vdev.entity, 1);
177 if (ret) { 152 if (ret) {
178 media_pipeline_stop(entity); 153 media_pipeline_stop(entity);
179 vimc_cap_return_all_buffers(vcap, VB2_BUF_STATE_QUEUED); 154 vimc_cap_return_all_buffers(vcap, VB2_BUF_STATE_QUEUED);
@@ -192,7 +167,7 @@ static void vimc_cap_stop_streaming(struct vb2_queue *vq)
192 struct vimc_cap_device *vcap = vb2_get_drv_priv(vq); 167 struct vimc_cap_device *vcap = vb2_get_drv_priv(vq);
193 168
194 /* Disable streaming from the pipe */ 169 /* Disable streaming from the pipe */
195 vimc_cap_pipeline_s_stream(vcap, 0); 170 vimc_pipeline_s_stream(&vcap->vdev.entity, 0);
196 171
197 /* Stop the media pipeline */ 172 /* Stop the media pipeline */
198 media_pipeline_stop(&vcap->vdev.entity); 173 media_pipeline_stop(&vcap->vdev.entity);