diff options
-rwxr-xr-x | wcfxo.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -130,6 +130,8 @@ static void wcfxo_release(struct wcfxo *wc); static int debug = 0; +static int monitor = 0; + static inline void wcfxo_transmitprep(struct wcfxo *wc, unsigned char ints) { volatile int *writechunk; @@ -148,10 +150,10 @@ static inline void wcfxo_transmitprep(struct wcfxo *wc, unsigned char ints) /* Send a sample, as a 32-bit word, and be sure to indicate that a command follows */ if (wc->flags & FLAG_INVERTSER) writechunk[x << 1] = - ~((unsigned short)(zt_mulaw[wc->chan.writechunk[x]])| 0x1) << 16; + ~((unsigned short)(ZT_MULAW(wc->chan.writechunk[x]))| 0x1) << 16; else writechunk[x << 1] = - ((unsigned short)(zt_mulaw[wc->chan.writechunk[x]])| 0x1) << 16; + ((unsigned short)(ZT_MULAW(wc->chan.writechunk[x]))| 0x1) << 16; /* We always have a command to follow our signal */ if (!wc->regs[x].flags) { @@ -225,7 +227,7 @@ static inline void wcfxo_receiveprep(struct wcfxo *wc, unsigned char ints) /* Receive into the proper register */ wc->readregs[realreg] = realval; } - wc->chan.readchunk[x] = zt_lin2mu[((short)(readchunk[(x << 1) + (1 - wc->alt)] >> 16)) + 32768]; + wc->chan.readchunk[x] = ZT_LIN2MU(((short)(readchunk[(x << 1) + (1 - wc->alt)] >> 16))); } for (x=0;x<ZT_CHUNKSIZE;x++) { /* Rotate through registers */ @@ -422,6 +424,7 @@ static int wcfxo_initialize(struct wcfxo *wc) wc->span.open = wcfxo_open; wc->span.close = wcfxo_close; wc->span.flags = ZT_FLAG_RBS; + wc->span.deflaw = ZT_LAW_MULAW; init_waitqueue_head(&wc->span.maintq); wc->span.pvt = wc; @@ -541,9 +544,13 @@ static int wcfxo_init_daa(struct wcfxo *wc) wcfxo_setreg(wc, 0xa, 0x0); /* Enable off hook pin */ wcfxo_setreg(wc, 0x5, 0x0a); - /* Enable ISOcap and external speaker and charge pump if present */ - wcfxo_setreg(wc, 0x6, 0x80); - + if (monitor) { + /* Enable ISOcap and external speaker and charge pump if present */ + wcfxo_setreg(wc, 0x6, 0x80); + } else { + /* Enable ISOcap and charge pump if present (leave speaker disabled) */ + wcfxo_setreg(wc, 0x6, 0xe0); + } /* Wait a couple of jiffies for our writes to finish */ set_current_state(TASK_INTERRUPTIBLE); @@ -735,6 +742,7 @@ static void __exit wcfxo_cleanup(void) } MODULE_PARM(debug, "i"); +MODULE_PARM(monitor, "i"); MODULE_DESCRIPTION("Wildcard X100P Zaptel Driver"); MODULE_AUTHOR("Mark Spencer <markster@linux-support.net>"); |