From 45e5b324d06dc2c3fd361b29255e8a188f58deef Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Mon, 4 Jul 2011 14:05:43 +0000 Subject: [PATCH] xpp: xpd_fxs: ring_trapez parameter This adds module parameter 'ring_trapez'. When set, the wave form of the ring tone is set to be a trapezoid, rather than sine. Thus making the ring stronger. This is a boolean parameter of the module xpd_fxs. Takes effect at the beginning of the next ring. Signed-off-by: Tzafrir Cohen git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10022 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/xpp/card_fxs.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c index 01d4ab7..1865991 100644 --- a/drivers/dahdi/xpp/card_fxs.c +++ b/drivers/dahdi/xpp/card_fxs.c @@ -41,6 +41,7 @@ static DEF_PARM(uint, poll_digital_inputs, 1000, 0644, "Poll Digital Inputs"); #endif static DEF_PARM_BOOL(vmwi_ioctl, 1, 0644, "Asterisk support VMWI notification via ioctl"); +static DEF_PARM_BOOL(ring_trapez, 0, 0664, "Use trapezoid ring type"); /* Signaling is opposite (fxo signalling for fxs card) */ #if 1 @@ -576,6 +577,28 @@ static int set_vm_led_mode(xbus_t *xbus, xpd_t *xpd, int pos, ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, SLIC_WRITE, 0x32, 0xF0); ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, SLIC_WRITE, 0x33, 0x05); ret += SLIC_INDIRECT_REQUEST(xbus, xpd, pos, SLIC_WRITE, 0x1D, 0x00, 0x46); + } else if (ring_trapez) { + LINE_DBG(SIGNAL, xpd, pos, "RINGER: Trapez ring\n"); + ret += SLIC_INDIRECT_REQUEST(xbus, xpd, pos, + SLIC_WRITE, 0x16, 0xC8, 0x00); + ret += SLIC_INDIRECT_REQUEST(xbus, xpd, pos, + SLIC_WRITE, 0x15, 0xAB, 0x5E); + ret += SLIC_INDIRECT_REQUEST(xbus, xpd, pos, + SLIC_WRITE, 0x14, 0x8C, 0x01); + ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, + SLIC_WRITE, 0x22, 0x01); + ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, + SLIC_WRITE, 0x4A, 0x34); + ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, + SLIC_WRITE, 0x30, 0x00); + ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, + SLIC_WRITE, 0x31, 0x00); + ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, + SLIC_WRITE, 0x32, 0x00); + ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, + SLIC_WRITE, 0x33, 0x00); + ret += SLIC_INDIRECT_REQUEST(xbus, xpd, pos, + SLIC_WRITE, 0x1D, 0x00, 0x36); } else { /* A write to register 0x40 will now turn on/off the ringer */ LINE_DBG(SIGNAL, xpd, pos, "RINGER\n"); @@ -589,6 +612,8 @@ static int set_vm_led_mode(xbus_t *xbus, xpd_t *xpd, int pos, ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, SLIC_WRITE, 0x31, 0x00); ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, SLIC_WRITE, 0x32, 0x00); ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, SLIC_WRITE, 0x33, 0x00); + ret += SLIC_DIRECT_REQUEST(xbus, xpd, pos, SLIC_WRITE, + 0x4A, 0x34);/* High Vbat~ -82V[Dc] */ ret += SLIC_INDIRECT_REQUEST(xbus, xpd, pos, SLIC_WRITE, 0x1D, 0x00, 0x36); } return (ret ? -EPROTO : 0);