On 16:06 Wed 14 Sep , Raymond wrote:
>
> #define VORTEX_CODEC_WRITE 0x00800000
> #define VORTEX_CODEC_ADDSHIFT 16
>
> (0x80* 1) << VORTEX_CODEC_ADDSHIFT) is equal to VORTEX_CODEC_WRITE
Oh, yes. It was bad approach. Let's look similar scheme with vi82xx
(via82xx.c, via82xx_modem.c):
/* AC'97 */
#define VIA_REG_AC97 0x80 /* dword */
#define VIA_REG_AC97_CODEC_ID_MASK (3<<30)
#define VIA_REG_AC97_CODEC_ID_SHIFT 30
#define VIA_REG_AC97_CODEC_ID_PRIMARY 0x00
#define VIA_REG_AC97_CODEC_ID_SECONDARY 0x01
#define VIA_REG_AC97_SECONDARY_VALID (1<<27)
#define VIA_REG_AC97_PRIMARY_VALID (1<<25)
#define VIA_REG_AC97_BUSY (1<<24)
#define VIA_REG_AC97_READ (1<<23)
#define VIA_REG_AC97_CMD_SHIFT 16
#define VIA_REG_AC97_CMD_MASK 0x7e
#define VIA_REG_AC97_DATA_SHIFT 0
#define VIA_REG_AC97_DATA_MASK 0xffff
Codec id is addressed by bits 30,31. Of course this should not be same
with au8810, but let's check. The patch is attached.
Philipp, you could play with VORTEX_CODEC_ID_SHIFT value (au88x0,h) in
range 24-31.
> May be au8810 use different set of MMIO to read/write and report
> status of the audio codec and modem codec ?
It is possible of course but we cannot know which one in easy way
(without reverse engineering of win drivers).
> au8810.h
>
> #define VORTEX_MODEM_CTRL 0x291ac
I don't understand meaning of this, but there is set of similar ones
(CODEC_CTRL) and it is used for initializations.
BTW it is very possible that we should change initialization procedure
(and probably use MODEM_CTRL somehow), but again, it is hard to know
(without reverse engineering).
> Make sure you have a BACKUP of all your data before you peform testing
> on the modem.
Dear testers, it is good idea.
Sasha.
diff -rpu au88x0_orig/au88x0.h au88x0/au88x0.h
--- au88x0_orig/au88x0.h 2005-09-14 20:52:57.000000000 +0300
+++ au88x0/au88x0.h 2005-09-14 20:54:47.000000000 +0300
@@ -79,6 +79,9 @@
#define VORTEX_RESOURCE_A3D 0x00000004
#define VORTEX_RESOURCE_LAST 0x00000005
+/* codec io related */
+#define VORTEX_CODEC_ID_SHIFT 30 /* unknown: may be 24-31 (or irrelevat) */
+
/* 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)
diff -rpu au88x0_orig/au88x0_core.c au88x0/au88x0_core.c
--- au88x0_orig/au88x0_core.c 2005-09-13 20:00:50.000000000 +0300
+++ au88x0/au88x0_core.c 2005-09-14 20:51:03.000000000 +0300
@@ -2537,7 +2537,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);
@@ -2559,7 +2560,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 */
_______________________________________________
Openvortex-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/openvortex-dev