summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2004-04-23 09:26:16 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2004-04-23 09:26:16 +0000
commitf19073006800a4d7673fc08593e8bcf7c277d5b8 (patch)
tree69db3bca13617c4bed8fe86611e85caf13377a1e /sys
parent14632e662989c71f0801fda8ae923584eb92c587 (diff)
properly id CX20468 and patch it too, also one more _cx codec; made possible by fries@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/ac97.c20
-rw-r--r--sys/dev/ic/ac97.h30
2 files changed, 35 insertions, 15 deletions
diff --git a/sys/dev/ic/ac97.c b/sys/dev/ic/ac97.c
index 91decdeb84c..9c92220ef27 100644
--- a/sys/dev/ic/ac97.c
+++ b/sys/dev/ic/ac97.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ac97.c,v 1.41 2004/02/27 17:37:56 deraadt Exp $ */
+/* $OpenBSD: ac97.c,v 1.42 2004/04/23 09:26:15 mickey Exp $ */
/*
* Copyright (c) 1999, 2000 Constantine Sapuntzakis
@@ -294,7 +294,8 @@ int ac97_get_portnum_by_name(struct ac97_codec_if *, char *, char *,
char *);
void ac97_restore_shadow(struct ac97_codec_if *self);
-static void ac97_ad198x_init(struct ac97_softc *);
+void ac97_ad198x_init(struct ac97_softc *);
+void ac97_cx20468_init(struct ac97_softc *);
struct ac97_codec_if_vtbl ac97civ = {
ac97_mixer_get_port,
@@ -349,7 +350,8 @@ const struct ac97_codecid {
{ 0x50, 0xf8, 7, 0, "CS4205" },
{ 0x60, 0xf8, 7, 0, "CS4291" },
}, ac97_cx[] = {
- { 0x29, 0xff, 0, 0, "CX20468" },
+ { 0x21, 0xff, 0, 0, "HSD11246" },
+ { 0x28, 0xf8, 7, 0, "CX20468", ac97_cx20468_init },
}, ac97_em[] = {
{ 0x23, 0xff, 0, 0, "EM28023" },
{ 0x28, 0xff, 0, 0, "EM28028" },
@@ -1058,7 +1060,7 @@ ac97_set_rate(codec_if, p, mode)
* Codec-dependent initialization
*/
-static void
+void
ac97_ad198x_init(struct ac97_softc *as)
{
unsigned short misc;
@@ -1067,3 +1069,13 @@ ac97_ad198x_init(struct ac97_softc *as)
ac97_write(as, AC97_AD_REG_MISC,
misc|AC97_AD_MISC_DAM|AC97_AD_MISC_MADPD);
}
+
+void
+ac97_cx20468_init(struct ac97_softc *as)
+{
+ unsigned short misc;
+
+ ac97_read(as, AC97_CX_REG_MISC, &misc);
+ ac97_write(as, AC97_CX_REG_MISC,
+ AC97_CX_SPDIFEN | AC97_CX_COPYRIGHT | AC97_CX_MASK);
+}
diff --git a/sys/dev/ic/ac97.h b/sys/dev/ic/ac97.h
index a2e88960b62..59d5f922e10 100644
--- a/sys/dev/ic/ac97.h
+++ b/sys/dev/ic/ac97.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ac97.h,v 1.15 2003/07/15 13:20:31 couderc Exp $ */
+/* $OpenBSD: ac97.h,v 1.16 2004/04/23 09:26:15 mickey Exp $ */
/*
* Copyright (c) 1999 Constantine Sapuntzakis
@@ -154,13 +154,21 @@ int ac97_set_rate(struct ac97_codec_if *, struct audio_params *, int);
#define AC97_VENDOR_ID_MASK 0xffffff00
/* Analog Devices codec specific data */
-#define AC97_AD_REG_MISC 0x76
-#define AC97_AD_MISC_MBG 0x0001 /* 0 */
-#define AC97_AD_MISC_VREFD 0x0002 /* 1 */
-#define AC97_AD_MISC_VREFH 0x0004 /* 2 */
-#define AC97_AD_MISC_MADST 0x0008 /* 3 */
-#define AC97_AD_MISC_MADPD 0x0020 /* 5 */
-#define AC97_AD_MISC_FMXE 0x0100 /* 8 */
-#define AC97_AD_MISC_DAM 0x0400 /*10 */
-#define AC97_AD_MISC_MSPLT 0x1000 /*12 */
-#define AC97_AD_MISC_DACZ 0x4000 /*14 */
+#define AC97_AD_REG_MISC 0x76
+#define AC97_AD_MISC_MBG 0x0001 /* 0 */
+#define AC97_AD_MISC_VREFD 0x0002 /* 1 */
+#define AC97_AD_MISC_VREFH 0x0004 /* 2 */
+#define AC97_AD_MISC_MADST 0x0008 /* 3 */
+#define AC97_AD_MISC_MADPD 0x0020 /* 5 */
+#define AC97_AD_MISC_FMXE 0x0100 /* 8 */
+#define AC97_AD_MISC_DAM 0x0400 /*10 */
+#define AC97_AD_MISC_MSPLT 0x1000 /*12 */
+#define AC97_AD_MISC_DACZ 0x4000 /*14 */
+
+/* Conexant codec specific data */
+#define AC97_CX_REG_MISC 0x5c
+#define AC97_CX_PCM 0x00
+#define AC97_CX_AC3 0x02
+#define AC97_CX_MASK 0x03
+#define AC97_CX_COPYRIGHT 0x04
+#define AC97_CX_SPDIFEN 0x08