Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Khapyorsky <sashak@smlink.com>
To: Philipp Matthias Hahn <pmhahn@titan.lahn.de>
Cc: Raymond <rayau@netvigator.com>, alsa-devel@lists.sourceforge.net
Subject: Re: Re: au88x0 modem
Date: Fri, 16 Sep 2005 21:47:08 +0300	[thread overview]
Message-ID: <20050916184708.GF17864@tecr> (raw)
In-Reply-To: <20050916144907.GA2454@titan.lahn.de>

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

On 16:49 Fri 16 Sep     , Philipp Matthias Hahn wrote:
> Hello!
> 
> On Fri, Sep 16, 2005 at 04:42:47PM +0200, Philipp Matthias Hahn wrote:
> > Looks like I lost the normal ac97#1-1* files in
> > /proc/asound/card0/codec97#0:
> > 	$ ls /proc/asound/card0/codec97#0/
> > 	mc97#1-1  mc97#1-1+regs
> 
> Worse, two times the directories "codec97#0" with the same name:

The patch is wrong, audio is removed, ac97bus is initialized twice.

I would suggest (after reboot) to use cleaned ALSA CVS version + two 
attached patches. Remember to build with '--with-debug=detect'.

Sasha.

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


This patch extends au88x0 AC97 codec access procedures to handle multiple
codecs properly.

Signed-off-by: Sasha Khapyorsky

Index: alsa-kernel/pci/au88x0/au8810.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au8810.h,v
retrieving revision 1.3
diff -u -p -r1.3 au8810.h
--- alsa-kernel/pci/au88x0/au8810.h	13 Apr 2004 15:26:27 -0000	1.3
+++ alsa-kernel/pci/au88x0/au8810.h	15 Sep 2005 12:23:52 -0000
@@ -178,11 +178,6 @@
 #define		EN_SPDIF	0x000c0000
 
 #define VORTEX_CODEC_CHN 	0x29080
-#define VORTEX_CODEC_WRITE	0x00800000
-#define VORTEX_CODEC_ADDSHIFT 	16
-#define VORTEX_CODEC_ADDMASK	0x7f0000	/* 0x000f0000 */
-#define VORTEX_CODEC_DATSHIFT	0
-#define VORTEX_CODEC_DATMASK	0xffff
 #define VORTEX_CODEC_IO		0x29188
 
 /* SPDIF */
Index: alsa-kernel/pci/au88x0/au8820.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au8820.h,v
retrieving revision 1.3
diff -u -p -r1.3 au8820.h
--- alsa-kernel/pci/au88x0/au8820.h	13 Apr 2004 15:26:27 -0000	1.3
+++ alsa-kernel/pci/au88x0/au8820.h	15 Sep 2005 12:23:52 -0000
@@ -162,11 +162,6 @@
 #define		EN_SPORT	0x00030000
 #define		EN_SPDIF	0x000c0000
 #define VORTEX_CODEC_CHN 0x11880
-#define VORTEX_CODEC_WRITE 0x00800000
-#define VORTEX_CODEC_ADDSHIFT 16
-#define VORTEX_CODEC_ADDMASK 0x7f0000	/* 0x000f0000 */
-#define VORTEX_CODEC_DATSHIFT 0
-#define VORTEX_CODEC_DATMASK 0xffff
 #define VORTEX_CODEC_IO 0x11988
 
 #define VORTEX_SPDIF_FLAGS		0x1005c	/* FIXME */
Index: alsa-kernel/pci/au88x0/au8830.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au8830.h,v
retrieving revision 1.3
diff -u -p -r1.3 au8830.h
--- alsa-kernel/pci/au88x0/au8830.h	13 Apr 2004 15:26:27 -0000	1.3
+++ alsa-kernel/pci/au88x0/au8830.h	15 Sep 2005 12:23:52 -0000
@@ -194,11 +194,6 @@
 
 #define VORTEX_CODEC_CTRL 0x29184
 #define VORTEX_CODEC_IO 0x29188
