summaryrefslogtreecommitdiff
path: root/wct4xxp_base.c
diff options
context:
space:
mode:
authorfile <file@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-07-15 20:26:53 +0000
committerfile <file@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-07-15 20:26:53 +0000
commit7f1dacd15c4e52e661d92b830ad8f3b3c323498f (patch)
tree1fcdb23dac7681bc11ba8b5a615e2ebbb071a200 /wct4xxp_base.c
parent16323aa644eae99aa146991fbeb1d2945f59f55c (diff)
Add support for loading the VPM450M firmware using hotplug from userspace.
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@1233 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp_base.c')
-rw-r--r--wct4xxp_base.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/wct4xxp_base.c b/wct4xxp_base.c
index a060cb7..580b05c 100644
--- a/wct4xxp_base.c
+++ b/wct4xxp_base.c
@@ -40,6 +40,9 @@
#endif
#ifdef LINUX26
#include <linux/moduleparam.h>
+#ifdef HOTPLUG_FIRMWARE
+#include <linux/firmware.h>
+#endif
#endif
#include "wct4xxp.h"
#include "vpm450m.h"
@@ -2671,6 +2674,10 @@ static void t4_vpm450_init(struct t4 *wc)
unsigned int check1, check2;
int laws[4] = { 0, };
int x;
+#ifdef HOTPLUG_FIRMWARE
+ const struct firmware *firmware;
+#endif
+
if (!vpmsupport) {
printk("VPM450M: Support Disabled\n");
return;
@@ -2687,15 +2694,31 @@ static void t4_vpm450_init(struct t4 *wc)
printk("VPM450: Not Present\n");
return;
}
+#ifdef HOTPLUG_FIRMWARE
+ if (request_firmware(&firmware, "OCT6114-128D.ima", &wc->dev->dev) != 0 || !firmware) {
+ printk("VPM450M: Firmware not found to be loaded\n");
+ return;
+ }
+ printk("VPM450: Firmware of size %d found\n", firmware->size);
+#else
+ printk("VPM450: Using classic method of loading firmware\n");
+#endif
/* Setup alaw vs ulaw rules */
for (x=0;x<wc->numspans;x++) {
if (wc->tspans[x]->span.channels > 24)
laws[x] = 1;
}
+#ifdef HOTPLUG_FIRMWARE
+ if (!(wc->vpm450m = init_vpm450m(wc, laws, firmware))) {
+#else
if (!(wc->vpm450m = init_vpm450m(wc, laws))) {
+#endif
printk("VPM450: Failed to initialize\n");
return;
}
+#ifdef HOTPLUG_FIRMWARE
+ release_firmware(firmware);
+#endif
wc->vpm = T4_VPM_PRESENT;
printk("VPM450: Present and operational servicing %d span(s)\n", vpmspans);
}