xref: /linux/drivers/media/dvb-frontends/rtl2832.h (revision a4eb44a6435d6d8f9e642407a4a06f65eb90ca04)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Realtek RTL2832 DVB-T demodulator driver
4  *
5  * Copyright (C) 2012 Thomas Mair <thomas.mair86@gmail.com>
6  * Copyright (C) 2012-2014 Antti Palosaari <crope@iki.fi>
7  */
8 
9 #ifndef RTL2832_H
10 #define RTL2832_H
11 
12 #include <linux/dvb/frontend.h>
13 #include <linux/i2c-mux.h>
14 
15 /**
16  * struct rtl2832_platform_data - Platform data for the rtl2832 driver
17  * @clk: Clock frequency (4000000, 16000000, 25000000, 28800000).
18  * @tuner: Used tuner model.
19  * @get_dvb_frontend: Get DVB frontend.
20  * @get_i2c_adapter: Get I2C adapter.
21  * @slave_ts_ctrl: Control slave TS interface.
22  * @pid_filter: Set PID to PID filter.
23  * @pid_filter_ctrl: Control PID filter.
24  */
25 struct rtl2832_platform_data {
26 	u32 clk;
27 	/*
28 	 * XXX: This list must be kept sync with dvb_usb_rtl28xxu USB IF driver.
29 	 */
30 #define RTL2832_TUNER_FC2580    0x21
31 #define RTL2832_TUNER_TUA9001   0x24
32 #define RTL2832_TUNER_FC0012    0x26
33 #define RTL2832_TUNER_E4000     0x27
34 #define RTL2832_TUNER_FC0013    0x29
35 #define RTL2832_TUNER_R820T     0x2a
36 #define RTL2832_TUNER_R828D     0x2b
37 #define RTL2832_TUNER_SI2157    0x2c
38 	u8 tuner;
39 
40 	struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *);
41 	struct i2c_adapter* (*get_i2c_adapter)(struct i2c_client *);
42 	int (*slave_ts_ctrl)(struct i2c_client *, bool);
43 	int (*pid_filter)(struct dvb_frontend *, u8, u16, int);
44 	int (*pid_filter_ctrl)(struct dvb_frontend *, int);
45 /* private: Register access for SDR module use only */
46 	struct regmap *regmap;
47 };
48 
49 #endif /* RTL2832_H */
50