-#define 	VORTEX_CODEC_WRITE 0x00800000
-#define 	VORTEX_CODEC_ADDSHIFT 16
-#define 	VORTEX_CODEC_ADDMASK 0x7f0000	/* 0x000f0000 */
-#define 	VORTEX_CODEC_DATSHIFT 0
-#define 	VORTEX_CODEC_DATMASK 0xffff
 
 #define VORTEX_CODEC_SPORTCTRL 0x2918c
 
Index: alsa-kernel/pci/au88x0/au88x0.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au88x0.h,v
retrieving revision 1.11
diff -u -p -r1.11 au88x0.h
--- alsa-kernel/pci/au88x0/au88x0.h	22 Mar 2005 08:50:55 -0000	1.11
+++ alsa-kernel/pci/au88x0/au88x0.h	15 Sep 2005 12:23:52 -0000
@@ -79,6 +79,14 @@
 #define VORTEX_RESOURCE_A3D	0x00000004
 #define VORTEX_RESOURCE_LAST	0x00000005
 
+/* codec io: VORTEX_CODEC_IO bits */
+#define VORTEX_CODEC_ID_SHIFT	24
+#define VORTEX_CODEC_WRITE	0x00800000
+#define VORTEX_CODEC_ADDSHIFT 	16
+#define VORTEX_CODEC_ADDMASK	0x7f0000
+#define VORTEX_CODEC_DATSHIFT	0
+#define VORTEX_CODEC_DATMASK	0xffff
+
 /* Check for SDAC bit in "Extended audio ID" AC97 register */
 //#define VORTEX_IS_QUAD(x) (((x)->codec == NULL) ?  0 : ((x)->codec->ext_id&0x80))
 #define VORTEX_IS_QUAD(x) ((x)->isquad)
Index: alsa-kernel/pci/au88x0/au88x0_core.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au88x0_core.c,v
retrieving revision 1.11
diff -u -p -r1.11 au88x0_core.c
--- alsa-kernel/pci/au88x0/au88x0_core.c	23 Feb 2005 11:00:31 -0000	1.11
+++ alsa-kernel/pci/au88x0/au88x0_core.c	15 Sep 2005 12:23:53 -0000
@@ -2532,7 +2532,8 @@ vortex_codec_write(ac97_t * codec, unsig
 	hwwrite(card->mmio, VORTEX_CODEC_IO,
 		((addr << VORTEX_CODEC_ADDSHIFT) & VORTEX_CODEC_ADDMASK) |
 		((data << VORTEX_CODEC_DATSHIFT) & VORTEX_CODEC_DATMASK) |
-		VORTEX_CODEC_WRITE);
+		VORTEX_CODEC_WRITE |
+		(codec->num << VORTEX_CODEC_ID_SHIFT) );
 
 	/* Flush Caches. */
 	hwread(card->mmio, VORTEX_CODEC_IO);
@@ -2554,7 +2555,8 @@ static unsigned short vortex_codec_read(
 		}
 	}
 	/* set up read address */
-	read_addr = ((addr << VORTEX_CODEC_ADDSHIFT) & VORTEX_CODEC_ADDMASK);
+	read_addr = ((addr << VORTEX_CODEC_ADDSHIFT) & VORTEX_CODEC_ADDMASK) |
+		(codec->num << VORTEX_CODEC_ID_SHIFT) ;
 	hwwrite(card->mmio, VORTEX_CODEC_IO, read_addr);
 
 	/* wait for address */

