diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2014-08-29 05:06:37 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-03 05:33:29 -0500 |
commit | fb37ab3e788c698bf889e70335d5d1ccb6de2373 (patch) | |
tree | 867677e647ac431a24280f9ff856f2ad23c177f8 | |
parent | ccd6f1d488e7e49ca90d4255cb3f8a2f61951e55 (diff) |
[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>
-rw-r--r-- | drivers/media/pci/cx88/cx88-blackbird.c | 11 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88.h | 1 |
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) | |||
536 | dprintk(1,"Initialize codec\n"); | 536 | dprintk(1,"Initialize codec\n"); |
537 | retval = blackbird_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); /* ping */ | 537 | retval = blackbird_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); /* ping */ |
538 | if (retval < 0) { | 538 | if (retval < 0) { |
539 | |||
540 | dev->mpeg_active = 0; | ||
541 | |||
542 | /* ping was not successful, reset and upload firmware */ | 539 | /* ping was not successful, reset and upload firmware */ |
543 | cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */ | 540 | cx_write(MO_SRST_IO, 0); /* SYS_RSTO=0 */ |
544 | cx_write(MO_SRST_IO, 1); /* SYS_RSTO=1 */ | 541 | cx_write(MO_SRST_IO, 1); /* SYS_RSTO=1 */ |
@@ -622,7 +619,6 @@ static int blackbird_start_codec(struct cx8802_dev *dev) | |||
622 | BLACKBIRD_RAW_BITS_NONE | 619 | BLACKBIRD_RAW_BITS_NONE |
623 | ); | 620 | ); |
624 | 621 | ||
625 | dev->mpeg_active = 1; | ||
626 | return 0; | 622 | return 0; |
627 | } | 623 | } |
628 | 624 | ||
@@ -636,7 +632,6 @@ static int blackbird_stop_codec(struct cx8802_dev *dev) | |||
636 | 632 | ||
637 | cx2341x_handler_set_busy(&dev->cxhdl, 0); | 633 | cx2341x_handler_set_busy(&dev->cxhdl, 0); |
638 | 634 | ||
639 | dev->mpeg_active = 0; | ||
640 | return 0; | 635 | return 0; |
641 | } | 636 | } |
642 | 637 | ||
@@ -875,18 +870,22 @@ static int vidioc_s_frequency (struct file *file, void *priv, | |||
875 | { | 870 | { |
876 | struct cx8802_dev *dev = video_drvdata(file); | 871 | struct cx8802_dev *dev = video_drvdata(file); |
877 | struct cx88_core *core = dev->core; | 872 | struct cx88_core *core = dev->core; |
873 | bool streaming; | ||
878 | 874 | ||
879 | if (unlikely(UNSET == core->board.tuner_type)) | 875 | if (unlikely(UNSET == core->board.tuner_type)) |
880 | return -EINVAL; | 876 | return -EINVAL; |
881 | if (unlikely(f->tuner != 0)) | 877 | if (unlikely(f->tuner != 0)) |
882 | return -EINVAL; | 878 | return -EINVAL; |
883 | if (dev->mpeg_active) | 879 | streaming = dev->vb2_mpegq.start_streaming_called; |
880 | if (streaming) | ||
884 | blackbird_stop_codec(dev); | 881 | blackbird_stop_codec(dev); |
885 | 882 | ||
886 | cx88_set_freq (core,f); | 883 | cx88_set_freq (core,f); |
887 | blackbird_initialize_codec(dev); | 884 | blackbird_initialize_codec(dev); |
888 | cx88_set_scale(core, core->width, core->height, | 885 | cx88_set_scale(core, core->width, core->height, |
889 | core->field); | 886 | core->field); |
887 | if (streaming) | ||
888 | blackbird_start_codec(dev); | ||
890 | return 0; | 889 | return 0; |
891 | } | 890 | } |
892 | 891 | ||
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 { | |||
557 | #if IS_ENABLED(CONFIG_VIDEO_CX88_BLACKBIRD) | 557 | #if IS_ENABLED(CONFIG_VIDEO_CX88_BLACKBIRD) |
558 | struct video_device *mpeg_dev; | 558 | struct video_device *mpeg_dev; |
559 | u32 mailbox; | 559 | u32 mailbox; |
560 | unsigned char mpeg_active; /* nonzero if mpeg encoder is active */ | ||
561 | 560 | ||
562 | /* mpeg params */ | 561 | /* mpeg params */ |
563 | struct cx2341x_handler cxhdl; | 562 | struct cx2341x_handler cxhdl; |