diff options
author | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-05-25 23:52:31 +0000 |
---|---|---|
committer | Jacob Meuser <jakemsr@cvs.openbsd.org> | 2008-05-25 23:52:31 +0000 |
commit | f0cdbe4f7744702991b761684e14a7e861e6663d (patch) | |
tree | efd61d4ecb856c93835f1b0eb19bce1020006351 /sys/dev/ic/ac97.c | |
parent | 3720c857ec04b612f2d38e4caa9af22b3ec791d5 (diff) |
add a function to get default parameters for ac97 codecs. all ac97
codecs support 16-bit stereo slinear_le @ 48kHz.
ok ratchov@
Diffstat (limited to 'sys/dev/ic/ac97.c')
-rw-r--r-- | sys/dev/ic/ac97.c | 19 |
1 files changed, 18 insertions, 1 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) { |