mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
ALSA: bebob: Use different labels for digital input/output
This commit uses different labels for control elements of digital input/output interfaces to correct my misunderstanding about M-Audio Firewire 1814 and ProjectMix I/O. According to user manuals for these two models, they have two modes for digital input; one is S/PDIF in both of optical and coaxial interfaces, another is ADAT in optical interface only. But in current implementation, a control element for it reduced labels which a control element for digital output uses because of my misunderstanding that optical interface is not available for digital input with S/PDIF mode. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
9014011664
commit
5a0438f4a6
1 changed files with 16 additions and 7 deletions
|
@ -434,8 +434,8 @@ static struct snd_kcontrol_new special_sync_ctl = {
|
|||
.get = special_sync_ctl_get,
|
||||
};
|
||||
|
||||
/* Digital interface control for special firmware */
|
||||
static char *const special_dig_iface_labels[] = {
|
||||
/* Digital input interface control for special firmware */
|
||||
static char *const special_dig_in_iface_labels[] = {
|
||||
"S/PDIF Optical", "S/PDIF Coaxial", "ADAT Optical"
|
||||
};
|
||||
static int special_dig_in_iface_ctl_info(struct snd_kcontrol *kctl,
|
||||
|
@ -443,13 +443,13 @@ static int special_dig_in_iface_ctl_info(struct snd_kcontrol *kctl,
|
|||
{
|
||||
einf->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
||||
einf->count = 1;
|
||||
einf->value.enumerated.items = ARRAY_SIZE(special_dig_iface_labels);
|
||||
einf->value.enumerated.items = ARRAY_SIZE(special_dig_in_iface_labels);
|
||||
|
||||
if (einf->value.enumerated.item >= einf->value.enumerated.items)
|
||||
einf->value.enumerated.item = einf->value.enumerated.items - 1;
|
||||
|
||||
strcpy(einf->value.enumerated.name,
|
||||
special_dig_iface_labels[einf->value.enumerated.item]);
|
||||
special_dig_in_iface_labels[einf->value.enumerated.item]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -504,9 +504,14 @@ static int special_dig_in_iface_ctl_set(struct snd_kcontrol *kctl,
|
|||
dig_in_fmt,
|
||||
params->dig_out_fmt,
|
||||
params->clk_lock);
|
||||
if ((err < 0) || (params->dig_in_fmt > 0)) /* ADAT */
|
||||
if (err < 0)
|
||||
goto end;
|
||||
|
||||
/* For ADAT, optical interface is only available. */
|
||||
if (params->dig_in_fmt > 0)
|
||||
goto end;
|
||||
|
||||
/* For S/PDIF, optical/coaxial interfaces are selectable. */
|
||||
err = avc_audio_set_selector(bebob->unit, 0x00, 0x04, dig_in_iface);
|
||||
if (err < 0)
|
||||
dev_err(&bebob->unit->device,
|
||||
|
@ -525,18 +530,22 @@ static struct snd_kcontrol_new special_dig_in_iface_ctl = {
|
|||
.put = special_dig_in_iface_ctl_set
|
||||
};
|
||||
|
||||
/* Digital output interface control for special firmware */
|
||||
static char *const special_dig_out_iface_labels[] = {
|
||||
"S/PDIF Optical and Coaxial", "ADAT Optical"
|
||||
};
|
||||
static int special_dig_out_iface_ctl_info(struct snd_kcontrol *kctl,
|
||||
struct snd_ctl_elem_info *einf)
|
||||
{
|
||||
einf->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
|
||||
einf->count = 1;
|
||||
einf->value.enumerated.items = ARRAY_SIZE(special_dig_iface_labels) - 1;
|
||||
einf->value.enumerated.items = ARRAY_SIZE(special_dig_out_iface_labels);
|
||||
|
||||
if (einf->value.enumerated.item >= einf->value.enumerated.items)
|
||||
einf->value.enumerated.item = einf->value.enumerated.items - 1;
|
||||
|
||||
strcpy(einf->value.enumerated.name,
|
||||
special_dig_iface_labels[einf->value.enumerated.item + 1]);
|
||||
special_dig_out_iface_labels[einf->value.enumerated.item]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue