aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/ctmixer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ctxfi/ctmixer.c')
-rw-r--r--sound/pci/ctxfi/ctmixer.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/sound/pci/ctxfi/ctmixer.c b/sound/pci/ctxfi/ctmixer.c
index 15c1e7271ea8..c3519ff42fbb 100644
--- a/sound/pci/ctxfi/ctmixer.c
+++ b/sound/pci/ctxfi/ctmixer.c
@@ -566,19 +566,6 @@ static int ct_spdif_get_mask(struct snd_kcontrol *kcontrol,
566 return 0; 566 return 0;
567} 567}
568 568
569static int ct_spdif_default_get(struct snd_kcontrol *kcontrol,
570 struct snd_ctl_elem_value *ucontrol)
571{
572 unsigned int status = SNDRV_PCM_DEFAULT_CON_SPDIF;
573
574 ucontrol->value.iec958.status[0] = (status >> 0) & 0xff;
575 ucontrol->value.iec958.status[1] = (status >> 8) & 0xff;
576 ucontrol->value.iec958.status[2] = (status >> 16) & 0xff;
577 ucontrol->value.iec958.status[3] = (status >> 24) & 0xff;
578
579 return 0;
580}
581
582static int ct_spdif_get(struct snd_kcontrol *kcontrol, 569static int ct_spdif_get(struct snd_kcontrol *kcontrol,
583 struct snd_ctl_elem_value *ucontrol) 570 struct snd_ctl_elem_value *ucontrol)
584{ 571{
@@ -586,6 +573,10 @@ static int ct_spdif_get(struct snd_kcontrol *kcontrol,
586 unsigned int status; 573 unsigned int status;
587 574
588 atc->spdif_out_get_status(atc, &status); 575 atc->spdif_out_get_status(atc, &status);
576
577 if (status == 0)
578 status = SNDRV_PCM_DEFAULT_CON_SPDIF;
579
589 ucontrol->value.iec958.status[0] = (status >> 0) & 0xff; 580 ucontrol->value.iec958.status[0] = (status >> 0) & 0xff;
590 ucontrol->value.iec958.status[1] = (status >> 8) & 0xff; 581 ucontrol->value.iec958.status[1] = (status >> 8) & 0xff;
591 ucontrol->value.iec958.status[2] = (status >> 16) & 0xff; 582 ucontrol->value.iec958.status[2] = (status >> 16) & 0xff;
@@ -629,7 +620,7 @@ static struct snd_kcontrol_new iec958_default_ctl = {
629 .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT), 620 .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT),
630 .count = 1, 621 .count = 1,
631 .info = ct_spdif_info, 622 .info = ct_spdif_info,
632 .get = ct_spdif_default_get, 623 .get = ct_spdif_get,
633 .put = ct_spdif_put, 624 .put = ct_spdif_put,
634 .private_value = MIXER_IEC958_DEFAULT 625 .private_value = MIXER_IEC958_DEFAULT
635}; 626};