Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb37ab3e authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] cx88: drop mpeg_active field



The vb2 framework knows if streaming is in progress, no need to use
a separate field for that.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent ccd6f1d4
Loading
Loading
Loading
Loading
+5 −6
Original line number Original line Diff line number Diff line
@@ -536,9 +536,6 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev)
	dprintk(1,"Initialize codec\n");
	dprintk(1,"Initialize codec\n");
	retval = blackbird_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); /* ping */
	retval = blackbird_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); /* ping */
	if (retval < 0) {
	if (retval < 0) {

		dev->mpeg_active = 0;

		/* ping was not successful, reset and upload firmware */
		/* ping was not successful, reset and upload firmware */
		cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */
		cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */
		cx_write(MO_SRST_IO, 1); /* SYS_RSTO=1 */
		cx_write(MO_SRST_IO, 1); /* SYS_RSTO=1 */
@@ -622,7 +619,6 @@ static int blackbird_start_codec(struct cx8802_dev *dev)
			BLACKBIRD_RAW_BITS_NONE
			BLACKBIRD_RAW_BITS_NONE
		);
		);


	dev->mpeg_active = 1;
	return 0;
	return 0;
}
}


@@ -636,7 +632,6 @@ static int blackbird_stop_codec(struct cx8802_dev *dev)


	cx2341x_handler_set_busy(&dev->cxhdl, 0);
	cx2341x_handler_set_busy(&dev->cxhdl, 0);


	dev->mpeg_active = 0;
	return 0;
	return 0;
}
}


@@ -875,18 +870,22 @@ static int vidioc_s_frequency (struct file *file, void *priv,
{
{
	struct cx8802_dev *dev = video_drvdata(file);
	struct cx8802_dev *dev = video_drvdata(file);
	struct cx88_core *core = dev->core;
	struct cx88_core *core = dev->core;
	bool streaming;


	if (unlikely(UNSET == core->board.tuner_type))
	if (unlikely(UNSET == core->board.tuner_type))
		return -EINVAL;
		return -EINVAL;
	if (unlikely(f->tuner != 0))
	if (unlikely(f->tuner != 0))
		return -EINVAL;
		return -EINVAL;
	if (dev->mpeg_active)
	streaming = dev->vb2_mpegq.start_streaming_called;
	if (streaming)
		blackbird_stop_codec(dev);
		blackbird_stop_codec(dev);


	cx88_set_freq (core,f);
	cx88_set_freq (core,f);
	blackbird_initialize_codec(dev);
	blackbird_initialize_codec(dev);
	cx88_set_scale(core, core->width, core->height,
	cx88_set_scale(core, core->width, core->height,
			core->field);
			core->field);
	if (streaming)
		blackbird_start_codec(dev);
	return 0;
	return 0;
}
}


+0 −1
Original line number Original line Diff line number Diff line
@@ -557,7 +557,6 @@ struct cx8802_dev {
#if IS_ENABLED(CONFIG_VIDEO_CX88_BLACKBIRD)
#if IS_ENABLED(CONFIG_VIDEO_CX88_BLACKBIRD)
	struct video_device        *mpeg_dev;
	struct video_device        *mpeg_dev;
	u32                        mailbox;
	u32                        mailbox;
	unsigned char              mpeg_active; /* nonzero if mpeg encoder is active */


	/* mpeg params */
	/* mpeg params */
	struct cx2341x_handler     cxhdl;
	struct cx2341x_handler     cxhdl;