diff options
author | Hartmut Hackmann <hartmut.hackmann@t-online.de> | 2007-04-27 11:31:10 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-27 14:43:29 -0400 |
commit | 1bb0e8667fab773d6c5a3d7caf506001deaeb7f5 (patch) | |
tree | d74d1dca69859a253e9bab9bb3fda2611abcac50 /drivers/media/dvb/frontends/tda1004x.h | |
parent | 2435be11ae1afb64ac7dfb25e10b6e3037ab0522 (diff) |
V4L/DVB (5311): Tda1004x driver updates
There are the following changes:
- separate configuration of IF and GPIOs.
- set GPIOs before firmware load. This helps to avoid I2C address
collisions.
- if desired invert GPIOs at sleep (automatic return to analog mode of card).
- added 3 tuner configuration bytes to config stuct.
- added i2c gate address to config struct.
- moved _state struct declaration to header file to make it accessible
on board layer.
- added "conf_probed" to the state struct to allow i.e. probing for correct
tuner version.
- changed firmware load mechanism to always:
+ check if already loaded
+ try to boot from eeprom
+ try downlad from host
- corrected name of tda10046 firmware image (backward compatible).
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/tda1004x.h')
-rw-r--r-- | drivers/media/dvb/frontends/tda1004x.h | 49 |
1 files changed, 45 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/tda1004x.h b/drivers/media/dvb/frontends/tda1004x.h index ec502d71b83c..886db3f75d56 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 | */ | ||
45 | enum 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 | ||
43 | enum tda10046_if { | 57 | enum tda10046_if { |
@@ -67,11 +81,38 @@ struct tda1004x_config | |||
67 | /* AGC configuration */ | 81 | /* AGC configuration */ |
68 | enum tda10046_agc agc_config; | 82 | enum tda10046_agc agc_config; |
69 | 83 | ||
84 | /* setting of GPIO1 and 3 */ | ||
85 | enum tda10046_gpio gpio_config; | ||
86 | |||
87 | /* slave address and configuration of the tuner */ | ||
88 | u8 tuner_address; | ||
89 | u8 tuner_config; | ||
90 | u8 antenna_switch; | ||
91 | |||
92 | /* if the board uses another I2c Bridge (tda8290), its address */ | ||
93 | u8 i2c_gate; | ||
94 | |||
70 | /* request firmware for device */ | 95 | /* 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); | 96 | int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name); |
73 | }; | 97 | }; |
74 | 98 | ||
99 | enum tda1004x_demod { | ||
100 | TDA1004X_DEMOD_TDA10045, | ||
101 | TDA1004X_DEMOD_TDA10046, | ||
102 | }; | ||
103 | |||
104 | struct tda1004x_state { | ||
105 | struct i2c_adapter* i2c; | ||
106 | const struct tda1004x_config* config; | ||
107 | struct dvb_frontend frontend; | ||
108 | |||
109 | /* this allows to store probed board information */ | ||
110 | int conf_probed; | ||
111 | |||
112 | /* private demod data */ | ||
113 | enum tda1004x_demod demod_type; | ||
114 | }; | ||
115 | |||
75 | #if defined(CONFIG_DVB_TDA1004X) || (defined(CONFIG_DVB_TDA1004X_MODULE) && defined(MODULE)) | 116 | #if defined(CONFIG_DVB_TDA1004X) || (defined(CONFIG_DVB_TDA1004X_MODULE) && defined(MODULE)) |
76 | extern struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config, | 117 | extern struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config, |
77 | struct i2c_adapter* i2c); | 118 | struct i2c_adapter* i2c); |