--- zaptel-1.4.9.2/kernel/wcte11xp.c.orig 2008-02-04 18:00:48.000000000 -0500 +++ zaptel-1.4.9.2/kernel/wcte11xp.c 2008-08-22 12:11:08.000000000 -0500 @@ -652,7 +652,7 @@ { printk("TE110P: Setting up global serial parameters for %s %s\n", wc->spantype == TYPE_E1 ? (unchannelized ? "Unchannelized E1" : "E1") : "T1", - wc->spanflags & FLAG_FALC12 ? "FALC V1.2" : "FALC V2.2"); + wc->spanflags & FLAG_FALC12 ? "FALC V1.2" : "FALC V2.1 or V2.2"); t1_framer_out(wc, 0x85, 0xe0); /* GPC1: Multiplex mode enabled, FSC is output, active low, RCLK from channel 0 */ t1_framer_out(wc, 0x08, 0x05); /* IPC: Interrupt push/pull active low */ if (wc->spanflags & FLAG_FALC12) { @@ -664,14 +664,43 @@ t1_framer_out(wc, 0x97, 0x10); } else { /* Global clocks (8.192 Mhz CLK) */ - t1_framer_out(wc, 0x92, 0x00); - t1_framer_out(wc, 0x93, 0x18); - t1_framer_out(wc, 0x94, 0xfb); - t1_framer_out(wc, 0x95, 0x0b); - t1_framer_out(wc, 0x96, 0x00); - t1_framer_out(wc, 0x97, 0x0b); - t1_framer_out(wc, 0x98, 0xdb); - t1_framer_out(wc, 0x99, 0xdf); + unsigned char wafer; + wafer = (t1_framer_in(wc, 0xec)>>6)&0x03; /* read wafer register to see it is a 2.1 or 2.2 version; */ + if ( wafer == 0x00) /* 2.1 */ + { + printk("Infineon PEF2256 V2.1 found\n"); + if (wc->spantype == TYPE_E1) { + t1_framer_out(wc, 0x92, 0x00); + t1_framer_out(wc, 0x93, 0x00); + t1_framer_out(wc, 0x94, 0x00); + t1_framer_out(wc, 0x95, 0x00); + t1_framer_out(wc, 0x96, 0x00); + t1_framer_out(wc, 0x97, 0x0F); + t1_framer_out(wc, 0x98, 0x80); + t1_framer_out(wc, 0x99, 0x00); + } else { + t1_framer_out(wc, 0x92, 0x00); + t1_framer_out(wc, 0x93, 0x10); + t1_framer_out(wc, 0x94, 0xfb); + t1_framer_out(wc, 0x95, 0x03); + t1_framer_out(wc, 0x96, 0x00); + t1_framer_out(wc, 0x97, 0x0b); + t1_framer_out(wc, 0x98, 0x8c); + t1_framer_out(wc, 0x99, 0x80); + } + } + else /* 2.2 version, wafer should be 0x01 */ + { + printk("Infineon PEF2256 V2.2 found\n"); + t1_framer_out(wc, 0x92, 0x00); + t1_framer_out(wc, 0x93, 0x18); + t1_framer_out(wc, 0x94, 0xfb); + t1_framer_out(wc, 0x95, 0x0b); + t1_framer_out(wc, 0x96, 0x00); + t1_framer_out(wc, 0x97, 0x0b); + t1_framer_out(wc, 0x98, 0xdb); + t1_framer_out(wc, 0x99, 0xdf); + } } /* Configure interrupts */ t1_framer_out(wc, 0x46, 0x40); /* GCR: Interrupt on Activation/Deactivation of AIX, LOS */ @@ -687,6 +716,11 @@ t1_framer_out(wc, 0x24, 0x07); /* RC0: Just shy of 255 */ if (wc->spanflags & FLAG_FALC12) t1_framer_out(wc, 0x25, 0x04); /* RC1: The rest of RC0 */ + else if ( control_get_reg(wc, WC_VERSION) == 0xa0) /* openvox D110PG V1 */ + { + printk("OpenVox D110PG V1 found.\n"); + t1_framer_out(wc, 0x25, 0x04); /* RC1: The rest of RC0 */ + } else t1_framer_out(wc, 0x25, 0x05); /* RC1: The rest of RC0 */