diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2009-12-19 04:38:05 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:53 -0500 |
commit | 0027ebb73eff5bf0709f016edcad2be0605a3e4f (patch) | |
tree | fd6aa56fab2734d3c07aa74a80f00e0e3a8897d8 /drivers | |
parent | 83f3c7157e087ace8fc67fd759bc3d7b3b64531e (diff) |
V4L/DVB: ngene: Always use firmware loader
Always use firmware loader.
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/ngene/ngene-core.c | 47 |
1 files changed, 16 insertions, 31 deletions
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c index c0ef11c77f59..1fb16353708b 100644 --- a/drivers/media/dvb/ngene/ngene-core.c +++ b/drivers/media/dvb/ngene/ngene-core.c | |||
@@ -48,17 +48,6 @@ | |||
48 | #include "ngene-ioctls.h" | 48 | #include "ngene-ioctls.h" |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | /* #define FW_INC 1 */ | ||
52 | #ifdef FW_INC | ||
53 | #include "ngene_fw_15.h" | ||
54 | #include "ngene_fw_16.h" | ||
55 | #include "ngene_fw_17.h" | ||
56 | |||
57 | static int load_firmware; | ||
58 | module_param(load_firmware, int, 0444); | ||
59 | MODULE_PARM_DESC(load_firmware, "Try to load firmware from file."); | ||
60 | #endif | ||
61 | |||
62 | static int copy_eeprom; | 51 | static int copy_eeprom; |
63 | module_param(copy_eeprom, int, 0444); | 52 | module_param(copy_eeprom, int, 0444); |
64 | MODULE_PARM_DESC(copy_eeprom, "Copy eeprom."); | 53 | MODULE_PARM_DESC(copy_eeprom, "Copy eeprom."); |
@@ -2238,43 +2227,39 @@ static int ngene_load_firm(struct ngene *dev) | |||
2238 | default: | 2227 | default: |
2239 | case 15: | 2228 | case 15: |
2240 | version = 15; | 2229 | version = 15; |
2230 | size = 23466; | ||
2241 | fw_name = "ngene_15.fw"; | 2231 | fw_name = "ngene_15.fw"; |
2242 | break; | 2232 | break; |
2243 | case 16: | 2233 | case 16: |
2234 | size = 23498; | ||
2244 | fw_name = "ngene_16.fw"; | 2235 | fw_name = "ngene_16.fw"; |
2245 | break; | 2236 | break; |
2246 | case 17: | 2237 | case 17: |
2238 | size = 24446; | ||
2247 | fw_name = "ngene_17.fw"; | 2239 | fw_name = "ngene_17.fw"; |
2248 | break; | 2240 | break; |
2249 | } | 2241 | } |
2250 | #ifdef FW_INC | ||
2251 | if (load_firmware && | ||
2252 | request_firmware(&fw, fw_name, &dev->pci_dev->dev) >= 0) { | ||
2253 | printk(KERN_INFO DEVICE_NAME | ||
2254 | ": Loading firmware file %s.\n", fw_name); | ||
2255 | size = fw->size; | ||
2256 | ngene_fw = fw->data; | ||
2257 | } else | ||
2258 | printk(KERN_INFO DEVICE_NAME | ||
2259 | ": Loading built-in firmware version %d.\n", version); | ||
2260 | err = ngene_command_load_firmware(dev, ngene_fw, size); | ||
2261 | 2242 | ||
2262 | if (fw) | ||
2263 | release_firmware(fw); | ||
2264 | #else | ||
2265 | if (request_firmware(&fw, fw_name, &dev->pci_dev->dev) < 0) { | 2243 | if (request_firmware(&fw, fw_name, &dev->pci_dev->dev) < 0) { |
2266 | printk(KERN_ERR DEVICE_NAME | 2244 | printk(KERN_ERR DEVICE_NAME |
2267 | ": Could not load firmware file %s. \n", fw_name); | 2245 | ": Could not load firmware file %s.\n", fw_name); |
2268 | printk(KERN_INFO DEVICE_NAME | 2246 | printk(KERN_INFO DEVICE_NAME |
2269 | ": Copy %s to your hotplug directory!\n", fw_name); | 2247 | ": Copy %s to your hotplug directory!\n", fw_name); |
2270 | return -1; | 2248 | return -1; |
2271 | } | 2249 | } |
2272 | printk(KERN_INFO DEVICE_NAME ": Loading firmware file %s.\n", fw_name); | 2250 | if (size != fw->size) { |
2273 | size = fw->size; | 2251 | printk(KERN_ERR DEVICE_NAME |
2274 | ngene_fw = (u8 *) fw->data; | 2252 | ": Firmware %s has invalid size!", fw_name); |
2275 | err = ngene_command_load_firmware(dev, ngene_fw, size); | 2253 | err = -1; |
2254 | } else { | ||
2255 | printk(KERN_INFO DEVICE_NAME | ||
2256 | ": Loading firmware file %s.\n", fw_name); | ||
2257 | ngene_fw = (u8 *) fw->data; | ||
2258 | err = ngene_command_load_firmware(dev, ngene_fw, size); | ||
2259 | } | ||
2260 | |||
2276 | release_firmware(fw); | 2261 | release_firmware(fw); |
2277 | #endif | 2262 | |
2278 | return err; | 2263 | return err; |
2279 | } | 2264 | } |
2280 | 2265 | ||