summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/ngene
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/ngene')
-rw-r--r--linux/drivers/media/video/ngene/ngene-core.c45
1 files changed, 29 insertions, 16 deletions
diff --git a/linux/drivers/media/video/ngene/ngene-core.c b/linux/drivers/media/video/ngene/ngene-core.c
index 7c9a9af0a..3b2a186ca 100644
--- a/linux/drivers/media/video/ngene/ngene-core.c
+++ b/linux/drivers/media/video/ngene/ngene-core.c
@@ -74,9 +74,11 @@ static int copy_eeprom = 0;
module_param(copy_eeprom, int, 0444);
MODULE_PARM_DESC(copy_eeprom, "Copy eeprom.");
+/*
static int ngene_fw_debug = 0;
module_param(ngene_fw_debug, int, 0444);
MODULE_PARM_DESC(ngene_fw_debug, "Debug firmware.");
+*/
static int debug = 0;
module_param(debug, int, 0444);
@@ -483,7 +485,8 @@ static int ngene_command_load_firmware(struct ngene *dev,
cleft-FIRSTCHUNK);
cleft=FIRSTCHUNK;
}
- ngene_fw[FW_DEBUG_DEFAULT-PROGRAM_SRAM]=ngene_fw_debug;
+ /* crashes when loading firmware from file */
+ /* ngene_fw[FW_DEBUG_DEFAULT-PROGRAM_SRAM]=ngene_fw_debug; */
ngcpyto(DATA_FIFO_AREA, ngene_fw, cleft);
memset(&com, 0, sizeof(struct ngene_command));
@@ -2915,10 +2918,10 @@ static int ngene_load_firm(struct ngene *dev)
version=dev->card_info->fw_version;
+#ifdef FW_INC
switch (version) {
default:
case 15:
- version=15;
ngene_fw=FW15;
size=sizeof(FW15);
fw_name="ngene_15.fw";
@@ -2934,33 +2937,43 @@ static int ngene_load_firm(struct ngene *dev)
fw_name="ngene_17.fw";
break;
}
-#ifdef FW_INC
+
if (load_firmware &&
request_firmware(&fw, fw_name, &dev->pci_dev->dev)>=0) {
printk(DEVICE_NAME ": Loading firmware file %s.\n", fw_name);
size=fw->size;
ngene_fw=(u8 *)fw->data;
- } else
- printk(DEVICE_NAME ": Loading built-in firmware version %d.\n",
- version);
- err=ngene_command_load_firmware(dev, ngene_fw, size);
-
- if (fw)
- release_firmware(fw);
+ } else {
+ printk(DEVICE_NAME ": Loading built-in firmware version %d.\n", version);
+ }
#else
+ switch (dev->card_info->fw_version) {
+ default:
+ case 15:
+ fw_name = "ngene_15.fw";
+ break;
+ case 16:
+ fw_name = "ngene_16.fw";
+ break;
+ case 17:
+ fw_name = "ngene_17.fw";
+ break;
+ }
if (request_firmware(&fw, fw_name, &dev->pci_dev->dev)<0) {
- printk(DEVICE_NAME ": Could not load firmware file %s. \n",
- fw_name);
- printk(DEVICE_NAME
- ": Copy %s to your hotplug directory!\n", fw_name);
+ printk(DEVICE_NAME ": Could not load firmware file %s. \n", fw_name);
+ printk(DEVICE_NAME ": Copy %s to your hotplug directory!\n", fw_name);
return -1;
}
printk(DEVICE_NAME ": Loading firmware file %s.\n", fw_name);
size=fw->size;
ngene_fw=(u8 *)fw->data;
- err=ngene_command_load_firmware(dev, ngene_fw, size);
- release_firmware(fw);
#endif
+
+ err=ngene_command_load_firmware(dev, ngene_fw, size);
+
+ if (fw)
+ release_firmware(fw);
+
return err;
}