summaryrefslogtreecommitdiff
path: root/wctdm24xxp/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'wctdm24xxp/base.c')
-rw-r--r--wctdm24xxp/base.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/wctdm24xxp/base.c b/wctdm24xxp/base.c
index e7537f1..5a22ac5 100644
--- a/wctdm24xxp/base.c
+++ b/wctdm24xxp/base.c
@@ -42,7 +42,9 @@ Tx Gain - W/Pre-Emphasis: -23.99 to 0.00 db
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
+#ifdef VPM150M_SUPPORT
#include <linux/firmware.h>
+#endif
#include <linux/workqueue.h>
#include <linux/delay.h>
#include <asm/semaphore.h>
@@ -460,6 +462,7 @@ static inline void cmd_dequeue_vpm150m(struct wctdm *wc, volatile unsigned char
}
}
+#ifdef VPM150M_SUPPORT
/* Add our leds in */
for (x = 24; x < 28; x++)
writechunk[CMD_BYTE(x, 0, 0)] |= leds;
@@ -467,6 +470,7 @@ static inline void cmd_dequeue_vpm150m(struct wctdm *wc, volatile unsigned char
/* Now let's figure out if we need to check for DTMF */
if (test_bit(VPM150M_ACTIVE, &vpm150m->control) && !whichframe && !(wc->intcount % 100))
queue_work(vpm150m->wq, &vpm150m->work);
+#endif
spin_unlock_irqrestore(&wc->reglock, flags);
}
@@ -1501,6 +1505,7 @@ static int wctdm_echocan(struct zt_chan *chan, int eclen)
wctdm_vpm_out(wc,unit,channel,0x01);
return 0;
+#ifdef VPM150M_SUPPORT
} else if (wc->vpm150m) {
struct vpm150m *vpm150m = wc->vpm150m;
@@ -1514,6 +1519,7 @@ static int wctdm_echocan(struct zt_chan *chan, int eclen)
queue_work(vpm150m->wq, &vpm150m->work);
}
return 0;
+#endif
} else
return -ENODEV;
}
@@ -3150,6 +3156,9 @@ static void wctdm_disable_interrupts(struct wctdm *wc)
}
#ifdef VPM_SUPPORT
+
+#ifdef VPM150M_SUPPORT
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
static void vpm150m_bh(void *data)
{
@@ -3494,16 +3503,20 @@ static int vpm150m_config_hw(struct wctdm *wc)
return 0;
}
+#endif /* VPM150M_SUPPORT */
static void wctdm_vpm150m_init(struct wctdm *wc)
{
unsigned short i;
struct vpm150m *vpm150m;
unsigned short reg;
+ unsigned long flags;
+
+#ifdef VPM150M_SUPPORT
struct wctdm_firmware fw;
gpakDownloadStatus_t downloadstatus;
gpakPingDspStat_t pingstatus;
- unsigned long flags;
+#endif
if (!vpmsupport) {
printk("VPM: Support Disabled\n");
@@ -3575,6 +3588,12 @@ static void wctdm_vpm150m_init(struct wctdm *wc)
if (debug & DEBUG_ECHOCAN)
printk("Passed\n");
+#ifndef VPM150M_SUPPORT
+ printk("Found VPMADT032 module but it is not able to function in anything less than a version 2.6 kernel\n");
+ printk("Please update your kernel to a 2.6 or later kernel to enable it\n");
+ goto failed_exit;
+#else
+
#if 0
/* Load the firmware */
set_bit(VPM150M_SPIRESET, &vpm150m->control);
@@ -3633,6 +3652,7 @@ static void wctdm_vpm150m_init(struct wctdm *wc)
}
return;
+#endif /* VPM150M_SUPPORT */
failed_exit:
spin_lock_irqsave(&wc->reglock, flags);
@@ -4063,11 +4083,15 @@ static void wctdm_release(struct wctdm *wc)
static void __devexit wctdm_remove_one(struct pci_dev *pdev)
{
- unsigned long flags;
struct wctdm *wc = pci_get_drvdata(pdev);
+
+#ifdef VPM150M_SUPPORT
+ unsigned long flags;
struct vpm150m *vpm150m = wc->vpm150m;
+#endif
if (wc) {
+#ifdef VPM150M_SUPPORT
if (vpm150m) {
clear_bit(VPM150M_DTMFDETECT, &vpm150m->control);
clear_bit(VPM150M_ACTIVE, &vpm150m->control);
@@ -4081,6 +4105,7 @@ static void __devexit wctdm_remove_one(struct pci_dev *pdev)
kfree(wc->vpm150m);
}
+#endif
/* Stop any DMA */
wctdm_stop_dma(wc);