summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2010-06-30 11:21:36 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2010-06-30 11:21:36 +0000
commit354b72ae8848105451e9de163a5c12befc4c0473 (patch)
tree3ce01f344d5b44cfc401abe020be782626d3996d /sys/dev/ic
parent63d82744c6312e762b7aac113868c98c05b105c1 (diff)
* use audio(9)'s DMA trigger methods instead of the init/start
methods. the AD1848 DMA engine runs continuously and doesn't need to be started/stopped or otherwise manipulated for each block. makes the driver a bit more efficient. * allow "Mode 2" capable chips such as the CS4231 to work in "Mode 1" when there is only one DMA channel, instead of forcing it into "Mode 2", which expects two DMA channels. allows recording to work for "Mode 2" capable devices when there is only one DMA channel. * service both playback and recording interrupts in full-duplex mode, instead of only playback interrupts. allows "Mode 2" capable chips to work in full-duplex mode. * fix checks for sample rate/format recalibration completion. gets rid of busy loops that briefly "hang" the kernel when the device is opened and/or reconfigured.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/cs4231reg.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/sys/dev/ic/cs4231reg.h b/sys/dev/ic/cs4231reg.h
index dfb3e848a08..e66c79bcb39 100644
--- a/sys/dev/ic/cs4231reg.h
+++ b/sys/dev/ic/cs4231reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cs4231reg.h,v 1.6 2008/06/26 05:42:15 ray Exp $ */
+/* $OpenBSD: cs4231reg.h,v 1.7 2010/06/30 11:21:35 jakemsr Exp $ */
/* $NetBSD: cs4231reg.h,v 1.4 1996/02/16 08:12:33 mycroft Exp $ */
/*-
@@ -77,26 +77,32 @@
#define CS_ALT_FEATURE2 0x11
#define CS_LEFT_LINE_CONTROL 0x12
#define CS_RIGHT_LINE_CONTROL 0x13
+#define LINE_INPUT_ATTEN_BITS 0x1f
+#define LINE_INPUT_ATTEN_MASK 0xe0
+#define LINE_INPUT_MUTE 0x80
+#define LINE_INPUT_MUTE_MASK 0x7f
#define CS_TIMER_LOW 0x14
#define CS_TIMER_HIGH 0x15
#define CS_UPPER_FREQUENCY_SEL 0x16
#define CS_LOWER_FREQUENCY_SEL 0x17
#define CS_IRQ_STATUS 0x18
+#define CS_IRQ_PU 0x01 /* Playback Underrun */
+#define CS_IRQ_PO 0x02 /* Playback Overrun */
+#define CS_IRQ_CO 0x04 /* Capture Overrrun */
+#define CS_IRQ_CU 0x08 /* Capture Underrun */
+#define CS_IRQ_PI 0x10 /* Playback Interrupt */
+#define CS_IRQ_CI 0x20 /* Capture Interrupt */
+#define CS_IRQ_TI 0x40 /* Timer Interrupt */
+#define CS_IRQ_RES 0x80 /* reserved */
#define CS_VERSION_ID 0x19
#define CS_MONO_IO_CONTROL 0x1A
+#define MONO_INPUT_ATTEN_BITS 0x0f
+#define MONO_INPUT_ATTEN_MASK 0xf0
+#define MONO_OUTPUT_MUTE 0x40
+#define MONO_INPUT_MUTE 0x80
+#define MONO_INPUT_MUTE_MASK 0x7f
#define CS_POWERDOWN_CONTROL 0x1B
#define CS_REC_FORMAT 0x1C
#define CS_XTAL_SELECT 0x1D
#define CS_UPPER_REC_CNT 0x1E
#define CS_LOWER_REC_CNT 0x1F
-
-#define MONO_INPUT_ATTEN_BITS 0x0f
-#define MONO_INPUT_ATTEN_MASK 0xf0
-#define MONO_OUTPUT_MUTE 0x40
-#define MONO_INPUT_MUTE 0x80
-#define MONO_INPUT_MUTE_MASK 0x7f
-
-#define LINE_INPUT_ATTEN_BITS 0x1f
-#define LINE_INPUT_ATTEN_MASK 0xe0
-#define LINE_INPUT_MUTE 0x80
-#define LINE_INPUT_MUTE_MASK 0x7f