diff options
author | Przemyslaw Bruski <pbruskispam@op.pl> | 2011-03-13 11:18:57 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-03-14 06:19:42 -0400 |
commit | f164753a263bfd2daaf3e0273b179de7e099c57d (patch) | |
tree | 05e68bbf61cf08689864da26b15cf44c20f5c69e /sound | |
parent | 4c1847e884efddcc3ede371f7839e5e65b25c34d (diff) |
ALSA: ctxfi - Fix SPDIF status retrieval
SDPIF status retrieval always returned the default settings instead of
the actual ones.
Signed-off-by: Przemyslaw Bruski <pbruskispam@op.pl>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/ctxfi/ctmixer.c | 19 |
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 | ||
569 | static 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 | |||
582 | static int ct_spdif_get(struct snd_kcontrol *kcontrol, | 569 | static 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 | }; |