diff options
author | Shaun Ruffell <sruffell@digium.com> | 2011-08-30 16:38:32 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2011-08-30 16:38:32 +0000 |
commit | 6ec60e48a7c141b8b4c8288e7654ee982dff9ad1 (patch) | |
tree | 345cc4eb3c72141ebbc6a65f2b781e5b27bd1cdc /drivers/dahdi/wctdm24xxp/wctdm24xxp.h | |
parent | af3b955e5b8471923ac51837cb43a6a3c803423e (diff) |
wctdm24xxp: Use time interval for debouncing FXO ring detect.
Do not assume the ring detection function is called for every frame.
Also change the debounce logic to a state machine to clarify what state
a port is in and unify the technique for debouncing the various signals.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10168 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wctdm24xxp/wctdm24xxp.h')
-rw-r--r-- | drivers/dahdi/wctdm24xxp/wctdm24xxp.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h index e91eeee..81ec1c2 100644 --- a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h +++ b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h @@ -109,6 +109,15 @@ enum battery_state { BATTERY_LOST, }; +enum ring_detector_state { + RINGOFF = 0, + DEBOUNCING_RINGING_POSITIVE, + DEBOUNCING_RINGING_NEGATIVE, + DEBOUNCING_RINGING_OFF, + RINGING, + DEBOUNCING_RINGOFF, +}; + struct wctdm_cmd { struct list_head node; struct completion *complete; @@ -144,10 +153,11 @@ struct wctdm_chan { }; struct fxo { - int wasringing; - int lastrdtx; - int lastrdtx_count; - int ringdebounce; + enum ring_detector_state ring_state:4; + enum battery_state battery_state:4; + u8 ring_polarity_change_count:4; + u8 hook_ring_shadow; + s8 line_voltage_status; int offhook; int battdebounce; int battalarm; @@ -160,8 +170,7 @@ struct fxo { unsigned int neonmwi_debounce; unsigned int neonmwi_offcounter; unsigned long display_fxovoltage; - u8 hook_ring_shadow; - s8 line_voltage_status; + unsigned long ringdebounce_timer; }; struct fxs { @@ -219,7 +228,7 @@ enum module_type { }; struct wctdm_module { - union { + union modtypes { struct fxo fxo; struct fxs fxs; struct qrv qrv; |