All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Timofei V. Bondarenko" <tim@ipi.ac.ru>
To: alsa-devel@lists.sourceforge.net
Subject: [Patch] _snd_cmipci_uswitch_put doesn't set zero flags
Date: Wed, 20 Dec 2006 19:09:24 +0300	[thread overview]
Message-ID: <45896034.8030705@ipi.ac.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 576 bytes --]

Hi.

Playing with spdif output on cmipci i've noticed the SPDO5V option does 
not change appropriate bits the register.

The _snd_cmipci_uswitch_put checks the change in flags in wrong way.
If 'active' state of an option corresponds to a _zero_ bits in a hw 
register then function fails. The SPDO5V is the sample.
In the most cases 'active' state of option is set through an non-zerio 
bits in a register. This case works fine.

The fix attached.
Unfortunately i was unable to change spdif output voltage anyway.
Although the register changes right at least.

Regards.
	Tim.

[-- Attachment #2: cmipci.diff --]
[-- Type: text/x-patch, Size: 547 bytes --]

--- pci/cmipci.c.old	2006-12-07 17:07:25.000000000 +0300
+++ pci/cmipci.c	2006-12-20 18:18:01.000000000 +0300
@@ -2198,7 +2198,8 @@ static int _snd_cmipci_uswitch_put(struc
 		val = inb(cm->iobase + args->reg);
 	else
 		val = snd_cmipci_read(cm, args->reg);
-	change = (val & args->mask) != (ucontrol->value.integer.value[0] ? args->mask : 0);
+	change = (val & args->mask) != (ucontrol->value.integer.value[0] ? 
+			args->mask_on : (args->mask & ~args->mask_on));
 	if (change) {
 		val &= ~args->mask;
 		if (ucontrol->value.integer.value[0])

[-- Attachment #3: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

             reply	other threads:[~2006-12-20 16:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20 16:09 Timofei V. Bondarenko [this message]
2006-12-20 18:28 ` [Patch] _snd_cmipci_uswitch_put doesn't set zero flags 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=45896034.8030705@ipi.ac.ru \
    --to=tim@ipi.ac.ru \
    --cc=alsa-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.