From 3d8629e864ed3a3a5b5eb526a6b2d2ee676ec45d Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Tue, 30 Aug 2011 16:38:01 +0000 Subject: [PATCH] wctdm24xxp: Reset the polarity debounce setting when battery is lost. Wait until we have de-bounced the presence of battery before moving on the check for changes in polarity. This removes the sometimes random polarity messages generated on an FXO port when the far side drops battery from a supervisor disconnect. Signed-off-by: Shaun Ruffell Acked-by: Russ Meyerriecks git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10161 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wctdm24xxp/base.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 69cd139..50cc618 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -1965,6 +1965,9 @@ wctdm_voicedaa_check_hook(struct wctdm *wc, struct wctdm_module *const mod) battery present or unknown, debounce timer (going to battery lost) */ + fxo->lastpol = fxo->polarity; + fxo->polaritydebounce = 0; + if (fxo->battery == BATTERY_LOST) { if (fxo->battdebounce) { /* we were going to BATTERY_PRESENT, but battery was lost again,