#define SAA7134_VERSION …
#define pr_fmt(fmt) …
#include <linux/pci.h>
#include <linux/i2c.h>
#include <linux/videodev2.h>
#include <linux/kdev_t.h>
#include <linux/input.h>
#include <linux/notifier.h>
#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/pm_qos.h>
#include <asm/io.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-ctrls.h>
#include <media/tuner.h>
#include <media/rc-core.h>
#include <media/i2c/ir-kbd-i2c.h>
#include <media/videobuf2-dma-sg.h>
#include <sound/core.h>
#include <sound/pcm.h>
#if IS_ENABLED(CONFIG_VIDEO_SAA7134_DVB)
#include <media/videobuf2-dvb.h>
#endif
#include "tda8290.h"
#define UNSET …
enum saa7134_tvaudio_mode { … };
enum saa7134_audio_in { … };
enum saa7134_video_out { … };
struct saa7134_tvnorm { … };
struct saa7134_tvaudio { … };
struct saa7134_format { … };
struct saa7134_card_ir { … };
#define SAA7134_BOARD_NOAUTO …
#define SAA7134_BOARD_UNKNOWN …
#define SAA7134_BOARD_PROTEUS_PRO …
#define SAA7134_BOARD_FLYVIDEO3000 …
#define SAA7134_BOARD_FLYVIDEO2000 …
#define SAA7134_BOARD_EMPRESS …
#define SAA7134_BOARD_MONSTERTV …
#define SAA7134_BOARD_MD9717 …
#define SAA7134_BOARD_TVSTATION_RDS …
#define SAA7134_BOARD_CINERGY400 …
#define SAA7134_BOARD_MD5044 …
#define SAA7134_BOARD_KWORLD …
#define SAA7134_BOARD_CINERGY600 …
#define SAA7134_BOARD_MD7134 …
#define SAA7134_BOARD_TYPHOON_90031 …
#define SAA7134_BOARD_ELSA …
#define SAA7134_BOARD_ELSA_500TV …
#define SAA7134_BOARD_ASUSTeK_TVFM7134 …
#define SAA7134_BOARD_VA1000POWER …
#define SAA7134_BOARD_BMK_MPEX_NOTUNER …
#define SAA7134_BOARD_VIDEOMATE_TV …
#define SAA7134_BOARD_CRONOS_PLUS …
#define SAA7134_BOARD_10MOONSTVMASTER …
#define SAA7134_BOARD_MD2819 …
#define SAA7134_BOARD_BMK_MPEX_TUNER …
#define SAA7134_BOARD_TVSTATION_DVR …
#define SAA7134_BOARD_ASUSTEK_TVFM7133 …
#define SAA7134_BOARD_PINNACLE_PCTV_STEREO …
#define SAA7134_BOARD_MANLI_MTV002 …
#define SAA7134_BOARD_MANLI_MTV001 …
#define SAA7134_BOARD_TG3000TV …
#define SAA7134_BOARD_ECS_TVP3XP …
#define SAA7134_BOARD_ECS_TVP3XP_4CB5 …
#define SAA7134_BOARD_AVACSSMARTTV …
#define SAA7134_BOARD_AVERMEDIA_DVD_EZMAKER …
#define SAA7134_BOARD_NOVAC_PRIMETV7133 …
#define SAA7134_BOARD_AVERMEDIA_STUDIO_305 …
#define SAA7134_BOARD_UPMOST_PURPLE_TV …
#define SAA7134_BOARD_ITEMS_MTV005 …
#define SAA7134_BOARD_CINERGY200 …
#define SAA7134_BOARD_FLYTVPLATINUM_MINI …
#define SAA7134_BOARD_VIDEOMATE_TV_PVR …
#define SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUS …
#define SAA7134_BOARD_SABRENT_SBTTVFM …
#define SAA7134_BOARD_ZOLID_XPERT_TV7134 …
#define SAA7134_BOARD_EMPIRE_PCI_TV_RADIO_LE …
#define SAA7134_BOARD_AVERMEDIA_STUDIO_307 …
#define SAA7134_BOARD_AVERMEDIA_CARDBUS …
#define SAA7134_BOARD_CINERGY400_CARDBUS …
#define SAA7134_BOARD_CINERGY600_MK3 …
#define SAA7134_BOARD_VIDEOMATE_GOLD_PLUS …
#define SAA7134_BOARD_PINNACLE_300I_DVBT_PAL …
#define SAA7134_BOARD_PROVIDEO_PV952 …
#define SAA7134_BOARD_AVERMEDIA_305 …
#define SAA7134_BOARD_ASUSTeK_TVFM7135 …
#define SAA7134_BOARD_FLYTVPLATINUM_FM …
#define SAA7134_BOARD_FLYDVBTDUO …
#define SAA7134_BOARD_AVERMEDIA_307 …
#define SAA7134_BOARD_AVERMEDIA_GO_007_FM …
#define SAA7134_BOARD_ADS_INSTANT_TV …
#define SAA7134_BOARD_KWORLD_VSTREAM_XPERT …
#define SAA7134_BOARD_FLYDVBT_DUO_CARDBUS …
#define SAA7134_BOARD_PHILIPS_TOUGH …
#define SAA7134_BOARD_VIDEOMATE_TV_GOLD_PLUSII …
#define SAA7134_BOARD_KWORLD_XPERT …
#define SAA7134_BOARD_FLYTV_DIGIMATRIX …
#define SAA7134_BOARD_KWORLD_TERMINATOR …
#define SAA7134_BOARD_YUAN_TUN900 …
#define SAA7134_BOARD_BEHOLD_409FM …
#define SAA7134_BOARD_GOTVIEW_7135 …
#define SAA7134_BOARD_PHILIPS_EUROPA …
#define SAA7134_BOARD_VIDEOMATE_DVBT_300 …
#define SAA7134_BOARD_VIDEOMATE_DVBT_200 …
#define SAA7134_BOARD_RTD_VFG7350 …
#define SAA7134_BOARD_RTD_VFG7330 …
#define SAA7134_BOARD_FLYTVPLATINUM_MINI2 …
#define SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180 …
#define SAA7134_BOARD_MONSTERTV_MOBILE …
#define SAA7134_BOARD_PINNACLE_PCTV_110i …
#define SAA7134_BOARD_ASUSTeK_P7131_DUAL …
#define SAA7134_BOARD_SEDNA_PC_TV_CARDBUS …
#define SAA7134_BOARD_ASUSTEK_DIGIMATRIX_TV …
#define SAA7134_BOARD_PHILIPS_TIGER …
#define SAA7134_BOARD_MSI_TVATANYWHERE_PLUS …
#define SAA7134_BOARD_CINERGY250PCI …
#define SAA7134_BOARD_FLYDVB_TRIO …
#define SAA7134_BOARD_AVERMEDIA_777 …
#define SAA7134_BOARD_FLYDVBT_LR301 …
#define SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331 …
#define SAA7134_BOARD_TEVION_DVBT_220RF …
#define SAA7134_BOARD_ELSA_700TV …
#define SAA7134_BOARD_KWORLD_ATSC110 …
#define SAA7134_BOARD_AVERMEDIA_A169_B …
#define SAA7134_BOARD_AVERMEDIA_A169_B1 …
#define SAA7134_BOARD_MD7134_BRIDGE_2 …
#define SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS …
#define SAA7134_BOARD_FLYVIDEO3000_NTSC …
#define SAA7134_BOARD_MEDION_MD8800_QUADRO …
#define SAA7134_BOARD_FLYDVBS_LR300 …
#define SAA7134_BOARD_PROTEUS_2309 …
#define SAA7134_BOARD_AVERMEDIA_A16AR …
#define SAA7134_BOARD_ASUS_EUROPA2_HYBRID …
#define SAA7134_BOARD_PINNACLE_PCTV_310i …
#define SAA7134_BOARD_AVERMEDIA_STUDIO_507 …
#define SAA7134_BOARD_VIDEOMATE_DVBT_200A …
#define SAA7134_BOARD_HAUPPAUGE_HVR1110 …
#define SAA7134_BOARD_CINERGY_HT_PCMCIA …
#define SAA7134_BOARD_ENCORE_ENLTV …
#define SAA7134_BOARD_ENCORE_ENLTV_FM …
#define SAA7134_BOARD_CINERGY_HT_PCI …
#define SAA7134_BOARD_PHILIPS_TIGER_S …
#define SAA7134_BOARD_AVERMEDIA_M102 …
#define SAA7134_BOARD_ASUS_P7131_4871 …
#define SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA …
#define SAA7134_BOARD_ECS_TVP3XP_4CB6 …
#define SAA7134_BOARD_KWORLD_DVBT_210 …
#define SAA7134_BOARD_SABRENT_TV_PCB05 …
#define SAA7134_BOARD_10MOONSTVMASTER3 …
#define SAA7134_BOARD_AVERMEDIA_SUPER_007 …
#define SAA7134_BOARD_BEHOLD_401 …
#define SAA7134_BOARD_BEHOLD_403 …
#define SAA7134_BOARD_BEHOLD_403FM …
#define SAA7134_BOARD_BEHOLD_405 …
#define SAA7134_BOARD_BEHOLD_405FM …
#define SAA7134_BOARD_BEHOLD_407 …
#define SAA7134_BOARD_BEHOLD_407FM …
#define SAA7134_BOARD_BEHOLD_409 …
#define SAA7134_BOARD_BEHOLD_505FM …
#define SAA7134_BOARD_BEHOLD_507_9FM …
#define SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM …
#define SAA7134_BOARD_BEHOLD_607FM_MK3 …
#define SAA7134_BOARD_BEHOLD_M6 …
#define SAA7134_BOARD_TWINHAN_DTV_DVB_3056 …
#define SAA7134_BOARD_GENIUS_TVGO_A11MCE …
#define SAA7134_BOARD_PHILIPS_SNAKE …
#define SAA7134_BOARD_CREATIX_CTX953 …
#define SAA7134_BOARD_MSI_TVANYWHERE_AD11 …
#define SAA7134_BOARD_AVERMEDIA_CARDBUS_506 …
#define SAA7134_BOARD_AVERMEDIA_A16D …
#define SAA7134_BOARD_AVERMEDIA_M115 …
#define SAA7134_BOARD_VIDEOMATE_T750 …
#define SAA7134_BOARD_AVERMEDIA_A700_PRO …
#define SAA7134_BOARD_AVERMEDIA_A700_HYBRID …
#define SAA7134_BOARD_BEHOLD_H6 …
#define SAA7134_BOARD_BEHOLD_M63 …
#define SAA7134_BOARD_BEHOLD_M6_EXTRA …
#define SAA7134_BOARD_AVERMEDIA_M103 …
#define SAA7134_BOARD_ASUSTeK_P7131_ANALOG …
#define SAA7134_BOARD_ASUSTeK_TIGER_3IN1 …
#define SAA7134_BOARD_ENCORE_ENLTV_FM53 …
#define SAA7134_BOARD_AVERMEDIA_M135A …
#define SAA7134_BOARD_REAL_ANGEL_220 …
#define SAA7134_BOARD_ADS_INSTANT_HDTV_PCI …
#define SAA7134_BOARD_ASUSTeK_TIGER …
#define SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG …
#define SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS …
#define SAA7134_BOARD_HAUPPAUGE_HVR1150 …
#define SAA7134_BOARD_HAUPPAUGE_HVR1120 …
#define SAA7134_BOARD_AVERMEDIA_STUDIO_507UA …
#define SAA7134_BOARD_AVERMEDIA_CARDBUS_501 …
#define SAA7134_BOARD_BEHOLD_505RDS_MK5 …
#define SAA7134_BOARD_BEHOLD_507RDS_MK3 …
#define SAA7134_BOARD_BEHOLD_507RDS_MK5 …
#define SAA7134_BOARD_BEHOLD_607FM_MK5 …
#define SAA7134_BOARD_BEHOLD_609FM_MK3 …
#define SAA7134_BOARD_BEHOLD_609FM_MK5 …
#define SAA7134_BOARD_BEHOLD_607RDS_MK3 …
#define SAA7134_BOARD_BEHOLD_607RDS_MK5 …
#define SAA7134_BOARD_BEHOLD_609RDS_MK3 …
#define SAA7134_BOARD_BEHOLD_609RDS_MK5 …
#define SAA7134_BOARD_VIDEOMATE_S350 …
#define SAA7134_BOARD_AVERMEDIA_STUDIO_505 …
#define SAA7134_BOARD_BEHOLD_X7 …
#define SAA7134_BOARD_ROVERMEDIA_LINK_PRO_FM …
#define SAA7134_BOARD_ZOLID_HYBRID_PCI …
#define SAA7134_BOARD_ASUS_EUROPA_HYBRID …
#define SAA7134_BOARD_LEADTEK_WINFAST_DTV1000S …
#define SAA7134_BOARD_BEHOLD_505RDS_MK3 …
#define SAA7134_BOARD_HAWELL_HW_404M7 …
#define SAA7134_BOARD_BEHOLD_H7 …
#define SAA7134_BOARD_BEHOLD_A7 …
#define SAA7134_BOARD_AVERMEDIA_M733A …
#define SAA7134_BOARD_TECHNOTREND_BUDGET_T3000 …
#define SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG …
#define SAA7134_BOARD_VIDEOMATE_M1F …
#define SAA7134_BOARD_ENCORE_ENLTV_FM3 …
#define SAA7134_BOARD_MAGICPRO_PROHDTV_PRO2 …
#define SAA7134_BOARD_BEHOLD_501 …
#define SAA7134_BOARD_BEHOLD_503FM …
#define SAA7134_BOARD_SENSORAY811_911 …
#define SAA7134_BOARD_KWORLD_PC150U …
#define SAA7134_BOARD_ASUSTeK_PS3_100 …
#define SAA7134_BOARD_HAWELL_HW_9004V1 …
#define SAA7134_BOARD_AVERMEDIA_A706 …
#define SAA7134_BOARD_WIS_VOYAGER …
#define SAA7134_BOARD_AVERMEDIA_505 …
#define SAA7134_BOARD_LEADTEK_WINFAST_TV2100_FM …
#define SAA7134_BOARD_SNAZIO_TVPVR_PRO …
#define SAA7134_BOARD_LEADTEK_WINFAST_HDTV200_H …
#define SAA7134_MAXBOARDS …
#define SAA7134_INPUT_MAX …
#define SAA7134_REMOTE_GPIO …
#define SAA7134_REMOTE_I2C …
#define SET_T_CODE_POLARITY_NON_INVERTED …
#define SET_CLOCK_NOT_DELAYED …
#define SET_CLOCK_INVERTED …
#define SET_VSYNC_OFF …
enum saa7134_input_types { … };
struct saa7134_input { … };
enum saa7134_mpeg_type { … };
enum saa7134_mpeg_ts_type { … };
struct saa7134_board { … };
#define card_has_radio(dev) …
#define card_is_empress(dev) …
#define card_is_dvb(dev) …
#define card_is_go7007(dev) …
#define card_has_mpeg(dev) …
#define card(dev) …
#define card_in(dev,n) …
#define V4L2_CID_PRIVATE_INVERT …
#define V4L2_CID_PRIVATE_Y_ODD …
#define V4L2_CID_PRIVATE_Y_EVEN …
#define V4L2_CID_PRIVATE_AUTOMUTE …
#define RESOURCE_VIDEO …
#define RESOURCE_VBI …
#define RESOURCE_EMPRESS …
#define INTERLACE_AUTO …
#define INTERLACE_ON …
#define INTERLACE_OFF …
#define BUFFER_TIMEOUT …
#define TS_BUFFER_TIMEOUT …
struct saa7134_dev;
struct saa7134_dma;
struct saa7134_pgtable { … };
struct saa7134_thread { … };
struct saa7134_buf { … };
struct saa7134_dmaqueue { … };
struct saa7134_dmasound { … };
struct saa7134_ts { … };
struct saa7134_mpeg_ops { … };
enum saa7134_pads { … };
struct saa7134_dev { … };
#define saa_readl(reg) …
#define saa_writel(reg,value) …
#define saa_andorl(reg,mask,value) …
#define saa_setl(reg,bit) …
#define saa_clearl(reg,bit) …
#define saa_readb(reg) …
#define saa_writeb(reg,value) …
#define saa_andorb(reg,mask,value) …
#define saa_setb(reg,bit) …
#define saa_clearb(reg,bit) …
#define saa_wait(us) …
#define SAA7134_NORMS …
#define GRP_EMPRESS …
#define saa_call_all(dev, o, f, args...) …
#define saa_call_empress(dev, o, f, args...) …
static inline bool is_empress(struct file *file)
{ … }
extern struct list_head saa7134_devlist;
extern struct mutex saa7134_devlist_lock;
extern bool saa7134_userptr;
void saa7134_track_gpio(struct saa7134_dev *dev, const char *msg);
void saa7134_set_gpio(struct saa7134_dev *dev, int bit_no, int value);
#define SAA7134_PGTABLE_SIZE …
int saa7134_pgtable_alloc(struct pci_dev *pci, struct saa7134_pgtable *pt);
int saa7134_pgtable_build(struct pci_dev *pci, struct saa7134_pgtable *pt,
struct scatterlist *list, unsigned int length,
unsigned int startpage);
void saa7134_pgtable_free(struct pci_dev *pci, struct saa7134_pgtable *pt);
int saa7134_buffer_count(unsigned int size, unsigned int count);
int saa7134_buffer_startpage(struct saa7134_buf *buf);
unsigned long saa7134_buffer_base(struct saa7134_buf *buf);
int saa7134_buffer_queue(struct saa7134_dev *dev, struct saa7134_dmaqueue *q,
struct saa7134_buf *buf);
void saa7134_buffer_finish(struct saa7134_dev *dev, struct saa7134_dmaqueue *q,
unsigned int state);
void saa7134_buffer_next(struct saa7134_dev *dev, struct saa7134_dmaqueue *q);
void saa7134_buffer_timeout(struct timer_list *t);
void saa7134_stop_streaming(struct saa7134_dev *dev, struct saa7134_dmaqueue *q);
int saa7134_set_dmabits(struct saa7134_dev *dev);
extern int (*saa7134_dmasound_init)(struct saa7134_dev *dev);
extern int (*saa7134_dmasound_exit)(struct saa7134_dev *dev);
extern struct saa7134_board saa7134_boards[];
extern const char * const saa7134_input_name[];
extern const unsigned int saa7134_bcount;
extern struct pci_device_id saa7134_pci_tbl[];
extern int saa7134_board_init1(struct saa7134_dev *dev);
extern int saa7134_board_init2(struct saa7134_dev *dev);
int saa7134_tuner_callback(void *priv, int component, int command, int arg);
int saa7134_i2c_register(struct saa7134_dev *dev);
int saa7134_i2c_unregister(struct saa7134_dev *dev);
extern unsigned int video_debug;
extern struct video_device saa7134_video_template;
extern struct video_device saa7134_radio_template;
void saa7134_vb2_buffer_queue(struct vb2_buffer *vb);
int saa7134_vb2_start_streaming(struct vb2_queue *vq, unsigned int count);
void saa7134_vb2_stop_streaming(struct vb2_queue *vq);
int saa7134_s_std(struct file *file, void *priv, v4l2_std_id id);
int saa7134_g_std(struct file *file, void *priv, v4l2_std_id *id);
int saa7134_querystd(struct file *file, void *priv, v4l2_std_id *std);
int saa7134_enum_input(struct file *file, void *priv, struct v4l2_input *i);
int saa7134_g_input(struct file *file, void *priv, unsigned int *i);
int saa7134_s_input(struct file *file, void *priv, unsigned int i);
int saa7134_querycap(struct file *file, void *priv,
struct v4l2_capability *cap);
int saa7134_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *t);
int saa7134_s_tuner(struct file *file, void *priv,
const struct v4l2_tuner *t);
int saa7134_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f);
int saa7134_s_frequency(struct file *file, void *priv,
const struct v4l2_frequency *f);
int saa7134_videoport_init(struct saa7134_dev *dev);
void saa7134_set_tvnorm_hw(struct saa7134_dev *dev);
int saa7134_video_init1(struct saa7134_dev *dev);
int saa7134_video_init2(struct saa7134_dev *dev);
void saa7134_irq_video_signalchange(struct saa7134_dev *dev);
void saa7134_irq_video_done(struct saa7134_dev *dev, unsigned long status);
void saa7134_video_fini(struct saa7134_dev *dev);
#define TS_PACKET_SIZE …
int saa7134_ts_buffer_init(struct vb2_buffer *vb2);
int saa7134_ts_buffer_prepare(struct vb2_buffer *vb2);
int saa7134_ts_queue_setup(struct vb2_queue *q,
unsigned int *nbuffers, unsigned int *nplanes,
unsigned int sizes[], struct device *alloc_devs[]);
int saa7134_ts_start_streaming(struct vb2_queue *vq, unsigned int count);
void saa7134_ts_stop_streaming(struct vb2_queue *vq);
extern struct vb2_ops saa7134_ts_qops;
int saa7134_ts_init1(struct saa7134_dev *dev);
int saa7134_ts_fini(struct saa7134_dev *dev);
void saa7134_irq_ts_done(struct saa7134_dev *dev, unsigned long status);
int saa7134_ts_register(struct saa7134_mpeg_ops *ops);
void saa7134_ts_unregister(struct saa7134_mpeg_ops *ops);
int saa7134_ts_init_hw(struct saa7134_dev *dev);
int saa7134_ts_start(struct saa7134_dev *dev);
int saa7134_ts_stop(struct saa7134_dev *dev);
extern const struct vb2_ops saa7134_vbi_qops;
int saa7134_vbi_init1(struct saa7134_dev *dev);
int saa7134_vbi_fini(struct saa7134_dev *dev);
void saa7134_irq_vbi_done(struct saa7134_dev *dev, unsigned long status);
int saa7134_tvaudio_rx2mode(u32 rx);
void saa7134_tvaudio_setmute(struct saa7134_dev *dev);
void saa7134_tvaudio_setinput(struct saa7134_dev *dev,
struct saa7134_input *in);
void saa7134_tvaudio_setvolume(struct saa7134_dev *dev, int level);
int saa7134_tvaudio_getstereo(struct saa7134_dev *dev);
void saa7134_tvaudio_init(struct saa7134_dev *dev);
int saa7134_tvaudio_init2(struct saa7134_dev *dev);
int saa7134_tvaudio_fini(struct saa7134_dev *dev);
int saa7134_tvaudio_do_scan(struct saa7134_dev *dev);
int saa7134_tvaudio_close(struct saa7134_dev *dev);
int saa_dsp_writel(struct saa7134_dev *dev, int reg, u32 value);
void saa7134_enable_i2s(struct saa7134_dev *dev);
int saa7134_oss_init1(struct saa7134_dev *dev);
int saa7134_oss_fini(struct saa7134_dev *dev);
void saa7134_irq_oss_done(struct saa7134_dev *dev, unsigned long status);
#if defined(CONFIG_VIDEO_SAA7134_RC)
int saa7134_input_init1(struct saa7134_dev *dev);
void saa7134_input_fini(struct saa7134_dev *dev);
void saa7134_input_irq(struct saa7134_dev *dev);
void saa7134_probe_i2c_ir(struct saa7134_dev *dev);
int saa7134_ir_open(struct rc_dev *dev);
void saa7134_ir_close(struct rc_dev *dev);
#else
#define saa7134_input_init1 …
#define saa7134_input_fini …
#define saa7134_input_irq …
#define saa7134_probe_i2c_ir …
#define saa7134_ir_open …
#define saa7134_ir_close …
#endif