aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/au88x0
diff options
context:
space:
mode:
authorSasha Khapyorsky <sashak@smlink.com>2005-09-16 13:22:44 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:16:24 -0500
commitf2b31737e509a70952421e7cca488a2001a3b087 (patch)
treec88cb1ccde453ffc64ec13b295c04e8c37831ce9 /sound/pci/au88x0
parent21be3d162651f11e422275aad62a4bb06292ef4f (diff)
[ALSA] au88x0: codec access procs for multiple AC97 codecs
Modules: au88x0 driver This patch extends au88x0 AC97 codec access procedures to handle multiple codecs properly. Signed-off-by: Sasha Khapyorsky <sashak@smlink.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/au88x0')
-rw-r--r--sound/pci/au88x0/au8810.h5
-rw-r--r--sound/pci/au88x0/au8820.h5
-rw-r--r--sound/pci/au88x0/au8830.h5
-rw-r--r--sound/pci/au88x0/au88x0.h8
-rw-r--r--sound/pci/au88x0/au88x0_core.c6
5 files changed, 12 insertions, 17 deletions
diff --git a/sound/pci/au88x0/au8810.h b/sound/pci/au88x0/au8810.h
index 3837d2ba5e67..5d69c31fe3f4 100644
--- a/sound/pci/au88x0/au8810.h
+++ b/sound/pci/au88x0/au8810.h
@@ -178,11 +178,6 @@
178#define EN_SPDIF 0x000c0000 178#define EN_SPDIF 0x000c0000
179 179
180#define VORTEX_CODEC_CHN 0x29080 180#define VORTEX_CODEC_CHN 0x29080
181#define VORTEX_CODEC_WRITE 0x00800000
182#define VORTEX_CODEC_ADDSHIFT 16
183#define VORTEX_CODEC_ADDMASK 0x7f0000 /* 0x000f0000 */
184#define VORTEX_CODEC_DATSHIFT 0
185#define VORTEX_CODEC_DATMASK 0xffff
186#define VORTEX_CODEC_IO 0x29188 181#define VORTEX_CODEC_IO 0x29188
187 182
188/* SPDIF */ 183/* SPDIF */
diff --git a/sound/pci/au88x0/au8820.h b/sound/pci/au88x0/au8820.h
index be8022e78714..abbe85e4f7a9 100644
--- a/sound/pci/au88x0/au8820.h
+++ b/sound/pci/au88x0/au8820.h
@@ -162,11 +162,6 @@
162#define EN_SPORT 0x00030000 162#define EN_SPORT 0x00030000
163#define EN_SPDIF 0x000c0000 163#define EN_SPDIF 0x000c0000
164#define VORTEX_CODEC_CHN 0x11880 164#define VORTEX_CODEC_CHN 0x11880
165#define VORTEX_CODEC_WRITE 0x00800000
166#define VORTEX_CODEC_ADDSHIFT 16
167#define VORTEX_CODEC_ADDMASK 0x7f0000 /* 0x000f0000 */
168#define VORTEX_CODEC_DATSHIFT 0
169#define VORTEX_CODEC_DATMASK 0xffff
170#define VORTEX_CODEC_IO 0x11988 165#define VORTEX_CODEC_IO 0x11988
171 166
172#define VORTEX_SPDIF_FLAGS 0x1005c /* FIXME */ 167#define VORTEX_SPDIF_FLAGS 0x1005c /* FIXME */
diff --git a/sound/pci/au88x0/au8830.h b/sound/pci/au88x0/au8830.h
index aa77826b5e59..04ece1b1c218 100644
--- a/sound/pci/au88x0/au8830.h
+++ b/sound/pci/au88x0/au8830.h
@@ -194,11 +194,6 @@
194 194
195#define VORTEX_CODEC_CTRL 0x29184 195#define VORTEX_CODEC_CTRL 0x29184
196#define VORTEX_CODEC_IO 0x29188 196#define VORTEX_CODEC_IO 0x29188
197#define VORTEX_CODEC_WRITE 0x00800000
198#define VORTEX_CODEC_ADDSHIFT 16
199#define VORTEX_CODEC_ADDMASK 0x7f0000 /* 0x000f0000 */
200#define VORTEX_CODEC_DATSHIFT 0
201#define VORTEX_CODEC_DATMASK 0xffff
202 197
203#define VORTEX_CODEC_SPORTCTRL 0x2918c 198#define VORTEX_CODEC_SPORTCTRL 0x2918c
204 199
diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
index ee1ede1979f6..b1197cfab3fb 100644
--- a/sound/pci/au88x0/au88x0.h
+++ b/sound/pci/au88x0/au88x0.h
@@ -79,6 +79,14 @@
79#define VORTEX_RESOURCE_A3D 0x00000004 79#define VORTEX_RESOURCE_A3D 0x00000004
80#define VORTEX_RESOURCE_LAST 0x00000005 80#define VORTEX_RESOURCE_LAST 0x00000005
81 81
82/* codec io: VORTEX_CODEC_IO bits */
83#define VORTEX_CODEC_ID_SHIFT 24
84#define VORTEX_CODEC_WRITE 0x00800000
85#define VORTEX_CODEC_ADDSHIFT 16
86#define VORTEX_CODEC_ADDMASK 0x7f0000
87#define VORTEX_CODEC_DATSHIFT 0
88#define VORTEX_CODEC_DATMASK 0xffff
89
82/* Check for SDAC bit in "Extended audio ID" AC97 register */ 90/* Check for SDAC bit in "Extended audio ID" AC97 register */
83//#define VORTEX_IS_QUAD(x) (((x)->codec == NULL) ? 0 : ((x)->codec->ext_id&0x80)) 91//#define VORTEX_IS_QUAD(x) (((x)->codec == NULL) ? 0 : ((x)->codec->ext_id&0x80))
84#define VORTEX_IS_QUAD(x) ((x)->isquad) 92#define VORTEX_IS_QUAD(x) ((x)->isquad)
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index f0eda4bbbb39..91ac4f3a2aac 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -2532,7 +2532,8 @@ vortex_codec_write(ac97_t * codec, unsigned short addr, unsigned short data)
2532 hwwrite(card->mmio, VORTEX_CODEC_IO, 2532 hwwrite(card->mmio, VORTEX_CODEC_IO,
2533 ((addr << VORTEX_CODEC_ADDSHIFT) & VORTEX_CODEC_ADDMASK) | 2533 ((addr << VORTEX_CODEC_ADDSHIFT) & VORTEX_CODEC_ADDMASK) |
2534 ((data << VORTEX_CODEC_DATSHIFT) & VORTEX_CODEC_DATMASK) | 2534 ((data << VORTEX_CODEC_DATSHIFT) & VORTEX_CODEC_DATMASK) |
2535 VORTEX_CODEC_WRITE); 2535 VORTEX_CODEC_WRITE |
2536 (codec->num << VORTEX_CODEC_ID_SHIFT) );
2536 2537
2537 /* Flush Caches. */ 2538 /* Flush Caches. */
2538 hwread(card->mmio, VORTEX_CODEC_IO); 2539 hwread(card->mmio, VORTEX_CODEC_IO);
@@ -2554,7 +2555,8 @@ static unsigned short vortex_codec_read(ac97_t * codec, unsigned short addr)
2554 } 2555 }
2555 } 2556 }
2556 /* set up read address */ 2557 /* set up read address */
2557 read_addr = ((addr << VORTEX_CODEC_ADDSHIFT) & VORTEX_CODEC_ADDMASK); 2558 read_addr = ((addr << VORTEX_CODEC_ADDSHIFT) & VORTEX_CODEC_ADDMASK) |
2559 (codec->num << VORTEX_CODEC_ID_SHIFT) ;
2558 hwwrite(card->mmio, VORTEX_CODEC_IO, read_addr); 2560 hwwrite(card->mmio, VORTEX_CODEC_IO, read_addr);
2559 2561
2560 /* wait for address */ 2562 /* wait for address */