From 1aa4b05da2bf4afc4ced71e897dad63c87b03c8d Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Wed, 29 Jun 2011 19:53:52 +0000 Subject: wctdm24xxp: Add 'fastpick' module parameter. When true / 1 the FXO port will use a shorter off-hook calibration delay. This is sometimes necessary in order to properly decode Type-II Caller ID information which is sent shortly after an FXO port goes off hook. Defaults to 0 unless opermode is "JAPAN" then it will default to 1. This functionality was ported from the wctdm.c driver. DAHDI-854. Signed-off-by: Shaun Ruffell git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10006 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wctdm24xxp/base.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'drivers/dahdi/wctdm24xxp') diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 699a294..5570602 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -233,6 +233,7 @@ static char *opermode = "FCC"; static int fxshonormode = 0; static int alawoverride = 0; static char *companding = "auto"; +static int fastpickup = -1; /* -1 auto, 0 no, 1 yes */ static int fxotxgain = 0; static int fxorxgain = 0; static int fxstxgain = 0; @@ -2869,7 +2870,8 @@ wctdm_init_voicedaa(struct wctdm *wc, struct wctdm_module *mod, wctdm_setreg(wc, mod, 30, reg30); /* Misc. DAA parameters */ - reg31 = 0xa3; + reg32 = (fastpickup) ? 0xb3 : 0xa3; + reg31 |= (fxo_modes[_opermode].ohs2 << 3); wctdm_setreg(wc, mod, 31, reg31); @@ -5671,6 +5673,13 @@ static int __init wctdm_init(void) fxshonormode = 1; } + if (-1 == fastpickup) { + if (!strcmp(opermode, "JAPAN")) + fastpickup = 1; + else + fastpickup = 0; + } + /* for the voicedaa_check_hook defaults, if the user has not overridden them by specifying them as module parameters, then get the values from the selected operating mode @@ -5704,6 +5713,12 @@ static void __exit wctdm_cleanup(void) module_param(debug, int, 0600); +module_param(fastpickup, int, 0400); +MODULE_PARM_DESC(fastpickup, + "Set to 1 to shorten the calibration delay when taking " \ + "an FXO port off hook. This can be required for Type-II " \ + "CID. If -1 the calibration delay will depend on the " \ + "current opermode.\n"); module_param(fxovoltage, int, 0600); module_param(loopcurrent, int, 0600); module_param(reversepolarity, int, 0600); -- cgit v1.2.3