diff options
author | Shaun Ruffell <sruffell@digium.com> | 2011-03-19 22:48:17 -0500 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2011-04-15 14:19:03 -0500 |
commit | 37936432c02c1e9dd2f6c08a894ac2a4eaf9bcff (patch) | |
tree | 7d903c0ca3cc782a7679447614568ab0558420eb /drivers | |
parent | 0dc24f03ec291839316191d392b83c7c4705c9e5 (diff) |
wctdm24xxp: Use state machine to debounce fxs hook state.
Also do not assume that check_hook is called every millisecond.
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dahdi/wctdm24xxp/wctdm24xxp.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h index ec2d815..2ce703c 100644 --- a/drivers/dahdi/wctdm24xxp/wctdm24xxp.h +++ b/drivers/dahdi/wctdm24xxp/wctdm24xxp.h @@ -46,6 +46,7 @@ */ #define DEFAULT_RING_DEBOUNCE 1024 #define POLARITY_DEBOUNCE 64 /* Polarity debounce (in ms) */ +#define FXS_HOOK_DEBOUNCE 8 /* in ms */ #define OHT_TIMER 6000 /* How long after RING to retain OHT */ @@ -107,6 +108,14 @@ enum battery_state { BATTERY_LOST, }; +enum hook_state { + UNKNOWN_HOOK = 0, + ON_HOOK, + DEBOUNCING_ON_HOOK, + OFF_HOOK, + DEBOUNCING_OFF_HOOK, +}; + struct wctdm_cmd { struct list_head node; struct completion *complete; |