Subject: Re: kern/29178: confusing behaviour because mixer classes in eap driver are misnamed
To: None <fredb@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Joachim Kuebart <kuebart@mathematik.uni-ulm.de>
List: netbsd-bugs
Date: 02/13/2005 22:06:01
The following reply was made to PR kern/29178; it has been noted by GNATS.

From: Joachim Kuebart <kuebart@mathematik.uni-ulm.de>
To: Frederick Bruckman <fredb@immanent.net>
Cc: Joachim Kuebart <kuebart@mathematik.uni-ulm.de>,
	gnats-bugs@netbsd.org
Subject: Re: kern/29178: confusing behaviour because mixer classes in eap driver are misnamed
Date: Sun, 13 Feb 2005 22:55:18 +0100

 Ok,
 
 this is the reduced patch to rename outputs.select to inputs.source in
 pci/eap.c:
 
 Index: eap.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/pci/eap.c,v
 retrieving revision 1.76
 diff -u -p -r1.76 eap.c
 --- eap.c	15 Jan 2005 15:19:52 -0000	1.76
 +++ eap.c	13 Feb 2005 20:25:45 -0000
 @@ -164,7 +164,7 @@ struct eap_softc {
  
  	u_short	sc_port[AK_NPORTS];	/* mirror of the hardware setting */
  	u_int	sc_record_source;	/* recording source mask */
 -	u_int	sc_output_source;	/* output source mask */
 +	u_int	sc_input_source;	/* input source mask */
  	u_int	sc_mic_preamp;
  	char    sc_1371;		/* Using ES1371/AC97 codec */
  
 @@ -703,7 +703,7 @@ eap_attach(struct device *parent, struct
  		eap_hw_if = &eap1370_hw_if;
  
  		/* Enable all relevant mixer switches. */
 -		ctl.dev = EAP_OUTPUT_SELECT;
 +		ctl.dev = EAP_INPUT_SOURCE;
  		ctl.type = AUDIO_MIXER_SET;
  		ctl.un.mask = 1 << EAP_VOICE_VOL | 1 << EAP_FM_VOL |
  			1 << EAP_CD_VOL | 1 << EAP_LINE_VOL | 1 << EAP_AUX_VOL |
 @@ -1478,10 +1478,10 @@ eap1370_mixer_set_port(void *addr, mixer
  		eap1370_set_mixer(sc, AK_IN_MIXER2_R, r2);
  		return 0;
  	}
 -	if (cp->dev == EAP_OUTPUT_SELECT) {
 +	if (cp->dev == EAP_INPUT_SOURCE) {
  		if (cp->type != AUDIO_MIXER_SET)
  			return EINVAL;
 -		m = sc->sc_output_source = cp->un.mask;
 +		m = sc->sc_input_source = cp->un.mask;
  		o1 = o2 = 0;
  		if (m & (1 << EAP_VOICE_VOL))
  			o2 |= AK_M_VOICE_L | AK_M_VOICE_R;
 @@ -1578,10 +1578,10 @@ eap1370_mixer_get_port(void *addr, mixer
  			return EINVAL;
  		cp->un.mask = sc->sc_record_source;
  		return 0;
 -	case EAP_OUTPUT_SELECT:
 +	case EAP_INPUT_SOURCE:
  		if (cp->type != AUDIO_MIXER_SET)
  			return EINVAL;
 -		cp->un.mask = sc->sc_output_source;
 +		cp->un.mask = sc->sc_input_source;
  		return 0;
  	case EAP_MIC_PREAMP:
  		if (cp->type != AUDIO_MIXER_ENUM)
 @@ -1719,10 +1719,10 @@ eap1370_query_devinfo(void *addr, mixer_
  		strcpy(dip->un.s.member[5].label.name, AudioNdac);
  		dip->un.s.member[5].mask = 1 << EAP_VOICE_VOL;
  		return 0;
 -	case EAP_OUTPUT_SELECT:
 -		dip->mixer_class = EAP_OUTPUT_CLASS;
 +	case EAP_INPUT_SOURCE:
 +		dip->mixer_class = EAP_INPUT_CLASS;
  		dip->prev = dip->next = AUDIO_MIXER_LAST;
 -		strcpy(dip->label.name, AudioNselect);
 +		strcpy(dip->label.name, AudioNsource);
  		dip->type = AUDIO_MIXER_SET;
  		dip->un.s.num_mem = 6;
  		strcpy(dip->un.s.member[0].label.name, AudioNmicrophone);
 Index: eapreg.h
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/pci/eapreg.h,v
 retrieving revision 1.9
 diff -u -p -r1.9 eapreg.h
 --- eapreg.h	15 Jan 2005 15:19:52 -0000	1.9
 +++ eapreg.h	13 Feb 2005 20:25:45 -0000
 @@ -269,7 +269,7 @@
  #define EAP_AUX_VOL		5
  #define EAP_MIC_VOL		6
  #define	EAP_RECORD_SOURCE	7
 -#define EAP_OUTPUT_SELECT	8
 +#define EAP_INPUT_SOURCE	8
  #define	EAP_MIC_PREAMP		9
  #define EAP_OUTPUT_CLASS	10
  #define EAP_RECORD_CLASS	11