drivers/media/usb/dvb-usb-v2/rtl28xxu.h

Source file repositories/reference/linux-study-clean/drivers/media/usb/dvb-usb-v2/rtl28xxu.h

File Facts

System
Linux kernel
Corpus path
drivers/media/usb/dvb-usb-v2/rtl28xxu.h
Extension
.h
Size
9544 bytes
Lines
280
Domain
Driver Families
Bucket
drivers/media
Inferred role
Driver Families: implementation source
Status
source 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 rtl28xxu_dev {
	u8 buf[128];
	u8 chip_id;
	u8 tuner;
	char *tuner_name;
	u8 page; /* integrated demod active register page */
	struct i2c_adapter *demod_i2c_adapter;
	bool rc_active;
	bool new_i2c_write;
	struct i2c_client *i2c_client_demod;
	struct i2c_client *i2c_client_tuner;
	struct i2c_client *i2c_client_slave_demod;
	struct platform_device *platform_device_sdr;
	#define SLAVE_DEMOD_NONE           0
	#define SLAVE_DEMOD_MN88472        1
	#define SLAVE_DEMOD_MN88473        2
	#define SLAVE_DEMOD_SI2168         3
	#define SLAVE_DEMOD_CXD2837ER      4
	unsigned int slave_demod:3;
	union {
		struct rtl2830_platform_data rtl2830_platform_data;
		struct rtl2832_platform_data rtl2832_platform_data;
	};
};

enum rtl28xxu_chip_id {
	CHIP_ID_NONE,
	CHIP_ID_RTL2831U,
	CHIP_ID_RTL2832U,
};

/* XXX: Hack. This must be keep sync with rtl2832 demod driver. */
enum rtl28xxu_tuner {
	TUNER_NONE,

	TUNER_RTL2830_QT1010          = 0x10,
	TUNER_RTL2830_MT2060,
	TUNER_RTL2830_MXL5005S,

	TUNER_RTL2832_MT2266          = 0x20,
	TUNER_RTL2832_FC2580,
	TUNER_RTL2832_MT2063,
	TUNER_RTL2832_MAX3543,
	TUNER_RTL2832_TUA9001,
	TUNER_RTL2832_MXL5007T,
	TUNER_RTL2832_FC0012,
	TUNER_RTL2832_E4000,
	TUNER_RTL2832_TDA18272,
	TUNER_RTL2832_FC0013,
	TUNER_RTL2832_R820T,
	TUNER_RTL2832_R828D,
	TUNER_RTL2832_SI2157,
};

struct rtl28xxu_req {
	u16 value;
	u16 index;
	u16 size;
	u8 *data;
};

struct rtl28xxu_reg_val {
	u16 reg;
	u8 val;
};

struct rtl28xxu_reg_val_mask {
	u16 reg;
	u8 val;
	u8 mask;
};

/*
 * memory map
 *
 * 0x0000 DEMOD : demodulator
 * 0x2000 USB   : SIE, USB endpoint, debug, DMA
 * 0x3000 SYS   : system
 * 0xfc00 RC    : remote controller (not RTL2831U)
 */

/*
 * USB registers
 */
/* SIE Control Registers */
#define USB_SYSCTL         0x2000 /* USB system control */
#define USB_SYSCTL_0       0x2000 /* USB system control */
#define USB_SYSCTL_1       0x2001 /* USB system control */
#define USB_SYSCTL_2       0x2002 /* USB system control */
#define USB_SYSCTL_3       0x2003 /* USB system control */

Annotation

Implementation Notes