All of lore.kernel.org
 help / color / mirror / Atom feed
From: "John Utz" <John.Utz@dmxmusic.com>
To: alsa-devel@lists.sourceforge.net
Subject: patch: ac97_patch.c - enable 'Smart 5.1' on VIA vt1617a ac97 codec
Date: Fri, 23 Feb 2007 16:44:33 -0800	[thread overview]
Message-ID: <F8FB97052F1BEF409F7842E960E49B5AAAF8B4@sea-exch-01.na.corp.dmxmusic.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 864 bytes --]


This patch allows via vt1617a end users to configure what via calls Smart 5.1 - a mechanism for controlling the 3 bi-directional analog connectors that some OEM's use instead of a larger collection of dedicated analog input and output connectors.

As outlined in previous discussion on this list, the outcome matrix for togging these bits is somewhat arcane and seemingly lacking in cohesion, but with only 3 bits, it's reasonable to expect that a motivated end user will be able to eventually configure their own personal setup to their needs.

Note that in some instances (such as an epia C7) it is also required to disable 'alternate surround out' to get surround to work properly.

Note that this is my first ever alsa patch and after review by wiser craniums it may need fixin'. ;-)

plz dont hesitate to ask for such corrections!

tnx!

johnu

[-- Attachment #1.2: Type: text/html, Size: 1328 bytes --]

[-- Attachment #2: ac97_patch_c-1617aSmart51.patch --]
[-- Type: application/octet-stream, Size: 1395 bytes --]

diff -r 29b0b4245d06 pci/ac97/ac97_patch.c
--- a/pci/ac97/ac97_patch.c	Thu Feb 22 16:07:21 2007 +0100
+++ b/pci/ac97/ac97_patch.c	Fri Feb 23 16:23:36 2007 -0800
@@ -3273,8 +3273,28 @@ static int patch_vt1616(struct snd_ac97 
 /*
  * VT1617A codec
  */
+
+static const struct snd_kcontrol_new snd_ac97_controls_vt1617a[] = {
+  AC97_SINGLE("Center/LFE Exchange",   0x5a,  8, 1, 0),
+  /*
+   * These are used to enable/disable surround sound on motherboards
+   * that have 3 bidirectional analog jacks
+   */
+  AC97_SINGLE("Smart 5.1 Control A", 0x20,  8, 1, 0),
+  AC97_SINGLE("Smart 5.1 Control B", 0x7a, 15, 1, 0),
+  AC97_SINGLE("Smart 5.1 Control C", 0x7a, 14, 1, 0)
+};
+
 static int patch_vt1617a(struct snd_ac97 * ac97)
 {
+        /* instantiate our specific controls, we choose to continue in the event of failure
+	   because we wish to allow the other actions to continue */
+
+	int err = 0;
+
+	err = patch_build_controls(ac97, &snd_ac97_controls_vt1617a[0],
+				   ARRAY_SIZE(snd_ac97_controls_vt1617a));
+
 	/* bring analog power consumption to normal, like WinXP driver
 	 * for EPIA SP
 	 */
@@ -3282,7 +3302,7 @@ static int patch_vt1617a(struct snd_ac97
 	ac97->ext_id |= AC97_EI_SPDIF;	/* force the detection of spdif */
 	ac97->rates[AC97_RATES_SPDIF] = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000;
 	ac97->build_ops = &patch_vt1616_ops;
-	return 0;
+	return err;
 }
 
 /*

[-- 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

             reply	other threads:[~2007-02-24  0:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-24  0:44 John Utz [this message]
2007-02-26 14:49 ` patch: ac97_patch.c - enable 'Smart 5.1' on VIA vt1617a ac97 codec Takashi Iwai
2007-02-26 18:25   ` John Utz

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=F8FB97052F1BEF409F7842E960E49B5AAAF8B4@sea-exch-01.na.corp.dmxmusic.com \
    --to=john.utz@dmxmusic.com \
    --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.