drivers/media/tuners/tda18271-priv.h

Source file repositories/reference/linux-study-clean/drivers/media/tuners/tda18271-priv.h

File Facts

System
Linux kernel
Corpus path
drivers/media/tuners/tda18271-priv.h
Extension
.h
Size
6837 bytes
Lines
219
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 tda18271_rf_tracking_filter_cal {
	u32 rfmax;
	u8  rfband;
	u32 rf1_def;
	u32 rf2_def;
	u32 rf3_def;
	u32 rf1;
	u32 rf2;
	u32 rf3;
	s32 rf_a1;
	s32 rf_b1;
	s32 rf_a2;
	s32 rf_b2;
};

enum tda18271_pll {
	TDA18271_MAIN_PLL,
	TDA18271_CAL_PLL,
};

struct tda18271_map_layout;

enum tda18271_ver {
	TDA18271HDC1,
	TDA18271HDC2,
};

struct tda18271_priv {
	unsigned char tda18271_regs[TDA18271_NUM_REGS];

	struct list_head	hybrid_tuner_instance_list;
	struct tuner_i2c_props	i2c_props;

	enum tda18271_mode mode;
	enum tda18271_role role;
	enum tda18271_i2c_gate gate;
	enum tda18271_ver id;
	enum tda18271_output_options output_opt;
	enum tda18271_small_i2c small_i2c;

	unsigned int config; /* interface to saa713x / tda829x */
	unsigned int cal_initialized:1;

	u8 tm_rfcal;

	struct tda18271_map_layout *maps;
	struct tda18271_std_map std;
	struct tda18271_rf_tracking_filter_cal rf_cal_state[8];

	struct mutex lock;

	u16 if_freq;

	u32 frequency;
	u32 bandwidth;
};

/*---------------------------------------------------------------------*/

extern int tda18271_debug;

#define DBG_INFO 1
#define DBG_MAP  2
#define DBG_REG  4
#define DBG_ADV  8
#define DBG_CAL  16

__attribute__((format(printf, 4, 5)))
void _tda_printk(struct tda18271_priv *state, const char *level,
		 const char *func, const char *fmt, ...);

#define tda_printk(st, lvl, fmt, arg...)			\
	_tda_printk(st, lvl, __func__, fmt, ##arg)

#define tda_dprintk(st, lvl, fmt, arg...)			\
do {								\
	if (tda18271_debug & lvl)				\
		tda_printk(st, KERN_DEBUG, fmt, ##arg);		\
} while (0)

#define tda_info(fmt, arg...)	pr_info(fmt, ##arg)
#define tda_warn(fmt, arg...)	tda_printk(priv, KERN_WARNING, fmt, ##arg)
#define tda_err(fmt, arg...)	tda_printk(priv, KERN_ERR,     fmt, ##arg)
#define tda_dbg(fmt, arg...)	tda_dprintk(priv, DBG_INFO,    fmt, ##arg)
#define tda_map(fmt, arg...)	tda_dprintk(priv, DBG_MAP,     fmt, ##arg)
#define tda_reg(fmt, arg...)	tda_dprintk(priv, DBG_REG,     fmt, ##arg)
#define tda_cal(fmt, arg...)	tda_dprintk(priv, DBG_CAL,     fmt, ##arg)

#define tda_fail(ret)							     \
({									     \

Annotation

Implementation Notes