[-- Attachment #3: au88x0-modem.patch --]
[-- Type: text/plain, Size: 4764 bytes --]

Index: alsa-kernel/pci/au88x0/au8810.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au8810.h,v
retrieving revision 1.3
diff -u -p -r1.3 au8810.h
--- alsa-kernel/pci/au88x0/au8810.h	13 Apr 2004 15:26:27 -0000	1.3
+++ alsa-kernel/pci/au88x0/au8810.h	12 Sep 2005 23:35:26 -0000
@@ -171,9 +171,9 @@
 #define VORTEX_CODEC_CTRL	0x29184
 #define VORTEX_CODEC_EN		0x29190
 #define		EN_CODEC0	0x00000300
-#define 	EN_AC98		0x00000c00 /* Modem AC98 slots. */
+#define 	EN_MODEM	0x00000c00 /* Modem AC98 slots. */
 #define		EN_CODEC1	0x00003000
-#define		EN_CODEC	(EN_CODEC0 | EN_CODEC1)
+#define		EN_CODEC	(EN_CODEC0 | EN_MODEM | EN_CODEC1)
 #define		EN_SPORT	0x00030000
 #define		EN_SPDIF	0x000c0000
 
Index: alsa-kernel/pci/au88x0/au8820.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au8820.h,v
retrieving revision 1.3
diff -u -p -r1.3 au8820.h
--- alsa-kernel/pci/au88x0/au8820.h	13 Apr 2004 15:26:27 -0000	1.3
+++ alsa-kernel/pci/au88x0/au8820.h	12 Sep 2005 23:35:26 -0000
@@ -158,7 +158,10 @@
 /* CODEC */
 #define VORTEX_CODEC_CTRL 0x11984
 #define VORTEX_CODEC_EN 0x11990
-#define		EN_CODEC	0x00000300
+#define		EN_CODEC0	0x00000300
+#define		EN_MODEM	0x00000c00
+#define		EN_CODEC1	0x00003000
+#define		EN_CODEC	(EN_CODEC0|EN_MODEM|EN_CODEC1)
 #define		EN_SPORT	0x00030000
 #define		EN_SPDIF	0x000c0000
 #define VORTEX_CODEC_CHN 0x11880
Index: alsa-kernel/pci/au88x0/au8830.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au8830.h,v
retrieving revision 1.3
diff -u -p -r1.3 au8830.h
--- alsa-kernel/pci/au88x0/au8830.h	13 Apr 2004 15:26:27 -0000	1.3
+++ alsa-kernel/pci/au88x0/au8830.h	12 Sep 2005 23:35:27 -0000
@@ -203,12 +203,12 @@
 #define VORTEX_CODEC_SPORTCTRL 0x2918c
 
 #define VORTEX_CODEC_EN 0x29190
-#define		EN_AUDIO0		0x00000300
+#define		EN_CODEC0		0x00000300
 #define		EN_MODEM		0x00000c00
-#define		EN_AUDIO1		0x00003000
+#define		EN_CODEC1		0x00003000
 #define		EN_SPORT		0x00030000
 #define		EN_SPDIF		0x000c0000
-#define		EN_CODEC		(EN_AUDIO1 | EN_AUDIO0)
+#define		EN_CODEC		(EN_CODEC0|EN_MODEM|EN_CODEC1)
 
 #define VORTEX_SPDIF_SMPRATE	0x29194
 
Index: alsa-kernel/pci/au88x0/au88x0.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au88x0.h,v
retrieving revision 1.11
diff -u -p -r1.11 au88x0.h
--- alsa-kernel/pci/au88x0/au88x0.h	22 Mar 2005 08:50:55 -0000	1.11
+++ alsa-kernel/pci/au88x0/au88x0.h	12 Sep 2005 23:35:27 -0000
@@ -135,7 +135,8 @@ struct snd_vortex {
 	snd_pcm_t *pcm[VORTEX_PCM_LAST];
 
 	snd_rawmidi_t *rmidi;	/* Legacy Midi interface. */
-	ac97_t *codec;
+	unsigned int num_of_codecs;
+	ac97_t *codecs[2];
 
 	/* Stream structs. */
 	stream_t dma_adb[NR_ADB];
Index: alsa-kernel/pci/au88x0/au88x0_core.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au88x0_core.c,v
retrieving revision 1.11
diff -u -p -r1.11 au88x0_core.c
--- alsa-kernel/pci/au88x0/au88x0_core.c	23 Feb 2005 11:00:31 -0000	1.11
+++ alsa-kernel/pci/au88x0/au88x0_core.c	12 Sep 2005 23:35:33 -0000
@@ -2511,6 +2511,11 @@ static void vortex_codec_init(vortex_t *
 	/* Enable codec channels 0 and 1. */
 	hwwrite(vortex->mmio, VORTEX_CODEC_EN,
 		hwread(vortex->mmio, VORTEX_CODEC_EN) | EN_CODEC);
+	vortex->num_of_codecs = 1;
+	/* nothing know about that */
+	msleep(2);
+	if (hwread(vortex->mmio, VORTEX_CODEC_EN)&(EN_CODEC1|EN_MODEM))
+		vortex->num_of_codecs = 2;
 }
 
 static void
Index: alsa-kernel/pci/au88x0/au88x0_mixer.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/au88x0/au88x0_mixer.c,v
retrieving revision 1.5
diff -u -p -r1.5 au88x0_mixer.c
--- alsa-kernel/pci/au88x0/au88x0_mixer.c	23 Mar 2005 17:04:16 -0000	1.5
+++ alsa-kernel/pci/au88x0/au88x0_mixer.c	12 Sep 2005 23:35:33 -0000
@@ -15,7 +15,7 @@ static int __devinit snd_vortex_mixer(vo
 {
 	ac97_bus_t *pbus;
 	ac97_template_t ac97;
-	int err;
+	int i, err;
 	static ac97_bus_ops_t ops = {
 		.write = vortex_codec_write,
 		.read = vortex_codec_read,
@@ -27,7 +27,10 @@ static int __devinit snd_vortex_mixer(vo
 	// Intialize AC97 codec stuff.
 	ac97.private_data = vortex;
 	ac97.scaps = AC97_SCAP_NO_SPDIF;
-	err = snd_ac97_mixer(pbus, &ac97, &vortex->codec);
-	vortex->isquad = ((vortex->codec == NULL) ?  0 : (vortex->codec->ext_id&0x80));
+	for (i = 0 ; i < vortex->num_of_codecs ; i++) {
+		ac97.num = i;
+		err = snd_ac97_mixer(pbus, &ac97, &vortex->codecs[i]);
+	}
+	vortex->isquad = ((vortex->codecs[0] == NULL) ?  0 : (vortex->codecs[0]->ext_id&0x80));
 	return err;
 }

  reply	other threads:[~2005-09-16 18:47 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-05 17:48 Mo' better modem support Takashi Iwai
2005-09-05 23:29 ` Sasha Khapyorsky
2005-09-06 13:29   ` Takashi Iwai
2005-09-07 16:03     ` Sasha Khapyorsky
2005-09-11 16:36       ` [alsa-lib patch] src/pcm/pcm_hooks.c : fix segfault then hooks list is empty Sasha Khapyorsky
2005-09-12 10:37         ` Takashi Iwai
2005-09-12  0:27       ` [conf patch] modem's pcm "two device" config [was: Re: Mo' better modem support] Sasha Khapyorsky
2005-09-12 10:38         ` Takashi Iwai
2005-09-12 17:49           ` Takashi Iwai
2005-09-12 22:10             ` Sasha Khapyorsky
2005-09-13  9:34               ` Takashi Iwai
2005-09-13 14:35                 ` Sasha Khapyorsky
2005-09-13 12:43                   ` Takashi Iwai
2005-09-13 15:36                     ` Sasha Khapyorsky
2005-09-13 17:27                       ` Sasha Khapyorsky
2005-09-13  0:45             ` [patch] no templated index for mc97 controls Sasha Khapyorsky
2005-09-13  1:06               ` [patch] no templated index for si3036 modem controls Sasha Khapyorsky
2005-09-13 10:24               ` [patch] no templated index for mc97 controls Takashi Iwai
2005-09-12 17:05       ` [conf patch] modem config for HDA-Intel Sasha Khapyorsky
2005-09-12 15:08         ` Takashi Iwai
2005-09-13  0:18       ` [patch] "empty" generic mfg-only codec Sasha Khapyorsky
2005-09-13 10:26         ` Takashi Iwai
2005-09-06  8:37 ` Mo' better modem support Raymond
2005-09-06 14:29   ` Sasha Khapyorsky
2005-09-06 13:19     ` Raymond
2005-09-06 20:43       ` Sasha Khapyorsky
2005-09-07  0:42     ` Raymond
2005-09-07  6:44       ` Philipp Matthias Hahn
2005-09-07 10:05         ` Raymond
2005-09-07 13:15           ` Philipp Matthias Hahn
2005-09-07 17:16             ` Sasha Khapyorsky
2005-09-08 16:10               ` Raymond
2005-09-07 16:10           ` Sasha Khapyorsky
2005-09-09 15:36             ` Raymond
2005-09-10 14:49               ` Sasha Khapyorsky
2005-09-07 16:33         ` Sasha Khapyorsky
2005-09-09 16:17         ` Raymond
2005-09-11 12:45           ` Philipp Matthias Hahn
2005-09-12 16:36             ` Raymond
2005-09-13  0:09               ` au88x0 modem [was: Re: Mo' better modem support] Sasha Khapyorsky
2005-09-13  8:55                 ` Philipp Matthias Hahn
2005-09-13 17:35                   ` Re: au88x0 modem Sasha Khapyorsky
2005-09-13 17:49                     ` Philipp Matthias Hahn
2005-09-13 21:44                       ` Sasha Khapyorsky
2005-09-14  7:02                         ` Philipp Matthias Hahn
2005-09-14  9:47                           ` [Openvortex-dev] " Maarten Vanraes
2005-09-14 12:47                             ` Raymond
2005-09-14 21:03                             ` Sasha Khapyorsky
2005-09-15  7:25                               ` Philipp Matthias Hahn
2005-09-14  8:06                       ` Raymond
2005-09-14 20:56                         ` Sasha Khapyorsky
2005-09-15  9:11                           ` Philipp Matthias Hahn
2005-09-15  9:21                             ` Philipp Matthias Hahn
2005-09-15 11:10                               ` Raymond
2005-09-15 14:35                               ` Sasha Khapyorsky
2005-09-15 15:34                                 ` Raymond
2005-09-15 21:25                                   ` Alien
2005-09-16  2:17                                     ` Raymond
2005-09-16  2:26                                       ` Lee Revell
2005-09-16 18:05                                   ` Sasha Khapyorsky
2005-09-15 20:43                                 ` Sasha Khapyorsky
2005-09-16  4:33                                   ` Raymond
2005-09-16  7:53                                     ` Philipp Matthias Hahn
2005-09-16  9:24                                       ` Raymond
2005-09-16  8:21                                   ` Raymond
2005-09-16 18:20                                     ` Sasha Khapyorsky
2005-09-16  8:46                                   ` Philipp Matthias Hahn
2005-09-16  8:55                                     ` Raymond
2005-09-16 10:36                                       ` Philipp Matthias Hahn
2005-09-16 12:04                                         ` Raymond
2005-09-16 14:42                                           ` Philipp Matthias Hahn
2005-09-16 14:49                                             ` Philipp Matthias Hahn
2005-09-16 18:47                                               ` Sasha Khapyorsky [this message]
2005-09-16 18:25                                     ` Sasha Khapyorsky
2005-09-19 15:00                                       ` Philipp Matthias Hahn
2005-09-19 15:32                                         ` Raymond
2005-09-20 13:21                                           ` Philipp Matthias Hahn
2005-09-21 22:12                                             ` Sasha Khapyorsky
2005-09-21 22:03                                         ` Sasha Khapyorsky
2005-09-22  6:24                                           ` Philipp Matthias Hahn
2005-09-22 20:19                                             ` Sasha Khapyorsky
2005-09-16 14:09                                   ` Raymond
2005-09-16 21:34                                     ` Manuel Jander
2005-09-17  3:52                                       ` Raymond
2005-09-13  9:12                 ` au88x0 modem [was: Re: Mo' better modem support] Raymond
2005-09-13 18:40                   ` au88x0 modem Sasha Khapyorsky
2005-09-14 18:07                   ` au88x0 modem [was: Re: Mo' better modem support] Philipp Matthias Hahn
2005-09-13  9:22               ` Mo' better modem support Philipp Matthias Hahn

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=20050916184708.GF17864@tecr \
    --to=sashak@smlink.com \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=pmhahn@titan.lahn.de \
    --cc=rayau@netvigator.com \
    /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