mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[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>
This commit is contained in:
parent
21be3d1626
commit
f2b31737e5
5 changed files with 12 additions and 17 deletions
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -2532,7 +2532,8 @@ vortex_codec_write(ac97_t * codec, unsigned short addr, unsigned short data)
|
|||
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(ac97_t * codec, unsigned short addr)
|
|||
}
|
||||
}
|
||||
/* 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 */
|
||||
|
|
Loading…
Reference in a new issue