Subject: kern/25949: Add support for AD1888 AC97 codec
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <arto.huusko@utu.fi>
List: netbsd-bugs
Date: 06/16/2004 23:50:53
>Number: 25949
>Category: kern
>Synopsis: Patch to support AD1888 AC97 codec
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Wed Jun 16 20:51:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Arto Huusko
>Release: NetBSD 2.0E
>Organization:
>Environment:
auvia0 at pci0 dev 17 function 5: VIA Technologies VT8235 AC'97 Audio (rev 0x60)
auvia0: interrupting at ioapic0 pin 22 (irq 5)
auvia0: ac97: Analog Devices AD1888 codec; headphone, 20 bit DAC, no 3D stereo
auvia0: ac97: ext id 3c7<AMAP,LDAC,SDAC,CDAC,SPDIF,DRA,VRA>
>Description:
Add support for AD1888, which is not supported currently. This codec is
found, for example, on Asus A7V600-X.
>How-To-Repeat:
>Fix:
This patch makes AD1888 work. Note that AD1888 misc register bits are
identical to 1985, only 2MIC is missing. I also changed the datatype
of the variable that holds the register data just to be slightly more
correct.
Index: sys/dev/ic/ac97.c
===================================================================
RCS file: /cvsroot/netbsd/src/sys/dev/ic/ac97.c,v
retrieving revision 1.52
diff -r1.52 ac97.c
99c99
< static void ac97_ad198x_init(struct ac97_softc *);
---
> static void ac97_ad1x8x_init(struct ac97_softc *);
373a374,375
> { AC97_CODEC_ID('A', 'D', 'S', 0x68),
> 0xffffffff, "Analog Devices AD1888", ac97_ad1x8x_init },
375c377
< 0xffffffff, "Analog Devices AD1980", ac97_ad198x_init },
---
> 0xffffffff, "Analog Devices AD1980", ac97_ad1x8x_init },
381c383
< 0xffffffff, "Analog Devices AD1985", ac97_ad198x_init },
---
> 0xffffffff, "Analog Devices AD1985", ac97_ad1x8x_init },
1459a1462,1477
> #define AD1888_REG_MISC 0x76
> #define AD1888_MISC_MBG0 0x0001 /* 0 */
> #define AD1888_MISC_MBG1 0x0002 /* 1 */
> #define AD1888_MISC_VREFD 0x0004 /* 2 */
> #define AD1888_MISC_VREFH 0x0008 /* 3 */
> #define AD1888_MISC_SRU 0x0010 /* 4 */
> #define AD1888_MISC_LOSEL 0x0020 /* 5 */
> #define AD1888_MISC_SPRD 0x0080 /* 7 */
> #define AD1888_MISC_DMIX0 0x0100 /* 8 */
> #define AD1888_MISC_DMIX1 0x0200 /* 9 */
> #define AD1888_MISC_HPSEL 0x0400 /*10 */
> #define AD1888_MISC_CLDIS 0x0800 /*11 */
> #define AD1888_MISC_LODIS 0x1000 /*12 */
> #define AD1888_MISC_MSPLT 0x2000 /*13 */
> #define AD1888_MISC_AC97NC 0x4000 /*14 */
> #define AD1888_MISC_DACZ 0x8000 /*15 */
1488c1506
< ac97_ad198x_init(struct ac97_softc *as)
---
> ac97_ad1x8x_init(struct ac97_softc *as)
1491c1509
< unsigned short misc;
---
> u_int16_t misc;
>Release-Note:
>Audit-Trail:
>Unformatted: