wcfxo: Reset the DAA on module initialization.

The X100p and clones will sometimes work and sometimes not depending on wether
the DAA powers up in running state- this seems to be related to the power
supply. This problem is caused by the driver not reseting the DAA and may be
the source of a great many intermittent problems with this card.

(closes issue #14232)
Reported by: tallen8840
Patch by: tallen8840
Tested by: explidous, Flavio

Source: http://svn.digium.com/svn/dahdi/linux/trunk@7008

To be included in dahdi-linux 2.3 .

--- a/drivers/dahdi/wcfxo.c
+++ b/drivers/dahdi/wcfxo.c
@@ -673,6 +673,16 @@ static int wcfxo_hardware_init(struct wc
 	/* Hardware stuff */
 	/* Reset PCI Interface chip and registers */
 	outb(0x0e, wc->ioaddr + WC_CNTL);
+
+	/* Set all to outputs except AUX 4, which is an input */
+	outb(0xef, wc->ioaddr + WC_AUXC);
+
+	/* Reset the DAA (DAA uses AUX5 for reset) */
+	outb(0x00, wc->ioaddr + WC_AUXD);
+	set_current_state(TASK_INTERRUPTIBLE);
+	schedule_timeout(1 + HZ / 800);
+
+	/* Set hook state to on hook & un-reset the DAA */
 	if (wc->flags & FLAG_RESET_ON_AUX5) {
 		/* Set hook state to on hook for when we switch.
 		   Make sure reset is high */
@@ -681,8 +691,6 @@ static int wcfxo_hardware_init(struct wc
 		/* Set hook state to on hook for when we switch */
 		outb(0x24, wc->ioaddr + WC_AUXD);
 	}
-	/* Set all to outputs except AUX 4, which is an input */
-	outb(0xef, wc->ioaddr + WC_AUXC);
 
 	/* Back to normal, with automatic DMA wrap around */
 	outb(0x01, wc->ioaddr + WC_CNTL);
