static u8 channel_first_int[VPIF_NUMBER_OF_OBJECTS][2] = { {1, 1} };
+/* Is set to 1 in case of SDTV formats, 2 in case of HDTV formats. */
+static int ycmux_mode;
+
static inline struct vpif_cap_buffer *to_vpif_buffer(struct vb2_buffer *vb)
{
return container_of(vb, struct vpif_cap_buffer, vb);
spin_lock_irqsave(&common->irqlock, flags);
- /* Initialize field_id and started member */
+ /* Initialize field_id */
ch->field_id = 0;
- common->started = 1;
/* configure 1 or 2 channel mode */
if (vpif_config_data->setup_input_channel_mode) {
/* Call vpif_set_params function to set the parameters and addresses */
ret = vpif_set_video_params(vpif, ch->channel_id);
-
if (ret < 0) {
vpif_dbg(1, debug, "can't set video params\n");
goto err;
}
- common->started = ret;
+ ycmux_mode = ret;
vpif_config_addr(ch, ret);
/* Get the next frame from the buffer queue */
enable_channel0(1);
}
if (VPIF_CHANNEL1_VIDEO == ch->channel_id ||
- common->started == 2) {
+ ycmux_mode == 2) {
channel1_intr_assert();
channel1_intr_enable(1);
enable_channel1(1);
channel0_intr_enable(0);
}
if (VPIF_CHANNEL1_VIDEO == ch->channel_id ||
- 2 == common->started) {
+ ycmux_mode == 2) {
enable_channel1(0);
channel1_intr_enable(0);
}
- common->started = 0;
+
+ ycmux_mode = 0;
ret = v4l2_subdev_call(ch->sd, video, s_stream, 0);
if (ret && ret != -ENOIOCTLCMD && ret != -ENODEV)
for (i = 0; i < VPIF_NUMBER_OF_OBJECTS; i++) {
common = &ch->common[i];
/* skip If streaming is not started in this channel */
- if (0 == common->started)
- continue;
-
/* Check the field format */
if (1 == ch->vpifparams.std_info.frm_fmt) {
/* Progressive mode */
vpif_dbg(2, debug, "vpif_s_std\n");
- if (common->started) {
- vpif_err("streaming in progress\n");
+ if (vb2_is_busy(&common->buffer_queue))
return -EBUSY;
- }
/* Call encoder subdevice function to set the standard */
ch->video.stdid = std_id;
if (index >= chan_cfg->input_count)
return -EINVAL;
- if (common->started) {
- vpif_err("Streaming in progress\n");
+ if (vb2_is_busy(&common->buffer_queue))
return -EBUSY;
- }
return vpif_set_input(config, ch, index);
}
vpif_dbg(2, debug, "%s\n", __func__);
- /* If streaming is started, return error */
- if (common->started) {
- vpif_dbg(1, debug, "Streaming is started\n");
+ if (vb2_is_busy(&common->buffer_queue))
return -EBUSY;
- }
pixfmt = &fmt->fmt.pix;
/* Check for valid field format */
channel0_intr_enable(0);
}
if (ch->channel_id == VPIF_CHANNEL1_VIDEO ||
- common->started == 2) {
+ ycmux_mode == 2) {
enable_channel1(0);
channel1_intr_enable(0);
}
channel0_intr_enable(1);
}
if (ch->channel_id == VPIF_CHANNEL1_VIDEO ||
- common->started == 2) {
+ ycmux_mode == 2) {
enable_channel1(1);
channel1_intr_enable(1);
}