Subject: port-i386/864: pas.c doesn't recognize ProAudio Spectrum 16 Basic card.
To: None <gnats-admin@NetBSD.ORG>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: netbsd-bugs
Date: 03/12/1995 06:20:04
>Number:         864
>Category:       port-i386
>Synopsis:       pas.c doesn't recognize ProAudio Spectrum 16 Basic card.
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 12 06:20:03 1995
>Originator:     John F. Woods
>Organization:
Misanthropes-R-Us
>Release:        NetBSD-current March 12, 1995
>Environment:
	486/33 ISA with PAS-16 Basic card
	NetBSD-current
System: NetBSD jfwhome.funhouse.com 1.0A NetBSD 1.0A (JFW) #10: Fri Mar 3 22:38:25 EST 1995 jfw@jfwhome.funhouse.com:/usr/src/sys/arch/i386/compile/JFW i386


>Description:
The pas.c driver doesn't recognize the ProAudio Spectrum 16 Basic card, which
is simply a PAS-16 with no CD-ROM interface.  The PAS-16Basic identifies
itself by returning the value 0x0C from the OPERATION_MODE_1 register;
the O_M_1_to_card[] array in pasreg.h is used to interpret values read from
that register.
>How-To-Repeat:
Install such a card and watch it not be recognized.
>Fix:
There are two possible fixes, both quite simple.  If the CD-ROM interface
is never going to be supported, it would suffice to change pasreg.h to
have the value 3 in O_M_1_to_card[12].  Assuming that the CD-ROM interface
might be supported eventually, I added a new type to pasreg.h and changed
pas.c to cope with it, as follows:

*** pasreg.h.ORIG	Mon Feb 20 21:27:19 1995
--- pasreg.h	Wed Mar  1 23:08:27 1995
***************
*** 138,143 ****
--- 138,144 ----
  #define PAS_PLUS	1
  #define PAS_CDPC	2
  #define PAS_16		3
+ #define PAS_16BASIC     4        /* no CDrom */
  
  #ifdef DEFINE_TRANSLATIONS
  	char I_C_2_PCM_DMA_translate[] = 		/* R W  PCM		PCM DMA channel value translations		*/
***************
*** 151,157 ****
  	char E_C_SB_DMA_translate[] = 			/* R W	PCM		SB emulation DMA translate			*/
  		{ 0x00, 0x40, 0x80, 0xC0 };
  	char O_M_1_to_card[] = 				/* R W	Control		Translate (OM1 & 0x0f) to card type		*/
! 		{ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 3 };   
  #else
  	extern char I_C_2_PCM_DMA_translate[];		/* R W  PCM		PCM DMA channel value translations		*/
  	extern char I_C_3_PCM_IRQ_translate[];		/* R W	PCM		PCM IRQ level value translation			*/
--- 152,158 ----
  	char E_C_SB_DMA_translate[] = 			/* R W	PCM		SB emulation DMA translate			*/
  		{ 0x00, 0x40, 0x80, 0xC0 };
  	char O_M_1_to_card[] = 				/* R W	Control		Translate (OM1 & 0x0f) to card type		*/
! 		{ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, 0, 2, 3 };   
  #else
  	extern char I_C_2_PCM_DMA_translate[];		/* R W  PCM		PCM DMA channel value translations		*/
  	extern char I_C_3_PCM_IRQ_translate[];		/* R W	PCM		PCM IRQ level value translation			*/
*** pas.c	Thu Mar  2 21:32:07 1995
--- pas.c.orig	Wed Mar  1 22:53:46 1995
***************
*** 160,167 ****
  	"",
  	"Plus",
  	"CDPC",
! 	"16",
! 	"16Basic"
  };
  
  static struct audio_device pas_device = {
--- 160,166 ----
  	"",
  	"Plus",
  	"CDPC",
! 	"16"
  };
  
  static struct audio_device pas_device = {
***************
*** 218,224 ****
  	/* Sets mute off and selects filter rate of 17.897 kHz */
  	paswrite(F_F_MIXER_UNMUTE | 0x01, FILTER_FREQUENCY);
  
! 	if (model == PAS_16 || model == PAS_16BASIC)
  		paswrite(8, PRESCALE_DIVIDER);
  	else
  		paswrite(0, PRESCALE_DIVIDER);
--- 217,223 ----
  	/* Sets mute off and selects filter rate of 17.897 kHz */
  	paswrite(F_F_MIXER_UNMUTE | 0x01, FILTER_FREQUENCY);
  
! 	if (model == PAS_16) 
  		paswrite(8, PRESCALE_DIVIDER);
  	else
  		paswrite(0, PRESCALE_DIVIDER);

>Audit-Trail:
>Unformatted: