[alsa-devel] i think ac97 needs an is_surback_on() function

John L. Utz III john.utz at dmx.com
Sat Aug 23 00:20:09 CEST 2008


ac97_patch.c provides two helper functions that wrap the channel_mode  
variable, but they only take you out to 5.1 Audio:

static inline int is_surround_on(struct snd_ac97 *ac97)
{
	return ac97->channel_mode >= 1;
}

static inline int is_clfe_on(struct snd_ac97 *ac97)
{
	return ac97->channel_mode >= 2;
}


For 7.1 Audio, i think there needs to be a test for 'Surround Back' or  
'Back Surround'

static inline int is_surback_on(struct snd_ac97 *ac97)
{
	return ac97->channel_mode >= 4;
}


Am i correct? or am i mistaken? agreement or corrections appreciated!

I think that i need this function for implementing vt1618_update_jacks()  
because vt1618 is 7.1 Audio:

static void vt1618_update_jacks(struct snd_ac97 *ac97)
{
	unsigned short usSft = 0, usMsk = 0x0003;

	if(is_surround_on(ac97))
		ac97_update_bits_page(ac97, 0x60, 0x000C,
				      ucontrol->value.enumerated.item[0]<<2,
				      0);

	if(is_clfe_on(ac97))
		ac97_update_bits_page(ac97, 0x60, 0x0030,
				      ucontrol->value.enumerated.item[0]<<4,
				      0);

	if(is_surback_on(ac97)) {
		/* toggle surround rear dac power */

		snd_ac97_update_bits(ac97, 0x5c, 0x0008,
				     ucontrol->value.enumerated.item[0] << 3);

		/* toggle aux in surround rear out jack */

		snd_ac97_update_bits(ac97, 0x76, 0x0008,
				     ucontrol->value.enumerated.item[0] << 3);
	}
}



More information about the Alsa-devel mailing list