patch-2.2.6 linux/drivers/sound/ad1848.c

Next file: linux/drivers/sound/audio.c
Previous file: linux/drivers/scsi/wd33c93.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.5/linux/drivers/sound/ad1848.c linux/drivers/sound/ad1848.c
@@ -137,6 +137,21 @@
 #define io_Status(d)		((d)->base+2)
 #define io_Polled_IO(d)		((d)->base+3)
 
+static struct {
+     unsigned char flags;
+#define CAP_F_TIMER 0x01     
+} capabilities [9 /*devc->model */ ] = {
+     {0}
+    ,{0}           /* MD_1848  */
+    ,{CAP_F_TIMER} /* MD_4231  */
+    ,{CAP_F_TIMER} /* MD_4231A */
+    ,{CAP_F_TIMER} /* MD_1845  */
+    ,{CAP_F_TIMER} /* MD_4232  */
+    ,{0}           /* MD_C930  */
+    ,{CAP_F_TIMER} /* MD_IWAVE */
+    ,{0}           /* MD_4235 */
+};
+
 static int      ad1848_open(int dev, int mode);
 static void     ad1848_close(int dev);
 static void     ad1848_output_block(int dev, unsigned long buf, int count, int intrflag);
@@ -1894,7 +1909,7 @@
 			/* Don't free it either then.. */
 			devc->irq = 0;
 		}
-		if (devc->model != MD_1848 && devc->model != MD_C930)
+		if (capabilities[devc->model].flags & CAP_F_TIMER)
 		{
 #ifndef __SMP__
 			int x;
@@ -1927,8 +1942,8 @@
 		irq2dev[-irq] = devc->dev_no = my_dev;
 
 #if defined(CONFIG_SEQUENCER) && !defined(EXCLUDE_TIMERS)
-	if (devc->model != MD_1848 &&
-	    devc->model != MD_C930 && devc->irq_ok)
+	if ((capabilities[devc->model].flags & CAP_F_TIMER) &&
+	    devc->irq_ok)
 		ad1848_tmr_install(my_dev);
 #endif
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)