aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@kernellabs.com>2012-02-07 00:39:36 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-02-14 14:21:53 -0500
commitddea427fb3e64d817d4432e5efd2abbfc4ddb02e (patch)
tree66ca26c1a802fdc8f6dc9fe8800980cd75164f16
parent00f92ed6c8b7b755e3c150bb115843f77f33d995 (diff)
[media] xc5000: remove static dependencies on xc5000 created by previous changesets
convert the firmware configuration attach-time parameter from a pointer to an integer so as to remove the static dependency created by the previous changesets. Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/common/tuners/xc5000.c24
-rw-r--r--drivers/media/common/tuners/xc5000.h15
2 files changed, 26 insertions, 13 deletions
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c
index 5af309cddd5e..2c71ee7dcb1e 100644
--- a/drivers/media/common/tuners/xc5000.c
+++ b/drivers/media/common/tuners/xc5000.c
@@ -203,16 +203,33 @@ static struct XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = {
203 {"FM Radio-INPUT1_MONO", 0x0278, 0x9002} 203 {"FM Radio-INPUT1_MONO", 0x0278, 0x9002}
204}; 204};
205 205
206struct xc5000_fw_cfg xc5000a_1_6_114 = { 206
207struct xc5000_fw_cfg {
208 char *name;
209 u16 size;
210};
211
212static struct xc5000_fw_cfg xc5000a_1_6_114 = {
207 .name = "dvb-fe-xc5000-1.6.114.fw", 213 .name = "dvb-fe-xc5000-1.6.114.fw",
208 .size = 12401, 214 .size = 12401,
209}; 215};
210 216
211struct xc5000_fw_cfg xc5000c_41_024_5_31875 = { 217static struct xc5000_fw_cfg xc5000c_41_024_5_31875 = {
212 .name = "dvb-fe-xc5000c-41.024.5-31875.fw", 218 .name = "dvb-fe-xc5000c-41.024.5-31875.fw",
213 .size = 16503, 219 .size = 16503,
214}; 220};
215 221
222static inline struct xc5000_fw_cfg *xc5000_assign_firmware(int fw)
223{
224 switch (fw) {
225 default:
226 case XC5000_FW_A_1_6_114:
227 return &xc5000a_1_6_114;
228 case XC5000_FW_C_41_024_5_31875:
229 return &xc5000c_41_024_5_31875;
230 }
231}
232
216static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe); 233static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe);
217static int xc5000_is_firmware_loaded(struct dvb_frontend *fe); 234static int xc5000_is_firmware_loaded(struct dvb_frontend *fe);
218static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val); 235static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val);
@@ -1152,7 +1169,8 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
1152 unless explicitly specified */ 1169 unless explicitly specified */
1153 if ((priv->fw == NULL) || (cfg->fw)) 1170 if ((priv->fw == NULL) || (cfg->fw))
1154 /* use default firmware if none specified */ 1171 /* use default firmware if none specified */
1155 priv->fw = (cfg->fw) ? cfg->fw : XC5000_DEFAULT_FIRMWARE; 1172 priv->fw = xc5000_assign_firmware((cfg->fw) ?
1173 cfg->fw : XC5000_DEFAULT_FIRMWARE);
1156 1174
1157 /* Check if firmware has been loaded. It is possible that another 1175 /* Check if firmware has been loaded. It is possible that another
1158 instance of the driver has loaded the firmware. 1176 instance of the driver has loaded the firmware.
diff --git a/drivers/media/common/tuners/xc5000.h b/drivers/media/common/tuners/xc5000.h
index 91036757e898..c003af5322a0 100644
--- a/drivers/media/common/tuners/xc5000.h
+++ b/drivers/media/common/tuners/xc5000.h
@@ -27,23 +27,18 @@
27struct dvb_frontend; 27struct dvb_frontend;
28struct i2c_adapter; 28struct i2c_adapter;
29 29
30struct xc5000_fw_cfg { 30#define XC5000_FW_A_1_6_114 1
31 char *name; 31#define XC5000_FW_C_41_024_5_31875 2
32 u16 size;
33};
34
35extern struct xc5000_fw_cfg xc5000a_1_6_114;
36extern struct xc5000_fw_cfg xc5000c_41_024_5_31875;
37 32
38#define XC5000_DEFAULT_FIRMWARE &xc5000a_1_6_114 33#define XC5000_DEFAULT_FIRMWARE XC5000_FW_A_1_6_114
39#define XC5000C_DEFAULT_FIRMWARE &xc5000c_41_024_5_31875 34#define XC5000C_DEFAULT_FIRMWARE XC5000_FW_C_41_024_5_31875
40 35
41struct xc5000_config { 36struct xc5000_config {
42 u8 i2c_address; 37 u8 i2c_address;
43 u32 if_khz; 38 u32 if_khz;
44 u8 radio_input; 39 u8 radio_input;
45 40
46 struct xc5000_fw_cfg *fw; 41 int fw;
47}; 42};
48 43
49/* xc5000 callback command */ 44/* xc5000 callback command */