323 |
"AU88x0 ADB", |
"AU88x0 ADB", |
324 |
"AU88x0 SPDIF", |
"AU88x0 SPDIF", |
325 |
"AU88x0 I2S", |
"AU88x0 I2S", |
|
"AU88x0 DSP", |
|
326 |
"AU88x0 A3D", |
"AU88x0 A3D", |
327 |
|
"AU88x0 WT", |
328 |
}; |
}; |
329 |
static char *vortex_pcm_name[VORTEX_PCM_LAST] = { |
static char *vortex_pcm_name[VORTEX_PCM_LAST] = { |
330 |
"adb", |
"adb", |
336 |
|
|
337 |
/* SPDIF kcontrol */ |
/* SPDIF kcontrol */ |
338 |
static int snd_vortex_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) { |
static int snd_vortex_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) { |
339 |
uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; |
static char *texts[] = { "32000", "44100", "48000"}; |
340 |
|
|
341 |
|
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
342 |
uinfo->count = 1; |
uinfo->count = 1; |
343 |
|
uinfo->value.enumerated.items = 3; |
344 |
|
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) |
345 |
|
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; |
346 |
|
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); |
347 |
return 0; |
return 0; |
348 |
} |
} |
349 |
static int snd_vortex_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) { |
static int snd_vortex_spdif_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) { |
350 |
//vortex_t *vortex = snd_kcontrol_chip(kcontrol); |
vortex_t *vortex = snd_kcontrol_chip(kcontrol); |
351 |
|
|
352 |
ucontrol->value.iec958.status[0] = 0; |
if (vortex->spdif_sr == 32000) |
353 |
ucontrol->value.iec958.status[1] = 1; |
ucontrol->value.enumerated.item[0]=0; |
354 |
ucontrol->value.iec958.status[2] = 1; |
if (vortex->spdif_sr == 44100) |
355 |
ucontrol->value.iec958.status[3] = 0; |
ucontrol->value.enumerated.item[0]=1; |
356 |
|
if (vortex->spdif_sr == 48000) |
357 |
return 0; |
ucontrol->value.enumerated.item[0]=2; |
358 |
|
return 0; |
359 |
} |
} |
360 |
static int snd_vortex_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) { |
static int snd_vortex_spdif_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) { |
361 |
vortex_t * vortex = snd_kcontrol_chip(kcontrol); |
vortex_t * vortex = snd_kcontrol_chip(kcontrol); |
362 |
int change = 0; |
static unsigned int sr[3] = {32000, 44100, 48000}; |
363 |
|
|
364 |
vortex_spdif_init(vortex, 48000, 1); |
//printk("vortex: spdif sr = %d\n", ucontrol->value.enumerated.item[0]); |
365 |
|
vortex->spdif_sr = sr[ucontrol->value.enumerated.item[0] % 3]; |
366 |
return change; |
vortex_spdif_init(vortex, sr[ucontrol->value.enumerated.item[0] % 3], 1); |
367 |
|
return 1; |
368 |
} |
} |
369 |
static snd_kcontrol_new_t vortex_spdif_kcontrol __devinitdata = { |
static snd_kcontrol_new_t vortex_spdif_kcontrol __devinitdata = { |
370 |
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
371 |
.name = "SPDIF SR ", |
.name = "SPDIF SR", |
372 |
.index = 0, |
.index = 0, |
373 |
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
.access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
374 |
.private_value = 0, |
.private_value = 0, |