From 37936432c02c1e9dd2f6c08a894ac2a4eaf9bcff Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Sat, 19 Mar 2011 22:48:17 -0500 Subject: 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 --- drivers/dahdi/wctdm24xxp/wctdm24xxp.h | 9 +++++++++ 1 file changed, 9 insertions(+) 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; -- cgit v1.2.3