diff options
Diffstat (limited to 'drivers/media/pci/saa7134/saa7134.h')
-rw-r--r-- | drivers/media/pci/saa7134/saa7134.h | 66 |
1 files changed, 52 insertions, 14 deletions
diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h index 8d1453a48014..2474e848f2c0 100644 --- a/drivers/media/pci/saa7134/saa7134.h +++ b/drivers/media/pci/saa7134/saa7134.h | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <media/v4l2-ioctl.h> | 37 | #include <media/v4l2-ioctl.h> |
38 | #include <media/v4l2-device.h> | 38 | #include <media/v4l2-device.h> |
39 | #include <media/v4l2-fh.h> | 39 | #include <media/v4l2-fh.h> |
40 | #include <media/v4l2-ctrls.h> | ||
40 | #include <media/tuner.h> | 41 | #include <media/tuner.h> |
41 | #include <media/rc-core.h> | 42 | #include <media/rc-core.h> |
42 | #include <media/ir-kbd-i2c.h> | 43 | #include <media/ir-kbd-i2c.h> |
@@ -410,12 +411,18 @@ struct saa7134_board { | |||
410 | #define card(dev) (saa7134_boards[dev->board]) | 411 | #define card(dev) (saa7134_boards[dev->board]) |
411 | #define card_in(dev,n) (saa7134_boards[dev->board].inputs[n]) | 412 | #define card_in(dev,n) (saa7134_boards[dev->board].inputs[n]) |
412 | 413 | ||
414 | #define V4L2_CID_PRIVATE_INVERT (V4L2_CID_USER_SAA7134_BASE + 0) | ||
415 | #define V4L2_CID_PRIVATE_Y_ODD (V4L2_CID_USER_SAA7134_BASE + 1) | ||
416 | #define V4L2_CID_PRIVATE_Y_EVEN (V4L2_CID_USER_SAA7134_BASE + 2) | ||
417 | #define V4L2_CID_PRIVATE_AUTOMUTE (V4L2_CID_USER_SAA7134_BASE + 3) | ||
418 | |||
413 | /* ----------------------------------------------------------- */ | 419 | /* ----------------------------------------------------------- */ |
414 | /* device / file handle status */ | 420 | /* device / file handle status */ |
415 | 421 | ||
416 | #define RESOURCE_OVERLAY 1 | 422 | #define RESOURCE_OVERLAY 1 |
417 | #define RESOURCE_VIDEO 2 | 423 | #define RESOURCE_VIDEO 2 |
418 | #define RESOURCE_VBI 4 | 424 | #define RESOURCE_VBI 4 |
425 | #define RESOURCE_EMPRESS 8 | ||
419 | 426 | ||
420 | #define INTERLACE_AUTO 0 | 427 | #define INTERLACE_AUTO 0 |
421 | #define INTERLACE_ON 1 | 428 | #define INTERLACE_ON 1 |
@@ -470,16 +477,8 @@ struct saa7134_dmaqueue { | |||
470 | /* video filehandle status */ | 477 | /* video filehandle status */ |
471 | struct saa7134_fh { | 478 | struct saa7134_fh { |
472 | struct v4l2_fh fh; | 479 | struct v4l2_fh fh; |
473 | struct saa7134_dev *dev; | 480 | bool is_empress; |
474 | unsigned int resources; | 481 | unsigned int resources; |
475 | |||
476 | /* video capture */ | ||
477 | struct videobuf_queue cap; | ||
478 | struct saa7134_pgtable pt_cap; | ||
479 | |||
480 | /* vbi capture */ | ||
481 | struct videobuf_queue vbi; | ||
482 | struct saa7134_pgtable pt_vbi; | ||
483 | }; | 482 | }; |
484 | 483 | ||
485 | /* dmasound dsp status */ | 484 | /* dmasound dsp status */ |
@@ -589,7 +588,11 @@ struct saa7134_dev { | |||
589 | 588 | ||
590 | /* video+ts+vbi capture */ | 589 | /* video+ts+vbi capture */ |
591 | struct saa7134_dmaqueue video_q; | 590 | struct saa7134_dmaqueue video_q; |
591 | struct videobuf_queue cap; | ||
592 | struct saa7134_pgtable pt_cap; | ||
592 | struct saa7134_dmaqueue vbi_q; | 593 | struct saa7134_dmaqueue vbi_q; |
594 | struct videobuf_queue vbi; | ||
595 | struct saa7134_pgtable pt_vbi; | ||
593 | unsigned int video_fieldcount; | 596 | unsigned int video_fieldcount; |
594 | unsigned int vbi_fieldcount; | 597 | unsigned int vbi_fieldcount; |
595 | struct saa7134_format *fmt; | 598 | struct saa7134_format *fmt; |
@@ -599,6 +602,7 @@ struct saa7134_dev { | |||
599 | /* various v4l controls */ | 602 | /* various v4l controls */ |
600 | struct saa7134_tvnorm *tvnorm; /* video */ | 603 | struct saa7134_tvnorm *tvnorm; /* video */ |
601 | struct saa7134_tvaudio *tvaudio; | 604 | struct saa7134_tvaudio *tvaudio; |
605 | struct v4l2_ctrl_handler ctrl_handler; | ||
602 | unsigned int ctl_input; | 606 | unsigned int ctl_input; |
603 | int ctl_bright; | 607 | int ctl_bright; |
604 | int ctl_contrast; | 608 | int ctl_contrast; |
@@ -626,6 +630,7 @@ struct saa7134_dev { | |||
626 | int last_carrier; | 630 | int last_carrier; |
627 | int nosignal; | 631 | int nosignal; |
628 | unsigned int insuspend; | 632 | unsigned int insuspend; |
633 | struct v4l2_ctrl_handler radio_ctrl_handler; | ||
629 | 634 | ||
630 | /* I2C keyboard data */ | 635 | /* I2C keyboard data */ |
631 | struct IR_i2c_init_data init_data; | 636 | struct IR_i2c_init_data init_data; |
@@ -638,10 +643,11 @@ struct saa7134_dev { | |||
638 | 643 | ||
639 | /* SAA7134_MPEG_EMPRESS only */ | 644 | /* SAA7134_MPEG_EMPRESS only */ |
640 | struct video_device *empress_dev; | 645 | struct video_device *empress_dev; |
646 | struct v4l2_subdev *empress_sd; | ||
641 | struct videobuf_queue empress_tsq; | 647 | struct videobuf_queue empress_tsq; |
642 | atomic_t empress_users; | ||
643 | struct work_struct empress_workqueue; | 648 | struct work_struct empress_workqueue; |
644 | int empress_started; | 649 | int empress_started; |
650 | struct v4l2_ctrl_handler empress_ctrl_handler; | ||
645 | 651 | ||
646 | #if IS_ENABLED(CONFIG_VIDEO_SAA7134_DVB) | 652 | #if IS_ENABLED(CONFIG_VIDEO_SAA7134_DVB) |
647 | /* SAA7134_MPEG_DVB only */ | 653 | /* SAA7134_MPEG_DVB only */ |
@@ -699,6 +705,16 @@ struct saa7134_dev { | |||
699 | _rc; \ | 705 | _rc; \ |
700 | }) | 706 | }) |
701 | 707 | ||
708 | static inline int res_check(struct saa7134_fh *fh, unsigned int bit) | ||
709 | { | ||
710 | return fh->resources & bit; | ||
711 | } | ||
712 | |||
713 | static inline int res_locked(struct saa7134_dev *dev, unsigned int bit) | ||
714 | { | ||
715 | return dev->resources & bit; | ||
716 | } | ||
717 | |||
702 | /* ----------------------------------------------------------- */ | 718 | /* ----------------------------------------------------------- */ |
703 | /* saa7134-core.c */ | 719 | /* saa7134-core.c */ |
704 | 720 | ||
@@ -761,10 +777,31 @@ extern unsigned int video_debug; | |||
761 | extern struct video_device saa7134_video_template; | 777 | extern struct video_device saa7134_video_template; |
762 | extern struct video_device saa7134_radio_template; | 778 | extern struct video_device saa7134_radio_template; |
763 | 779 | ||
764 | int saa7134_s_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c); | 780 | int saa7134_s_std(struct file *file, void *priv, v4l2_std_id id); |
765 | int saa7134_g_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, struct v4l2_control *c); | 781 | int saa7134_g_std(struct file *file, void *priv, v4l2_std_id *id); |
766 | int saa7134_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *c); | 782 | int saa7134_enum_input(struct file *file, void *priv, struct v4l2_input *i); |
767 | int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_std_id id); | 783 | int saa7134_g_input(struct file *file, void *priv, unsigned int *i); |
784 | int saa7134_s_input(struct file *file, void *priv, unsigned int i); | ||
785 | int saa7134_querycap(struct file *file, void *priv, | ||
786 | struct v4l2_capability *cap); | ||
787 | int saa7134_g_tuner(struct file *file, void *priv, | ||
788 | struct v4l2_tuner *t); | ||
789 | int saa7134_s_tuner(struct file *file, void *priv, | ||
790 | const struct v4l2_tuner *t); | ||
791 | int saa7134_g_frequency(struct file *file, void *priv, | ||
792 | struct v4l2_frequency *f); | ||
793 | int saa7134_s_frequency(struct file *file, void *priv, | ||
794 | const struct v4l2_frequency *f); | ||
795 | int saa7134_reqbufs(struct file *file, void *priv, | ||
796 | struct v4l2_requestbuffers *p); | ||
797 | int saa7134_querybuf(struct file *file, void *priv, | ||
798 | struct v4l2_buffer *b); | ||
799 | int saa7134_qbuf(struct file *file, void *priv, struct v4l2_buffer *b); | ||
800 | int saa7134_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b); | ||
801 | int saa7134_streamon(struct file *file, void *priv, | ||
802 | enum v4l2_buf_type type); | ||
803 | int saa7134_streamoff(struct file *file, void *priv, | ||
804 | enum v4l2_buf_type type); | ||
768 | 805 | ||
769 | int saa7134_videoport_init(struct saa7134_dev *dev); | 806 | int saa7134_videoport_init(struct saa7134_dev *dev); |
770 | void saa7134_set_tvnorm_hw(struct saa7134_dev *dev); | 807 | void saa7134_set_tvnorm_hw(struct saa7134_dev *dev); |
@@ -773,6 +810,7 @@ int saa7134_video_init1(struct saa7134_dev *dev); | |||
773 | int saa7134_video_init2(struct saa7134_dev *dev); | 810 | int saa7134_video_init2(struct saa7134_dev *dev); |
774 | void saa7134_irq_video_signalchange(struct saa7134_dev *dev); | 811 | void saa7134_irq_video_signalchange(struct saa7134_dev *dev); |
775 | void saa7134_irq_video_done(struct saa7134_dev *dev, unsigned long status); | 812 | void saa7134_irq_video_done(struct saa7134_dev *dev, unsigned long status); |
813 | void saa7134_video_fini(struct saa7134_dev *dev); | ||
776 | 814 | ||
777 | 815 | ||
778 | /* ----------------------------------------------------------- */ | 816 | /* ----------------------------------------------------------- */ |