Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/dev/isa Pull up revisions 1.7-1.8 (via patch, reque...



details:   https://anonhg.NetBSD.org/src/rev/a9364086d05e
branches:  netbsd-1-5
changeset: 493007:a9364086d05e
user:      he <he%NetBSD.org@localhost>
date:      Wed Mar 27 10:18:30 2002 +0000

description:
Pull up revisions 1.7-1.8 (via patch, requested by itohy):
  Several changes to wss-compatible audio devices:
   o Fix ADPCM playback/recording
   o Add explicit support for OPL3-SA2 (YMF711), fixes PR#14819
   o Add AD1845 support
   o other minor bugfixes and cleanups

diffstat:

 sys/dev/isa/ymvar.h |  77 ++++++++++++++++++++++++++++------------------------
 1 files changed, 42 insertions(+), 35 deletions(-)

diffs (133 lines):

diff -r d4cda8c13ba8 -r a9364086d05e sys/dev/isa/ymvar.h
--- a/sys/dev/isa/ymvar.h       Wed Mar 27 10:18:04 2002 +0000
+++ b/sys/dev/isa/ymvar.h       Wed Mar 27 10:18:30 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: ymvar.h,v 1.6 2000/03/23 07:01:36 thorpej Exp $        */
+/*     $NetBSD: ymvar.h,v 1.6.4.1 2002/03/27 10:18:30 he Exp $ */
 
 /*-
- * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2000, 2002 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -80,54 +80,58 @@
 /*
  * Mixer devices
  */
-#define YM_DAC_LVL             0
-#define YM_MIDI_LVL            1
-#define YM_CD_LVL              2
-#define YM_LINE_LVL            3
-#define YM_SPEAKER_LVL         4
-#define YM_MIC_LVL             5
-#define YM_MONITOR_LVL         6
-#define YM_DAC_MUTE            7
-#define YM_MIDI_MUTE           8
-#define YM_CD_MUTE             9
-#define YM_LINE_MUTE           10
-#define YM_SPEAKER_MUTE                11
-#define YM_MIC_MUTE            12
-#define YM_MONITOR_MUTE                13
+#define YM_DAC_LVL             0       /* inputs.dac */
+#define YM_MIDI_LVL            1       /* inputs.midi */
+#define YM_CD_LVL              2       /* inputs.cd */
+#define YM_LINE_LVL            3       /* inputs.line */
+#define YM_SPEAKER_LVL         4       /* inputs.speaker */
+#define YM_MIC_LVL             5       /* inputs.mic */
+#define YM_MONITOR_LVL         6       /* monitor.monitor */
+#define YM_DAC_MUTE            7       /* inputs.dac.mute */
+#define YM_MIDI_MUTE           8       /* inputs.midi.mute */
+#define YM_CD_MUTE             9       /* inputs.cd.mute */
+#define YM_LINE_MUTE           10      /* inputs.line.mute */
+#define YM_SPEAKER_MUTE                11      /* inputs.speaker.mute */
+#define YM_MIC_MUTE            12      /* inputs.mic.mute */
+#define YM_MONITOR_MUTE                13      /* monitor.monitor.mute */
 
-#define YM_REC_LVL             14
-#define YM_RECORD_SOURCE       15
+#define YM_REC_LVL             14      /* record.record */
+#define YM_RECORD_SOURCE       15      /* record.record.source */
 
-#define YM_OUTPUT_LVL          16
-#define YM_OUTPUT_MUTE         17
-
-#define YM_MASTER_EQMODE       18
-#define YM_MASTER_TREBLE       19
-#define YM_MASTER_BASS         20
-#define YM_MASTER_WIDE         21
+#define YM_OUTPUT_LVL          16      /* outputs.master */
+#define YM_OUTPUT_MUTE         17      /* outputs.master.mute */
 
 #ifndef AUDIO_NO_POWER_CTL
-#define YM_PWR_MODE            22
-#define YM_PWR_TIMEOUT         23
+#define YM_PWR_MODE            18      /* power.save */
+#define YM_PWR_TIMEOUT         19      /* power.save.timeout */
 #endif
 
 /* Classes - don't change this without looking at mixer_classes array */
 #ifdef AUDIO_NO_POWER_CTL
-#define YM_CLASS_TOP           22
+#define YM_CLASS_TOP           18
 #else
-#define YM_CLASS_TOP           24
+#define YM_CLASS_TOP           20
 #endif
 #define YM_INPUT_CLASS         (YM_CLASS_TOP + 0)
 #define YM_RECORD_CLASS                (YM_CLASS_TOP + 1)
 #define YM_OUTPUT_CLASS                (YM_CLASS_TOP + 2)
 #define YM_MONITOR_CLASS       (YM_CLASS_TOP + 3)
+#ifdef AUDIO_NO_POWER_CTL
 #define YM_EQ_CLASS            (YM_CLASS_TOP + 4)
-#ifndef AUDIO_NO_POWER_CTL
-#define YM_PWR_CLASS           (YM_CLASS_TOP + 5)
+#else
+#define YM_PWR_CLASS           (YM_CLASS_TOP + 4)
+#define YM_EQ_CLASS            (YM_CLASS_TOP + 5)
 #endif
 
+/* equalizer is SA3 only */
+#define YM_MASTER_EQMODE       (YM_EQ_CLASS+1) /* equalization.mode */
+#define YM_MASTER_TREBLE       (YM_EQ_CLASS+2) /* equalization.treble */
+#define YM_MASTER_BASS         (YM_EQ_CLASS+3) /* equalization.bass */
+#define YM_MASTER_WIDE         (YM_EQ_CLASS+4) /* equalization.surround */
+
+#define YM_MIXER_SA3_ONLY(m)   ((m) >= YM_EQ_CLASS)
+
 /* XXX should be in <sys/audioio.h> */
-#define AudioNmode             "mode"
 #define AudioNdesktop          "desktop"
 #define AudioNlaptop           "laptop"
 #define AudioNsubnote          "subnote"
@@ -166,6 +170,7 @@
        u_int8_t sc_external_sources;   /* non-zero value prevents power down */
 
        u_int8_t sc_version;            /* hardware version */
+#define YM_IS_SA3(sc)  ((sc)->sc_version > SA3_MISC_VER_711)
 
        /* 3D encehamcement */
        u_int8_t sc_eqmode;
@@ -188,8 +193,9 @@
        int     sc_pow_timeout;
 
        u_int8_t sc_codec_scan[0x20];
-#define YM_SAVE_REG_MAX        SA3_HVOL_INTR_CNF
-       u_int8_t sc_sa3_scan[YM_SAVE_REG_MAX + 1];
+#define YM_SAVE_REG_MAX_SA3    SA3_HVOL_INTR_CNF
+#define YM_SAVE_REG_MAX_SA2    SA3_DMA_CNT_REC_HIGH
+       u_int8_t sc_sa3_scan[YM_SAVE_REG_MAX_SA3 + 1];
 
        u_int16_t sc_on_blocks;
        u_int16_t sc_turning_off;
@@ -226,8 +232,9 @@
 #define YM_XS_CD       1
 #define YM_XS_LINE     2
 #define YM_XS_SPEAKER  4
+#define YM_XS_MIC      8
 
-#if YM_CD_MUTE + 1 != YM_LINE_MUTE || YM_CD_MUTE + 2 != YM_SPEAKER_MUTE
+#if YM_CD_MUTE + 1 != YM_LINE_MUTE || YM_CD_MUTE + 2 != YM_SPEAKER_MUTE || YM_CD_MUTE + 3 != YM_MIC_MUTE
  #error YM_CD_MUTE, YM_LINE_MUTE and YM_SPEAKER_MUTE should be contiguous
 #endif
 #define YM_MIXER_TO_XS(m)      (1 << ((m) - YM_CD_MUTE))



Home | Main Index | Thread Index | Old Index