[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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
00f92ed6c8
commit
ddea427fb3
@@ -203,16 +203,33 @@ static struct XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = {
|
|||||||
{"FM Radio-INPUT1_MONO", 0x0278, 0x9002}
|
{"FM Radio-INPUT1_MONO", 0x0278, 0x9002}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xc5000_fw_cfg xc5000a_1_6_114 = {
|
|
||||||
|
struct xc5000_fw_cfg {
|
||||||
|
char *name;
|
||||||
|
u16 size;
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct xc5000_fw_cfg xc5000a_1_6_114 = {
|
||||||
.name = "dvb-fe-xc5000-1.6.114.fw",
|
.name = "dvb-fe-xc5000-1.6.114.fw",
|
||||||
.size = 12401,
|
.size = 12401,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xc5000_fw_cfg xc5000c_41_024_5_31875 = {
|
static struct xc5000_fw_cfg xc5000c_41_024_5_31875 = {
|
||||||
.name = "dvb-fe-xc5000c-41.024.5-31875.fw",
|
.name = "dvb-fe-xc5000c-41.024.5-31875.fw",
|
||||||
.size = 16503,
|
.size = 16503,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline struct xc5000_fw_cfg *xc5000_assign_firmware(int fw)
|
||||||
|
{
|
||||||
|
switch (fw) {
|
||||||
|
default:
|
||||||
|
case XC5000_FW_A_1_6_114:
|
||||||
|
return &xc5000a_1_6_114;
|
||||||
|
case XC5000_FW_C_41_024_5_31875:
|
||||||
|
return &xc5000c_41_024_5_31875;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe);
|
static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe);
|
||||||
static int xc5000_is_firmware_loaded(struct dvb_frontend *fe);
|
static int xc5000_is_firmware_loaded(struct dvb_frontend *fe);
|
||||||
static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val);
|
static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val);
|
||||||
@@ -1152,7 +1169,8 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
|
|||||||
unless explicitly specified */
|
unless explicitly specified */
|
||||||
if ((priv->fw == NULL) || (cfg->fw))
|
if ((priv->fw == NULL) || (cfg->fw))
|
||||||
/* use default firmware if none specified */
|
/* use default firmware if none specified */
|
||||||
priv->fw = (cfg->fw) ? cfg->fw : XC5000_DEFAULT_FIRMWARE;
|
priv->fw = xc5000_assign_firmware((cfg->fw) ?
|
||||||
|
cfg->fw : XC5000_DEFAULT_FIRMWARE);
|
||||||
|
|
||||||
/* Check if firmware has been loaded. It is possible that another
|
/* Check if firmware has been loaded. It is possible that another
|
||||||
instance of the driver has loaded the firmware.
|
instance of the driver has loaded the firmware.
|
||||||
|
@@ -27,23 +27,18 @@
|
|||||||
struct dvb_frontend;
|
struct dvb_frontend;
|
||||||
struct i2c_adapter;
|
struct i2c_adapter;
|
||||||
|
|
||||||
struct xc5000_fw_cfg {
|
#define XC5000_FW_A_1_6_114 1
|
||||||
char *name;
|
#define XC5000_FW_C_41_024_5_31875 2
|
||||||
u16 size;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern struct xc5000_fw_cfg xc5000a_1_6_114;
|
#define XC5000_DEFAULT_FIRMWARE XC5000_FW_A_1_6_114
|
||||||
extern struct xc5000_fw_cfg xc5000c_41_024_5_31875;
|
#define XC5000C_DEFAULT_FIRMWARE XC5000_FW_C_41_024_5_31875
|
||||||
|
|
||||||
#define XC5000_DEFAULT_FIRMWARE &xc5000a_1_6_114
|
|
||||||
#define XC5000C_DEFAULT_FIRMWARE &xc5000c_41_024_5_31875
|
|
||||||
|
|
||||||
struct xc5000_config {
|
struct xc5000_config {
|
||||||
u8 i2c_address;
|
u8 i2c_address;
|
||||||
u32 if_khz;
|
u32 if_khz;
|
||||||
u8 radio_input;
|
u8 radio_input;
|
||||||
|
|
||||||
struct xc5000_fw_cfg *fw;
|
int fw;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* xc5000 callback command */
|
/* xc5000 callback command */
|
||||||
|
Reference in New Issue
Block a user