alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: pbruskispam@op.pl
To: patch@alsa-project.org
Cc: alsa-devel@alsa-project.org, Przemyslaw Bruski <pbruskispam@op.pl>
Subject: [PATCH - ctxfi driver 3/4] Fix: spdif status retrieval always returned the default settings instead of the actual ones
Date: Sun, 13 Mar 2011 16:18:57 +0100	[thread overview]
Message-ID: <1300029538-3147-3-git-send-email-pbruskispam@op.pl> (raw)
In-Reply-To: <1300029538-3147-1-git-send-email-pbruskispam@op.pl>

From: Przemyslaw Bruski <pbruskispam@op.pl>


Signed-off-by: Przemyslaw Bruski <pbruskispam@op.pl>

diff --git a/pci/ctxfi/ctmixer.c b/pci/ctxfi/ctmixer.c
index 15c1e72..c3519ff 100644
--- a/pci/ctxfi/ctmixer.c
+++ b/pci/ctxfi/ctmixer.c
@@ -566,19 +566,6 @@ static int ct_spdif_get_mask(struct snd_kcontrol *kcontrol,
 	return 0;
 }
 
-static int ct_spdif_default_get(struct snd_kcontrol *kcontrol,
-				struct snd_ctl_elem_value *ucontrol)
-{
-	unsigned int status = SNDRV_PCM_DEFAULT_CON_SPDIF;
-
-	ucontrol->value.iec958.status[0] = (status >> 0) & 0xff;
-	ucontrol->value.iec958.status[1] = (status >> 8) & 0xff;
-	ucontrol->value.iec958.status[2] = (status >> 16) & 0xff;
-	ucontrol->value.iec958.status[3] = (status >> 24) & 0xff;
-
-	return 0;
-}
-
 static int ct_spdif_get(struct snd_kcontrol *kcontrol,
 			struct snd_ctl_elem_value *ucontrol)
 {
@@ -586,6 +573,10 @@ static int ct_spdif_get(struct snd_kcontrol *kcontrol,
 	unsigned int status;
 
 	atc->spdif_out_get_status(atc, &status);
+
+	if (status == 0)
+		status = SNDRV_PCM_DEFAULT_CON_SPDIF;
+
 	ucontrol->value.iec958.status[0] = (status >> 0) & 0xff;
 	ucontrol->value.iec958.status[1] = (status >> 8) & 0xff;
 	ucontrol->value.iec958.status[2] = (status >> 16) & 0xff;
@@ -629,7 +620,7 @@ static struct snd_kcontrol_new iec958_default_ctl = {
 	.name		= SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT),
 	.count		= 1,
 	.info		= ct_spdif_info,
-	.get		= ct_spdif_default_get,
+	.get		= ct_spdif_get,
 	.put		= ct_spdif_put,
 	.private_value	= MIXER_IEC958_DEFAULT
 };
-- 
1.7.1

  parent reply	other threads:[~2011-03-13 15:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-13 15:18 [PATCH - ctxfi driver 1/4] Fix: microphone boost was set at +12dB, not +20dB (like in Windows driver and in adc_conf structure declaration), some comments added pbruskispam
2011-03-13 15:18 ` [PATCH - ctxfi driver 2/4] Fix: mask creation was incorrect pbruskispam
2011-03-13 15:18 ` pbruskispam [this message]
2011-03-13 15:18 ` [PATCH - ctxfi driver 4/4] Fix: clear input settings before initialization pbruskispam
2011-03-14 11:45 ` [PATCH - ctxfi driver 1/4] Fix: microphone boost was set at +12dB, not +20dB (like in Windows driver and in adc_conf structure declaration), some comments added Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1300029538-3147-3-git-send-email-pbruskispam@op.pl \
    --to=pbruskispam@op.pl \
    --cc=alsa-devel@alsa-project.org \
    --cc=patch@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).