drivers/media/tuners/xc4000.c

Source file repositories/reference/linux-study-clean/drivers/media/tuners/xc4000.c

File Facts

System
Linux kernel
Corpus path
drivers/media/tuners/xc4000.c
Extension
.c
Size
45107 bytes
Lines
1752
Domain
Driver Families
Bucket
drivers/media
Inferred role
Driver Families: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct firmware_description {
	unsigned int  type;
	v4l2_std_id   id;
	__u16         int_freq;
	unsigned char *ptr;
	unsigned int  size;
};

struct firmware_properties {
	unsigned int	type;
	v4l2_std_id	id;
	v4l2_std_id	std_req;
	__u16		int_freq;
	unsigned int	scode_table;
	int		scode_nr;
};

struct xc4000_priv {
	struct tuner_i2c_props i2c_props;
	struct list_head hybrid_tuner_instance_list;
	struct firmware_description *firm;
	int	firm_size;
	u32	if_khz;
	u32	freq_hz, freq_offset;
	u32	bandwidth;
	u8	video_standard;
	u8	rf_mode;
	u8	default_pm;
	u8	dvb_amplitude;
	u8	set_smoothedcvbs;
	u8	ignore_i2c_write_errors;
	__u16	firm_version;
	struct firmware_properties cur_fw;
	__u16	hwmodel;
	__u16	hwvers;
	struct mutex	lock;
};

#define XC4000_AUDIO_STD_B		 1
#define XC4000_AUDIO_STD_A2		 2
#define XC4000_AUDIO_STD_K3		 4
#define XC4000_AUDIO_STD_L		 8
#define XC4000_AUDIO_STD_INPUT1		16
#define XC4000_AUDIO_STD_MONO		32

#define XC4000_DEFAULT_FIRMWARE "dvb-fe-xc4000-1.4.fw"
#define XC4000_DEFAULT_FIRMWARE_NEW "dvb-fe-xc4000-1.4.1.fw"

/* Misc Defines */
#define MAX_TV_STANDARD			24
#define XC_MAX_I2C_WRITE_LENGTH		64
#define XC_POWERED_DOWN			0x80000000U

/* Signal Types */
#define XC_RF_MODE_AIR			0
#define XC_RF_MODE_CABLE		1

/* Product id */
#define XC_PRODUCT_ID_FW_NOT_LOADED	0x2000
#define XC_PRODUCT_ID_XC4000		0x0FA0
#define XC_PRODUCT_ID_XC4100		0x1004

/* Registers (Write-only) */
#define XREG_INIT         0x00
#define XREG_VIDEO_MODE   0x01
#define XREG_AUDIO_MODE   0x02
#define XREG_RF_FREQ      0x03
#define XREG_D_CODE       0x04
#define XREG_DIRECTSITTING_MODE 0x05
#define XREG_SEEK_MODE    0x06
#define XREG_POWER_DOWN   0x08
#define XREG_SIGNALSOURCE 0x0A
#define XREG_SMOOTHEDCVBS 0x0E
#define XREG_AMPLITUDE    0x10

/* Registers (Read-only) */
#define XREG_ADC_ENV      0x00
#define XREG_QUALITY      0x01
#define XREG_FRAME_LINES  0x02
#define XREG_HSYNC_FREQ   0x03
#define XREG_LOCK         0x04
#define XREG_FREQ_ERROR   0x05
#define XREG_SNR          0x06
#define XREG_VERSION      0x07
#define XREG_PRODUCT_ID   0x08
#define XREG_SIGNAL_LEVEL 0x0A
#define XREG_NOISE_LEVEL  0x0B

/*
   Basic firmware description. This will remain with

Annotation

Implementation Notes