summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorgarbled <garbled@NetBSD.org>2008-04-28 18:49:27 +0000
committergarbled <garbled@NetBSD.org>2008-04-28 18:49:27 +0000
commitfcdfd014d7d68e4f56f4af41685c1a3b4443428d (patch)
treeb819e7c105e5705e00cae379ed610a30d40979fa /sys/dev
parentefdfaa4756aa6629e72968c31288455f41f4b6a7 (diff)
Minor fixes to some of these files:
Add recognition for the CS4232C revision chip. (0xa2) Make ic/ad1848.c compile with AUDIO_DEBUG Add a needed machine/bus.h include to ic/cs4231.c Add a few additional register defines to ic/cs4231reg.h
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/ad1848.c5
-rw-r--r--sys/dev/ic/cs4231.c8
-rw-r--r--sys/dev/ic/cs4231reg.h22
-rw-r--r--sys/dev/isa/ad1848_isa.c7
4 files changed, 34 insertions, 8 deletions
diff --git a/sys/dev/ic/ad1848.c b/sys/dev/ic/ad1848.c
index 46c8f5224eb..24512a927db 100644
--- a/sys/dev/ic/ad1848.c
+++ b/sys/dev/ic/ad1848.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ad1848.c,v 1.27 2007/12/11 00:21:51 martin Exp $ */
+/* $NetBSD: ad1848.c,v 1.28 2008/04/28 18:49:27 garbled Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ad1848.c,v 1.27 2007/12/11 00:21:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ad1848.c,v 1.28 2008/04/28 18:49:27 garbled Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -141,6 +141,7 @@ __KERNEL_RCSID(0, "$NetBSD: ad1848.c,v 1.27 2007/12/11 00:21:51 martin Exp $");
#ifdef AUDIO_DEBUG
#define DPRINTF(x) if (ad1848debug) printf x
int ad1848debug = 0;
+void ad1848_dump_regs(struct ad1848_softc *);
#else
#define DPRINTF(x)
#endif
diff --git a/sys/dev/ic/cs4231.c b/sys/dev/ic/cs4231.c
index 6be47af099f..bbcf5fb3000 100644
--- a/sys/dev/ic/cs4231.c
+++ b/sys/dev/ic/cs4231.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4231.c,v 1.21 2008/04/08 12:07:25 cegger Exp $ */
+/* $NetBSD: cs4231.c,v 1.22 2008/04/28 18:49:27 garbled Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1.21 2008/04/08 12:07:25 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1.22 2008/04/28 18:49:27 garbled Exp $");
#include "audio.h"
#if NAUDIO > 0
@@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: cs4231.c,v 1.21 2008/04/08 12:07:25 cegger Exp $");
#include <sys/malloc.h>
#include <machine/autoconf.h>
+#include <machine/bus.h>
#include <sys/cpu.h>
#include <sys/audioio.h>
@@ -163,6 +164,9 @@ cs4231_common_attach(struct cs4231_softc *sc, bus_space_handle_t ioh)
case 0x82:
sc->sc_ad1848.chip_name = "CS4232";
break;
+ case 0xa2:
+ sc->sc_ad1848.chip_name = "CS4232C";
+ break;
default:
if ((buf = malloc(32, M_TEMP, M_NOWAIT)) != NULL) {
snprintf(buf, 32, "unknown rev: %x/%x",
diff --git a/sys/dev/ic/cs4231reg.h b/sys/dev/ic/cs4231reg.h
index d2c35870a5b..482c0eb1358 100644
--- a/sys/dev/ic/cs4231reg.h
+++ b/sys/dev/ic/cs4231reg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4231reg.h,v 1.10 2005/12/11 12:21:26 christos Exp $ */
+/* $NetBSD: cs4231reg.h,v 1.11 2008/04/28 18:49:27 garbled Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -89,7 +89,9 @@
#define CS_VERSION_ID 25
#define CS_MONO_IO_CONTROL 26
#define CS_POWERDOWN_CONTROL 27
+#define CS_LEFT_OUT 27 /* 4232 */
#define CS_REC_FORMAT 28
+#define CS_RIGHT_OUT 29 /* 4232 */
#define CS_XTAL_SELECT 29
#define CS_UPPER_REC_CNT 30
#define CS_LOWER_REC_CNT 31
@@ -135,9 +137,13 @@
#define CS_VERSION_NUMBER 0xe0 /* Version number:
* 0x101 - 4231 rev. A
* 0x100 - 4231 previous revs
+ * 0x100 - 4232 (unreleased?)
+ * 0x101 - 4232 rev. C
*/
#define CS_VERSION_CHIPID 0x07 /* Chip Identification.
- * Currently know values: 0x000
+ * Currently know values:
+ * 0x000 - CS4231
+ * 0x010 - CS4232
*/
/* MONO_IO_CONTROL - register I26 */
@@ -149,9 +155,21 @@
#define MONO_INPUT_MUTE 0x80
#define MONO_INPUT_MUTE_MASK (~MONO_INPUT_MUTE & 0xff)
+/* CS_LEFT_OUT - register I27 */
+#define LEFT_OUT_ATTEN_BITS 0x0f
+#define LEFT_OUT_ATTEN_MASK 0xf0
+#define LEFT_OUT_MUTE 0x80
+#define LEFT_OUT_MUTE_MASK (~LEFT_OUT_MUTE & 0xff)
+
/* CS_REC_FORMAT - register I28 */
#define REC_FMT_reserved 0x0f /* reserved */
#define REC_FMT_SM 0x10 /* 0: mono, 1: stereo */
#define REC_FMT_CL 0x20 /* 0: linear, 1: companded */
#define REC_FMT_FMT0 0x40 /* See register I8 for valid */
#define REC_FMT_FMT1 0x80 /* combination of the FMT and CL bits */
+
+/* CS_RIGHT_OUT - register I27 */
+#define RIGHT_OUT_ATTEN_BITS 0x0f
+#define RIGHT_OUT_ATTEN_MASK 0xf0
+#define RIGHT_OUT_MUTE 0x80
+#define RIGHT_OUT_MUTE_MASK (~RIGHT_OUT_MUTE & 0xff)
diff --git a/sys/dev/isa/ad1848_isa.c b/sys/dev/isa/ad1848_isa.c
index 3a3f56bec22..7fcce884034 100644
--- a/sys/dev/isa/ad1848_isa.c
+++ b/sys/dev/isa/ad1848_isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ad1848_isa.c,v 1.34 2008/04/08 20:08:49 cegger Exp $ */
+/* $NetBSD: ad1848_isa.c,v 1.35 2008/04/28 18:49:27 garbled Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ad1848_isa.c,v 1.34 2008/04/08 20:08:49 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ad1848_isa.c,v 1.35 2008/04/28 18:49:27 garbled Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -364,6 +364,9 @@ ad1848_isa_probe(struct ad1848_isa_softc *isc)
case 0x82:
sc->chip_name = "CS4232";
break;
+ case 0xa2:
+ sc->chip_name = "CS4232C";
+ break;
case 0x03:
case 0x83:
sc->chip_name = "CS4236";