Skip to content

Commit fa285bc

Browse files
istvan-vMauro Carvalho Chehab
authored andcommitted
[media] xc4000: added firmware_name parameter
The firmware_name module parameter makes it possible to set the firmware file name. It defaults to "xc4000.fw" if not specified. Signed-off-by: Istvan Varga <istvan_v@mailbox.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
1 parent 1368ceb commit fa285bc

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

‎drivers/media/common/tuners/xc4000.c‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,20 @@ MODULE_PARM_DESC(no_poweroff, "0 (default) powers device off when not used.\n"
4747
"\t\t1 keep device energized and with tuner ready all the times.\n"
4848
"\t\tFaster, but consumes more power and keeps the device hotter");
4949

50+
#define XC4000_DEFAULT_FIRMWARE "xc4000.fw"
51+
52+
static char firmware_name[30];
53+
module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0);
54+
MODULE_PARM_DESC(firmware_name, "\n\t\tFirmware file name. Allows overriding "
55+
"the default firmware\n"
56+
"\t\tname.");
57+
5058
static DEFINE_MUTEX(xc4000_list_mutex);
5159
static LIST_HEAD(hybrid_tuner_instance_list);
5260

5361
#define dprintk(level, fmt, arg...) if (debug >= level) \
5462
printk(KERN_INFO "%s: " fmt, "xc4000", ## arg)
5563

56-
/* Note that the last version digit is my internal build number (so I can
57-
rev the firmware even if the core Xceive firmware was unchanged) */
58-
#define XC4000_DEFAULT_FIRMWARE "dvb-fe-xc4000-1.4.1.fw"
59-
6064
/* struct for storing firmware table */
6165
struct firmware_description {
6266
unsigned int type;
@@ -715,7 +719,10 @@ static int xc4000_fwupload(struct dvb_frontend *fe)
715719
char name[33];
716720
const char *fname;
717721

718-
fname = XC4000_DEFAULT_FIRMWARE;
722+
if (firmware_name[0] != '\0')
723+
fname = firmware_name;
724+
else
725+
fname = XC4000_DEFAULT_FIRMWARE;
719726

720727
printk("Reading firmware %s\n", fname);
721728
rc = request_firmware(&fw, fname, priv->i2c_props.adap->dev.parent);

0 commit comments

Comments
 (0)