aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tda1004x.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/tda1004x.h')
-rw-r--r--drivers/media/dvb/frontends/tda1004x.h54
1 files changed, 50 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/tda1004x.h b/drivers/media/dvb/frontends/tda1004x.h
index ec502d71b83c..abae84350142 100644
--- a/drivers/media/dvb/frontends/tda1004x.h
+++ b/drivers/media/dvb/frontends/tda1004x.h
@@ -35,9 +35,23 @@ enum tda10046_agc {
35 TDA10046_AGC_DEFAULT, /* original configuration */ 35 TDA10046_AGC_DEFAULT, /* original configuration */
36 TDA10046_AGC_IFO_AUTO_NEG, /* IF AGC only, automatic, negtive */ 36 TDA10046_AGC_IFO_AUTO_NEG, /* IF AGC only, automatic, negtive */
37 TDA10046_AGC_IFO_AUTO_POS, /* IF AGC only, automatic, positive */ 37 TDA10046_AGC_IFO_AUTO_POS, /* IF AGC only, automatic, positive */
38 TDA10046_AGC_TDA827X_GP11, /* IF AGC only, special setup for tda827x */ 38 TDA10046_AGC_TDA827X, /* IF AGC only, special setup for tda827x */
39 TDA10046_AGC_TDA827X_GP00, /* same as above, but GPIOs 0 */ 39};
40 TDA10046_AGC_TDA827X_GP01, /* same as above, but GPIO3=0 GPIO1=1*/ 40
41/* Many (hybrid) boards use GPIO 1 and 3
42 GPIO1 analog - dvb switch
43 GPIO3 firmware eeprom address switch
44*/
45enum tda10046_gpio {
46 TDA10046_GPTRI = 0x00, /* All GPIOs tristate */
47 TDA10046_GP00 = 0x40, /* GPIO3=0, GPIO1=0 */
48 TDA10046_GP01 = 0x42, /* GPIO3=0, GPIO1=1 */
49 TDA10046_GP10 = 0x48, /* GPIO3=1, GPIO1=0 */
50 TDA10046_GP11 = 0x4a, /* GPIO3=1, GPIO1=1 */
51 TDA10046_GP00_I = 0x80, /* GPIO3=0, GPIO1=0, invert in sleep mode*/
52 TDA10046_GP01_I = 0x82, /* GPIO3=0, GPIO1=1, invert in sleep mode */
53 TDA10046_GP10_I = 0x88, /* GPIO3=1, GPIO1=0, invert in sleep mode */
54 TDA10046_GP11_I = 0x8a, /* GPIO3=1, GPIO1=1, invert in sleep mode */
41}; 55};
42 56
43enum tda10046_if { 57enum tda10046_if {
@@ -47,6 +61,11 @@ enum tda10046_if {
47 TDA10046_FREQ_052, /* low IF, 5.1667 MHZ for tda9889 */ 61 TDA10046_FREQ_052, /* low IF, 5.1667 MHZ for tda9889 */
48}; 62};
49 63
64enum tda10046_tsout {
65 TDA10046_TS_PARALLEL = 0x00, /* parallel transport stream, default */
66 TDA10046_TS_SERIAL = 0x01, /* serial transport stream */
67};
68
50struct tda1004x_config 69struct tda1004x_config
51{ 70{
52 /* the demodulator's i2c address */ 71 /* the demodulator's i2c address */
@@ -58,6 +77,9 @@ struct tda1004x_config
58 /* Does the OCLK signal need inverted? */ 77 /* Does the OCLK signal need inverted? */
59 u8 invert_oclk; 78 u8 invert_oclk;
60 79
80 /* parallel or serial transport stream */
81 enum tda10046_tsout ts_mode;
82
61 /* Xtal frequency, 4 or 16MHz*/ 83 /* Xtal frequency, 4 or 16MHz*/
62 enum tda10046_xtal xtal_freq; 84 enum tda10046_xtal xtal_freq;
63 85
@@ -67,11 +89,35 @@ struct tda1004x_config
67 /* AGC configuration */ 89 /* AGC configuration */
68 enum tda10046_agc agc_config; 90 enum tda10046_agc agc_config;
69 91
92 /* setting of GPIO1 and 3 */
93 enum tda10046_gpio gpio_config;
94
95 /* slave address and configuration of the tuner */
96 u8 tuner_address;
97 u8 tuner_config;
98 u8 antenna_switch;
99
100 /* if the board uses another I2c Bridge (tda8290), its address */
101 u8 i2c_gate;
102
70 /* request firmware for device */ 103 /* request firmware for device */
71 /* set this to NULL if the card has a firmware EEPROM */
72 int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name); 104 int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name);
73}; 105};
74 106
107enum tda1004x_demod {
108 TDA1004X_DEMOD_TDA10045,
109 TDA1004X_DEMOD_TDA10046,
110};
111
112struct tda1004x_state {
113 struct i2c_adapter* i2c;
114 const struct tda1004x_config* config;
115 struct dvb_frontend frontend;
116
117 /* private demod data */
118 enum tda1004x_demod demod_type;
119};
120
75#if defined(CONFIG_DVB_TDA1004X) || (defined(CONFIG_DVB_TDA1004X_MODULE) && defined(MODULE)) 121#if defined(CONFIG_DVB_TDA1004X) || (defined(CONFIG_DVB_TDA1004X_MODULE) && defined(MODULE))
76extern struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config, 122extern struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config,
77 struct i2c_adapter* i2c); 123 struct i2c_adapter* i2c);