aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-xc2028.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-22 13:46:24 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:55 -0400
commit5c913c0571034fc08d9a27f4aa3175142352acf6 (patch)
tree1fa084a40a0335cb129aeeef30a280da8bcd7048 /drivers/media/video/tuner-xc2028.c
parent5ec96b0c80eced33e7bf69a2d29c044d6dbe9bf5 (diff)
V4L/DVB (7439): tuner-xc2028: Adds an option to allow forcing to load an specific firmware name
There are a number of different firmware versions and variants, shipped together with boards. This patch adds an extra parameter to the tuner-xc2028 to allow specifying for an specific firmware name to be loaded. This helps to test for a firmware that better fits some board. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tuner-xc2028.c')
-rw-r--r--drivers/media/video/tuner-xc2028.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c
index 0b5ba67a4da5..098a9956a2bc 100644
--- a/drivers/media/video/tuner-xc2028.c
+++ b/drivers/media/video/tuner-xc2028.c
@@ -41,6 +41,11 @@ MODULE_PARM_DESC(audio_std,
41 "NICAM/A\n" 41 "NICAM/A\n"
42 "NICAM/B\n"); 42 "NICAM/B\n");
43 43
44static char firmware_name[FIRMWARE_NAME_MAX];
45module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0);
46MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the "
47 "default firmware name\n");
48
44static LIST_HEAD(xc2028_list); 49static LIST_HEAD(xc2028_list);
45static DEFINE_MUTEX(xc2028_list_mutex); 50static DEFINE_MUTEX(xc2028_list_mutex);
46 51
@@ -253,19 +258,24 @@ static int load_all_firmwares(struct dvb_frontend *fe)
253 int rc = 0; 258 int rc = 0;
254 int n, n_array; 259 int n, n_array;
255 char name[33]; 260 char name[33];
261 char *fname;
256 262
257 tuner_dbg("%s called\n", __FUNCTION__); 263 tuner_dbg("%s called\n", __FUNCTION__);
258 264
259 tuner_dbg("Reading firmware %s\n", priv->ctrl.fname); 265 if (!firmware_name[0])
260 rc = request_firmware(&fw, priv->ctrl.fname, 266 fname = priv->ctrl.fname;
261 &priv->i2c_props.adap->dev); 267 else
268 fname = firmware_name;
269
270 tuner_dbg("Reading firmware %s\n", fname);
271 rc = request_firmware(&fw, fname, &priv->i2c_props.adap->dev);
262 if (rc < 0) { 272 if (rc < 0) {
263 if (rc == -ENOENT) 273 if (rc == -ENOENT)
264 tuner_err("Error: firmware %s not found.\n", 274 tuner_err("Error: firmware %s not found.\n",
265 priv->ctrl.fname); 275 fname);
266 else 276 else
267 tuner_err("Error %d while requesting firmware %s \n", 277 tuner_err("Error %d while requesting firmware %s \n",
268 rc, priv->ctrl.fname); 278 rc, fname);
269 279
270 return rc; 280 return rc;
271 } 281 }
@@ -274,7 +284,7 @@ static int load_all_firmwares(struct dvb_frontend *fe)
274 284
275 if (fw->size < sizeof(name) - 1 + 2 + 2) { 285 if (fw->size < sizeof(name) - 1 + 2 + 2) {
276 tuner_err("Error: firmware file %s has invalid size!\n", 286 tuner_err("Error: firmware file %s has invalid size!\n",
277 priv->ctrl.fname); 287 fname);
278 goto corrupt; 288 goto corrupt;
279 } 289 }
280 290
@@ -289,7 +299,7 @@ static int load_all_firmwares(struct dvb_frontend *fe)
289 p += 2; 299 p += 2;
290 300
291 tuner_info("Loading %d firmware images from %s, type: %s, ver %d.%d\n", 301 tuner_info("Loading %d firmware images from %s, type: %s, ver %d.%d\n",
292 n_array, priv->ctrl.fname, name, 302 n_array, fname, name,
293 priv->firm_version >> 8, priv->firm_version & 0xff); 303 priv->firm_version >> 8, priv->firm_version & 0xff);
294 304
295 priv->firm = kzalloc(sizeof(*priv->firm) * n_array, GFP_KERNEL); 305 priv->firm = kzalloc(sizeof(*priv->firm) * n_array, GFP_KERNEL);