summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx88
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-08-29 06:06:37 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-03 08:33:29 -0200
commitfb37ab3e788c698bf889e70335d5d1ccb6de2373 (patch)
tree867677e647ac431a24280f9ff856f2ad23c177f8 /drivers/media/pci/cx88
parentccd6f1d488e7e49ca90d4255cb3f8a2f61951e55 (diff)
downloadlinux-stable-fb37ab3e788c698bf889e70335d5d1ccb6de2373.tar.gz
linux-stable-fb37ab3e788c698bf889e70335d5d1ccb6de2373.tar.bz2
linux-stable-fb37ab3e788c698bf889e70335d5d1ccb6de2373.zip
[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: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci/cx88')
-rw-r--r--drivers/media/pci/cx88/cx88-blackbird.c11
-rw-r--r--drivers/media/pci/cx88/cx88.h1
2 files changed, 5 insertions, 7 deletions
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c
index 58e5254e154a..13b8ed322693 100644
--- a/drivers/media/pci/cx88/cx88-blackbird.c
+++ b/drivers/media/pci/cx88/cx88-blackbird.c
@@ -536,9 +536,6 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev)
dprintk(1,"Initialize codec\n");
retval = blackbird_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); /* ping */
if (retval < 0) {
-
- dev->mpeg_active = 0;
-
/* ping was not successful, reset and upload firmware */
cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */
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
);
- dev->mpeg_active = 1;
return 0;
}
@@ -636,7 +632,6 @@ static int blackbird_stop_codec(struct cx8802_dev *dev)
cx2341x_handler_set_busy(&dev->cxhdl, 0);
- dev->mpeg_active = 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 cx88_core *core = dev->core;
+ bool streaming;
if (unlikely(UNSET == core->board.tuner_type))
return -EINVAL;
if (unlikely(f->tuner != 0))
return -EINVAL;
- if (dev->mpeg_active)
+ streaming = dev->vb2_mpegq.start_streaming_called;
+ if (streaming)
blackbird_stop_codec(dev);
cx88_set_freq (core,f);
blackbird_initialize_codec(dev);
cx88_set_scale(core, core->width, core->height,
core->field);
+ if (streaming)
+ blackbird_start_codec(dev);
return 0;
}
diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h
index 862c60938663..93bc7cf7d39b 100644
--- a/drivers/media/pci/cx88/cx88.h
+++ b/drivers/media/pci/cx88/cx88.h
@@ -557,7 +557,6 @@ struct cx8802_dev {
#if IS_ENABLED(CONFIG_VIDEO_CX88_BLACKBIRD)
struct video_device *mpeg_dev;
u32 mailbox;
- unsigned char mpeg_active; /* nonzero if mpeg encoder is active */
/* mpeg params */
struct cx2341x_handler cxhdl;