Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Cushman <rcushman_linux@earthlink.net>
To: Takashi Iwai <tiwai@suse.de>,
	Michal Piotrowski <michal.k.k.piotrowski@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Patch: Shared jack control logic for AD1985 and others
Date: Thu, 08 Mar 2007 18:05:47 -0500	[thread overview]
Message-ID: <45F096CB.2000204@earthlink.net> (raw)
In-Reply-To: <s5hvehbmuvb.wl%tiwai@suse.de>

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

Takashi and Michal,

Here is a patch that I believe will correct the issue Michal identified.

Takashi's patch was close, but he overlooked that I also had the logic 
for the OMS bit reversed.  For the AD1985 Surround would have worked 
correctly, but Center/LFE still would have been broken.

Randy Cushman


[-- Attachment #2: ac97_ad_shared.patch --]
[-- Type: text/plain, Size: 1797 bytes --]

Summary: fix AD shared shared jack control logic

This patch fixes the control logic for shared
Microphone in/Center+LFE out and Line in/Surround out jacks
for Analog Devices AD1888, AD1980 and AD1985 AC '97 CODECs.

Signed-off-by: Randy Cushman <rcushman_linux@earthlink.net>


diff -r e4f79cb873e5 pci/ac97/ac97_patch.c
--- a/pci/ac97/ac97_patch.c	Tue Mar 06 11:29:05 2007 +0100
+++ b/pci/ac97/ac97_patch.c	Thu Mar 08 17:08:52 2007 -0500
@@ -1950,9 +1950,11 @@ static void ad1888_update_jacks(struct s
 static void ad1888_update_jacks(struct snd_ac97 *ac97)
 {
 	unsigned short val = 0;
-	if (! is_shared_linein(ac97))
+	/* clear LODIS if shared jack is to be used for Surround out */
+	if (is_shared_linein(ac97))
 		val |= (1 << 12);
-	if (! is_shared_micin(ac97))
+	/* clear CLDIS if shared jack is to be used for C/LFE out */
+	if (is_shared_micin(ac97))
 		val |= (1 << 11);
 	/* shared Line-In */
 	snd_ac97_update_bits(ac97, AC97_AD_MISC, (1 << 11) | (1 << 12), val);
@@ -2124,8 +2126,9 @@ static void ad1985_update_jacks(struct s
 static void ad1985_update_jacks(struct snd_ac97 *ac97)
 {
 	ad1888_update_jacks(ac97);
+	/* clear OMS if shared jack is to be used for C/LFE out */
 	snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 1 << 9,
-			     is_shared_micin(ac97) ? 0 : 1 << 9);
+			     is_shared_micin(ac97) ? 1 << 9 : 0);
 }
 
 static int patch_ad1985_specific(struct snd_ac97 *ac97)
@@ -2406,9 +2409,9 @@ static void ad1986_update_jacks(struct s
 	unsigned short ser_val;
 
 	/* disable SURROUND and CENTER/LFE if not surround mode */
-	if (! is_surround_on(ac97))
+	if (!is_surround_on(ac97))
 		misc_val |= AC97_AD1986_SODIS;
-	if (! is_clfe_on(ac97))
+	if (!is_clfe_on(ac97))
 		misc_val |= AC97_AD1986_CLDIS;
 
 	/* select line input (default=LINE_IN, SURROUND or MIC_1/2) */

[-- Attachment #3: Type: text/plain, Size: 345 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

  parent reply	other threads:[~2007-03-08 23:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200703051024.l25AOIF3015951@shell0.pdx.osdl.net>
2007-03-05 14:49 ` mm snapshot broken-out-2007-03-05-02-22.tar.gz uploaded Michal Piotrowski
     [not found] ` <45EC2DEB.1050108@googlemail.com>
2007-03-07 11:36   ` Michal Piotrowski
     [not found]   ` <45EEA3C4.7000501@googlemail.com>
2007-03-07 18:47     ` Andrew Morton
2007-03-07 19:41       ` Michal Piotrowski
2007-03-07 19:50         ` Andrew Morton
2007-03-07 20:39           ` Takashi Iwai
2007-03-07 22:22             ` Michal Piotrowski
2007-03-07 22:44               ` Takashi Iwai
2007-03-08 15:42                 ` Michal Piotrowski
2007-03-08 15:46                   ` Michal Piotrowski
2007-03-08 15:55                   ` Takashi Iwai
2007-03-08 16:26                     ` Michal Piotrowski
2007-03-08 16:28                       ` Takashi Iwai
2007-03-08 15:58                   ` Takashi Iwai
2007-03-08 16:23                     ` Michal Piotrowski
2007-03-08 16:15                   ` Takashi Iwai
2007-03-08 16:52                     ` Michal Piotrowski
2007-03-08 16:54                       ` Takashi Iwai
2007-03-08 17:05                         ` Michal Piotrowski
2007-03-08 17:05                         ` Randy Cushman
2007-03-08 18:51                           ` Takashi Iwai
2007-03-08 19:28                             ` Randy Cushman
2007-03-08 23:05                             ` Randy Cushman [this message]
2007-03-09 14:22                               ` Patch: Shared jack control logic for AD1985 and others Takashi Iwai
2007-03-07 22:16           ` mm snapshot broken-out-2007-03-05-02-22.tar.gz uploaded Michal Piotrowski

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=45F096CB.2000204@earthlink.net \
    --to=rcushman_linux@earthlink.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=tiwai@suse.de \
    /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