diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/ac97.c | 19 | ||||
-rw-r--r-- | sys/dev/ic/ac97.h | 3 |
2 files changed, 20 insertions, 2 deletions
diff --git a/sys/dev/ic/ac97.c b/sys/dev/ic/ac97.c index b3633da355f..dfb165e3ee3 100644 --- a/sys/dev/ic/ac97.c +++ b/sys/dev/ic/ac97.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ac97.c,v 1.67 2008/02/12 13:02:21 jakemsr Exp $ */ +/* $OpenBSD: ac97.c,v 1.68 2008/05/25 23:52:30 jakemsr Exp $ */ /* * Copyright (c) 1999, 2000 Constantine Sapuntzakis @@ -70,6 +70,17 @@ #include <dev/audio_if.h> #include <dev/ic/ac97.h> + +/* default parameters; supported by all ac97 codecs */ +const struct audio_params ac97_audio_default = { + 48000, /* sample_rate */ + AUDIO_ENCODING_SLINEAR_LE, /* encoding */ + 16, /* precision */ + 2, /* channels */ + NULL, /* sw_code */ + 1 /* factor */ +}; + const struct audio_mixer_enum ac97_on_off = { 2, { { { AudioNoff } , 0 }, @@ -583,6 +594,12 @@ int ac97debug = 0; #define DPRINTFN(n,x) #endif +void +ac97_get_default_params(struct audio_params *params) +{ + *params = ac97_audio_default; +} + int ac97_read(struct ac97_softc *as, u_int8_t reg, u_int16_t *val) { diff --git a/sys/dev/ic/ac97.h b/sys/dev/ic/ac97.h index a84da43c469..3439aa64058 100644 --- a/sys/dev/ic/ac97.h +++ b/sys/dev/ic/ac97.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ac97.h,v 1.21 2008/02/12 13:02:21 jakemsr Exp $ */ +/* $OpenBSD: ac97.h,v 1.22 2008/05/25 23:52:30 jakemsr Exp $ */ /* * Copyright (c) 1999 Constantine Sapuntzakis @@ -81,6 +81,7 @@ struct ac97_codec_if { int ac97_attach(struct ac97_host_if *); int ac97_set_rate(struct ac97_codec_if *, int, u_long *); +void ac97_get_default_params(struct audio_params *); #define AC97_REG_RESET 0x00 #define AC97_CAPS_MICIN 0x0001 |