2677
2677
unsigned int check1, check2;
2678
2678
int laws[4] = { 0, };
2680
#ifdef HOTPLUG_FIRMWARE
2681
const struct firmware *firmware;
2684
2682
if (!vpmsupport) {
2685
printk("VPM450M: Support Disabled\n");
2683
printk("VPM450: Support Disabled\n");
2688
2687
/* Turn on GPIO/DATA mux if supported */
2689
2688
t4_gpio_setdir(wc, (1 << 24), (1 << 24));
2690
2689
__t4_raw_oct_out(wc, 0x000a, 0x5678);
2691
2690
__t4_raw_oct_out(wc, 0x0004, 0x1234);
2692
2691
check1 = __t4_raw_oct_in(wc, 0x0004);
2693
2692
check2 = __t4_raw_oct_in(wc, 0x000a);
2695
2694
printk("OCT Result: %04x/%04x\n", __t4_raw_oct_in(wc, 0x0004), __t4_raw_oct_in(wc, 0x000a));
2696
2695
if (__t4_raw_oct_in(wc, 0x0004) != 0x1234) {
2697
2696
printk("VPM450: Not Present\n");
2700
#ifdef HOTPLUG_FIRMWARE
2701
if (request_firmware(&firmware, "OCT6114-128D.ima", &wc->dev->dev) != 0 || !firmware) {
2702
printk("VPM450M: Firmware not found to be loaded\n");
2705
printk("VPM450: Firmware of size %zd found\n", firmware->size);
2707
printk("VPM450: Using classic method of loading firmware\n");
2709
2700
/* Setup alaw vs ulaw rules */
2710
for (x=0;x<wc->numspans;x++) {
2701
for (x = 0;x < wc->numspans; x++) {
2711
2702
if (wc->tspans[x]->span.channels > 24)
2714
#ifdef HOTPLUG_FIRMWARE
2715
if (!(wc->vpm450m = init_vpm450m(wc, laws, firmware))) {
2706
#ifndef HOTPLUG_FIRMWARE
2707
if ((wc->vpm450m = init_vpm450m(wc, laws, wc->numspans)))
2717
if (!(wc->vpm450m = init_vpm450m(wc, laws))) {
2711
const struct firmware *firmware;
2713
/* if this is a 4-span card, just try using the 128-channel firmware;
2714
otherwise, try both, because a 2-span card could potentially have
2715
a 128-channel Octasic module
2717
if (wc->numspans < 3) {
2718
if ((request_firmware(&firmware, oct064_firmware, &wc->dev->dev) != 0) ||
2720
printk("VPM450: firmware %s not available from userspace\n", oct064_firmware);
2723
if ((wc->vpm450m = init_vpm450m(wc, laws, wc->numspans, firmware)))
2726
release_firmware(firmware);
2731
if ((request_firmware(&firmware, oct128_firmware, &wc->dev->dev) != 0) ||
2733
printk("VPM450: firmware %s not available from userspace\n", oct128_firmware);
2736
if ((wc->vpm450m = init_vpm450m(wc, laws, wc->numspans, firmware)))
2739
release_firmware(firmware);
2719
2746
printk("VPM450: Failed to initialize\n");
2722
#ifdef HOTPLUG_FIRMWARE
2723
release_firmware(firmware);
2725
2749
if (vpmdtmfsupport == -1) {
2726
2750
printk("VPM450: hardware DTMF disabled.\n");
2727
2751
vpmdtmfsupport = 0;