[svn-commits] rmeyerriecks: branch linux/mspiceland/dahdi-qfalc31 r7707 - /linux/team/mspic...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Dec 17 18:17:05 CST 2009


Author: rmeyerriecks
Date: Thu Dec 17 18:17:03 2009
New Revision: 7707

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7707
Log:
wct4xxp: Updated the timing cable to use the new timing code. Removed
the old, redundant set timing function.


Modified:
    linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c

Modified: linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c?view=diff&rev=7707&r1=7706&r2=7707
==============================================================================
--- linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c Thu Dec 17 18:17:03 2009
@@ -396,7 +396,6 @@
 static int t4_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned long data);
 static void t4_tsi_assign(struct t4 *wc, int fromspan, int fromchan, int tospan, int tochan);
 static void t4_tsi_unassign(struct t4 *wc, int tospan, int tochan);
-static void __t4_set_timing_source(struct t4 *wc, int unit, int master, int slave);
 static void __t4_set_rclk_src(struct t4 *wc, int span);
 static void __t4_set_sclk_src(struct t4 *wc, int mode, int master, int slave);
 static void t4_check_alarms(struct t4 *wc, int span);
@@ -1807,57 +1806,6 @@
 	dev_info(&wc->dev->dev, "SCLK source (dmactrl) %#o\n", wc->dmactrl);
 }
 
-static void __t4_set_timing_source(struct t4 *wc, int unit, int master, int slave)
-{
-	unsigned int timing;
-	int x;
-	if (unit != wc->syncsrc) {
-		timing = 0x38;	/* Clock Mode: RCLK sourced by DCO-R1
-				   by default, Disable Clock-Switching */
-		if ((unit > -1) && (unit < 4)) {
-			/* We must have a valid RCLK, so dynamically select
-			   an RCLK based on available non-los spans */
-			timing |= (unit << 6);
-			__t4_framer_out(wc, 0, 0x44, timing | (x<<6));
-
-			/* Select RCLK for SCLK */
-			wc->dmactrl |= (1 << 29);
-		} else {
-			/* We must have a valid RCLK, so dynamically select
-			   an RCLK based on available non-los spans */
-			__t4_framer_out(wc, 0, 0x44, timing | (x<<6));
-
-			/* Select MCLK for SCLK */
-			wc->dmactrl &= ~(1 << 29);
-		}
-		if (slave)
-			wc->dmactrl |= (1 << 25);
-		else
-			wc->dmactrl &= ~(1 << 25);
-		if (master)
-			wc->dmactrl |= (1 << 24);
-		else
-			wc->dmactrl &= ~(1 << 24);
-		__t4_pci_out(wc, WC_DMACTRL, wc->dmactrl);
-		if (!master && !slave)
-			wc->syncsrc = unit;
-		if ((unit < 0) || (unit > 3))
-			unit = 0;
-		else
-			unit++;
-		if (!master && !slave) {
-			for (x=0;x<wc->numspans;x++)
-				wc->tspans[x]->span.syncsrc = unit;
-		}
-	} else {
-		if (debug & DEBUG_MAIN)
-			printk(KERN_DEBUG "TE%dXXP: Timing source already set to %d\n", wc->numspans, unit);
-	}
-#if	0
-	printk(KERN_DEBUG "wct4xxp: Timing source set to %d\n",unit);
-#endif
-}
-
 static inline void __t4_update_timing(struct t4 *wc)
 {
 	int i;
@@ -1870,10 +1818,11 @@
 			wc->tspans[i]->span.syncsrc = wc->syncsrc;
 		}
 		if (syncnum == wc->num) {
-			__t4_set_timing_source(wc, syncspan-1, 1, 0);
+			__t4_set_rclk_src(wc, syncspan-1);
+			__t4_set_sclk_src(wc, WC_RECOVER, 1, 0);
 			if (debug) printk(KERN_DEBUG "Card %d, using sync span %d, master\n", wc->num, syncspan);
 		} else {
-			__t4_set_timing_source(wc, syncspan-1, 0, 1);
+			__t4_set_sclk_src(wc, WC_RECOVER, 0, 1);
 			if (debug) printk(KERN_DEBUG "Card %d, using Timing Bus, NOT master\n", wc->num);	
 		}
 	}




More information about the svn-commits mailing list