static int
snd_vortex_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
	vortex_t *vortex = snd_kcontrol_chip(kcontrol);
	static unsigned int sr[3] = { 32000, 44100, 48000 };

	//printk("vortex: spdif sr = %d\n", ucontrol->value.enumerated.item[0]);
	vortex->spdif_sr = sr[ucontrol->value.enumerated.item[0] % 3];
	vortex_spdif_init(vortex,
			  sr[ucontrol->value.enumerated.item[0] % 3], 1);
	return 1;
}
Beispiel #2
0
static int snd_vortex_spdif_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
	vortex_t *vortex = snd_kcontrol_chip(kcontrol);
	int spdif_sr = 48000;
	switch (ucontrol->value.iec958.status[3] & IEC958_AES3_CON_FS) {
	case IEC958_AES3_CON_FS_32000: spdif_sr = 32000; break;
	case IEC958_AES3_CON_FS_44100: spdif_sr = 44100; break;
	case IEC958_AES3_CON_FS_48000: spdif_sr = 48000; break;
	}
	if (spdif_sr == vortex->spdif_sr)
		return 0;
	vortex->spdif_sr = spdif_sr;
	vortex_spdif_init(vortex, vortex->spdif_sr, 1);
	return 1;
}