2012-10-27 21:17:22 +04:00
|
|
|
/* $NetBSD: ac97.c,v 1.95 2012/10/27 17:18:18 chs Exp $ */
|
2000-11-04 11:07:14 +03:00
|
|
|
/* $OpenBSD: ac97.c,v 1.8 2000/07/19 09:01:35 csapuntz Exp $ */
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
/*
|
2000-11-04 11:07:14 +03:00
|
|
|
* Copyright (c) 1999, 2000 Constantine Sapuntzakis
|
1999-10-27 17:18:02 +04:00
|
|
|
*
|
|
|
|
* Author: Constantine Sapuntzakis <csapuntz@stanford.edu>
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2000-11-04 11:07:14 +03:00
|
|
|
* 3. The name of the author may not be used to endorse or promote
|
|
|
|
* products derived from this software without specific prior written
|
|
|
|
* permission.
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
|
|
|
|
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
|
|
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
|
|
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
|
|
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
|
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
|
|
|
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
|
|
* DAMAGE
|
1999-10-27 17:18:02 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* Partially inspired by FreeBSD's sys/dev/pcm/ac97.c. It came with
|
|
|
|
the following copyright */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
|
|
|
|
2001-11-13 16:14:31 +03:00
|
|
|
#include <sys/cdefs.h>
|
2012-10-27 21:17:22 +04:00
|
|
|
__KERNEL_RCSID(0, "$NetBSD: ac97.c,v 1.95 2012/10/27 17:18:18 chs Exp $");
|
2001-11-13 16:14:31 +03:00
|
|
|
|
1999-10-27 17:18:02 +04:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/kernel.h>
|
|
|
|
#include <sys/malloc.h>
|
|
|
|
#include <sys/device.h>
|
2005-04-04 22:52:30 +04:00
|
|
|
#include <sys/sysctl.h>
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
#include <sys/audioio.h>
|
|
|
|
#include <dev/audio_if.h>
|
|
|
|
|
2000-05-15 05:32:03 +04:00
|
|
|
#include <dev/ic/ac97reg.h>
|
|
|
|
#include <dev/ic/ac97var.h>
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
struct ac97_softc;
|
|
|
|
struct ac97_source_info;
|
2004-08-24 04:53:28 +04:00
|
|
|
static int ac97_mixer_get_port(struct ac97_codec_if *, mixer_ctrl_t *);
|
|
|
|
static int ac97_mixer_set_port(struct ac97_codec_if *, mixer_ctrl_t *);
|
2004-11-08 17:24:17 +03:00
|
|
|
static void ac97_detach(struct ac97_codec_if *);
|
2006-07-26 18:44:33 +04:00
|
|
|
static void ac97_lock(struct ac97_codec_if *);
|
|
|
|
static void ac97_unlock(struct ac97_codec_if *);
|
2004-08-24 04:53:28 +04:00
|
|
|
static int ac97_query_devinfo(struct ac97_codec_if *, mixer_devinfo_t *);
|
|
|
|
static int ac97_get_portnum_by_name(struct ac97_codec_if *, const char *,
|
|
|
|
const char *, const char *);
|
|
|
|
static void ac97_restore_shadow(struct ac97_codec_if *);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
static int ac97_set_rate(struct ac97_codec_if *, int, u_int *);
|
2004-08-24 04:53:28 +04:00
|
|
|
static void ac97_set_clock(struct ac97_codec_if *, unsigned int);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
static uint16_t ac97_get_extcaps(struct ac97_codec_if *);
|
2004-08-24 04:53:28 +04:00
|
|
|
static int ac97_add_port(struct ac97_softc *,
|
|
|
|
const struct ac97_source_info *);
|
|
|
|
static int ac97_str_equal(const char *, const char *);
|
|
|
|
static int ac97_check_capability(struct ac97_softc *, int);
|
|
|
|
static void ac97_setup_source_info(struct ac97_softc *);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
static void ac97_read(struct ac97_softc *, uint8_t, uint16_t *);
|
2004-08-24 04:53:28 +04:00
|
|
|
static void ac97_setup_defaults(struct ac97_softc *);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
static int ac97_write(struct ac97_softc *, uint8_t, uint16_t);
|
2004-08-24 04:53:28 +04:00
|
|
|
|
|
|
|
static void ac97_ad198x_init(struct ac97_softc *);
|
|
|
|
static void ac97_alc650_init(struct ac97_softc *);
|
2009-07-13 16:54:11 +04:00
|
|
|
static void ac97_ucb1400_init(struct ac97_softc *);
|
2004-08-24 04:53:28 +04:00
|
|
|
static void ac97_vt1616_init(struct ac97_softc *);
|
2003-11-22 08:40:48 +03:00
|
|
|
|
2005-04-04 22:52:30 +04:00
|
|
|
static int ac97_modem_offhook_set(struct ac97_softc *, int, int);
|
|
|
|
static int ac97_sysctl_verify(SYSCTLFN_ARGS);
|
|
|
|
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
#define Ac97Nphone "phone"
|
2005-04-12 21:28:02 +04:00
|
|
|
#define Ac97Nline1 "line1"
|
|
|
|
#define Ac97Nline2 "line2"
|
|
|
|
#define Ac97Nhandset "handset"
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
static const struct audio_mixer_enum
|
2006-09-02 21:02:57 +04:00
|
|
|
ac97_on_off = { 2, { { { AudioNoff, 0 } , 0 },
|
|
|
|
{ { AudioNon, 0 } , 1 },
|
2008-06-24 14:57:45 +04:00
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 }, } };
|
2003-11-22 08:40:48 +03:00
|
|
|
|
|
|
|
static const struct audio_mixer_enum
|
2006-09-02 21:02:57 +04:00
|
|
|
ac97_mic_select = { 2, { { { AudioNmicrophone "0", 0 }, 0 },
|
|
|
|
{ { AudioNmicrophone "1", 0 }, 1 },
|
2008-06-24 14:57:45 +04:00
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 }, } };
|
2003-11-22 08:40:48 +03:00
|
|
|
|
|
|
|
static const struct audio_mixer_enum
|
2006-09-02 21:02:57 +04:00
|
|
|
ac97_mono_select = { 2, { { { AudioNmixerout, 0 }, 0 },
|
|
|
|
{ { AudioNmicrophone, 0 }, 1 },
|
2008-06-24 14:57:45 +04:00
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 }, } };
|
2003-11-22 08:40:48 +03:00
|
|
|
|
|
|
|
static const struct audio_mixer_enum
|
2006-09-02 21:02:57 +04:00
|
|
|
ac97_source = { 8, { { { AudioNmicrophone, 0 } , 0 },
|
|
|
|
{ { AudioNcd, 0 }, 1 },
|
|
|
|
{ { AudioNvideo, 0 }, 2 },
|
|
|
|
{ { AudioNaux, 0 }, 3 },
|
|
|
|
{ { AudioNline, 0 }, 4 },
|
|
|
|
{ { AudioNmixerout, 0 }, 5 },
|
|
|
|
{ { AudioNmixerout AudioNmono, 0 }, 6 },
|
|
|
|
{ { Ac97Nphone, 0 }, 7 },
|
2008-06-24 14:57:45 +04:00
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 },
|
|
|
|
{ { "", 0 } , 0 }, } };
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2001-04-29 06:47:25 +04:00
|
|
|
/*
|
2002-11-06 16:41:22 +03:00
|
|
|
* Due to different values for each source that uses these structures,
|
2001-04-29 06:47:25 +04:00
|
|
|
* the ac97_query_devinfo function sets delta in mixer_devinfo_t using
|
|
|
|
* ac97_source_info.bits.
|
|
|
|
*/
|
2003-11-22 08:40:48 +03:00
|
|
|
static const struct audio_mixer_value
|
2006-09-02 21:02:57 +04:00
|
|
|
ac97_volume_stereo = { { AudioNvolume, 0 }, 2, 0 };
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
static const struct audio_mixer_value
|
2006-09-02 21:02:57 +04:00
|
|
|
ac97_volume_mono = { { AudioNvolume, 0 }, 1, 0 };
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
#define WRAP(a) &a, sizeof(a)
|
|
|
|
|
2005-04-08 03:24:05 +04:00
|
|
|
struct ac97_source_info {
|
2001-01-18 23:28:15 +03:00
|
|
|
const char *class;
|
|
|
|
const char *device;
|
|
|
|
const char *qualifier;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
int type;
|
2001-01-18 23:28:15 +03:00
|
|
|
const void *info;
|
1999-10-27 17:18:02 +04:00
|
|
|
int info_size;
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
uint8_t reg;
|
2006-07-26 18:44:33 +04:00
|
|
|
int32_t default_value;
|
2006-08-23 15:24:07 +04:00
|
|
|
unsigned bits:3;
|
|
|
|
unsigned ofs:4;
|
|
|
|
unsigned mute:1;
|
|
|
|
unsigned polarity:1; /* Does 0 == MAX or MIN */
|
|
|
|
unsigned checkbits:1;
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
enum {
|
|
|
|
CHECK_NONE = 0,
|
|
|
|
CHECK_SURROUND,
|
|
|
|
CHECK_CENTER,
|
|
|
|
CHECK_LFE,
|
|
|
|
CHECK_HEADPHONES,
|
|
|
|
CHECK_TONE,
|
|
|
|
CHECK_MIC,
|
|
|
|
CHECK_LOUDNESS,
|
2005-04-08 03:24:05 +04:00
|
|
|
CHECK_3D,
|
|
|
|
CHECK_LINE1,
|
|
|
|
CHECK_LINE2,
|
2006-07-26 18:44:33 +04:00
|
|
|
CHECK_HANDSET,
|
|
|
|
CHECK_SPDIF
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
} req_feature;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
int prev;
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
int next;
|
1999-10-27 17:18:02 +04:00
|
|
|
int mixer_class;
|
2005-04-08 03:24:05 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct ac97_source_info audio_source_info[] = {
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCinputs, NULL, NULL,
|
2006-09-02 21:02:57 +04:00
|
|
|
AUDIO_MIXER_CLASS, NULL, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
|
|
|
{ AudioCoutputs, NULL, 0,
|
|
|
|
AUDIO_MIXER_CLASS, NULL, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
|
|
|
{ AudioCrecord, NULL, 0,
|
|
|
|
AUDIO_MIXER_CLASS, NULL, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
1999-10-27 17:18:02 +04:00
|
|
|
/* Stereo master volume*/
|
2006-09-02 21:02:57 +04:00
|
|
|
{ AudioCoutputs, AudioNmaster, 0,
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_stereo),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_MASTER_VOLUME, 0x8000, 5, 0, 1, 0, 1, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* Mono volume */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCoutputs, AudioNmono, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_MASTER_VOLUME_MONO, 0x8000, 6, 0, 1, 0, 1, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCoutputs, AudioNmono, AudioNsource,
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_mono_select),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_GP, 0x0000, 1, 9, 0, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* Headphone volume */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCoutputs, AudioNheadphone, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_stereo),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_HEADPHONE_VOLUME, 0x8000, 5, 0, 1, 0, 1, CHECK_HEADPHONES, 0, 0, 0,
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
},
|
|
|
|
/* Surround volume - logic hard coded for mute */
|
|
|
|
{ AudioCoutputs, AudioNsurround, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_stereo),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_SURR_MASTER, 0x8080, 5, 0, 1, 0, 1, CHECK_SURROUND, 0, 0, 0
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
},
|
|
|
|
/* Center volume*/
|
|
|
|
{ AudioCoutputs, AudioNcenter, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_CENTER_LFE_MASTER, 0x8080, 5, 0, 0, 0, 1, CHECK_CENTER, 0, 0, 0
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
},
|
|
|
|
{ AudioCoutputs, AudioNcenter, AudioNmute,
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_CENTER_LFE_MASTER, 0x8080, 1, 7, 0, 0, 0, CHECK_CENTER, 0, 0, 0
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
},
|
|
|
|
/* LFE volume*/
|
|
|
|
{ AudioCoutputs, AudioNlfe, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_CENTER_LFE_MASTER, 0x8080, 5, 8, 0, 0, 1, CHECK_LFE, 0, 0, 0
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
},
|
|
|
|
{ AudioCoutputs, AudioNlfe, AudioNmute,
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_CENTER_LFE_MASTER, 0x8080, 1, 15, 0, 0, 0, CHECK_LFE, 0, 0, 0
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
2004-10-12 18:34:41 +04:00
|
|
|
/* Tone - bass */
|
|
|
|
{ AudioCoutputs, AudioNbass, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_MASTER_TONE, 0x0f0f, 4, 8, 0, 0, 0, CHECK_TONE, 0, 0, 0
|
2004-10-12 18:34:41 +04:00
|
|
|
},
|
|
|
|
/* Tone - treble */
|
|
|
|
{ AudioCoutputs, AudioNtreble, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_MASTER_TONE, 0x0f0f, 4, 0, 0, 0, 0, CHECK_TONE, 0, 0, 0
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* PC Beep Volume */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCinputs, AudioNspeaker, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_PCBEEP_VOLUME, 0x0000, 4, 1, 1, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
|
1999-10-27 17:18:02 +04:00
|
|
|
/* Phone */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCinputs, Ac97Nphone, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_PHONE_VOLUME, 0x8008, 5, 0, 1, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* Mic Volume */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCinputs, AudioNmicrophone, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_MIC_VOLUME, 0x8008, 5, 0, 1, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCinputs, AudioNmicrophone, AudioNpreamp,
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_MIC_VOLUME, 0x8008, 1, 6, 0, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCinputs, AudioNmicrophone, AudioNsource,
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_mic_select),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_GP, 0x0000, 1, 8, 0, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* Line in Volume */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCinputs, AudioNline, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_stereo),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_LINEIN_VOLUME, 0x8808, 5, 0, 1, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* CD Volume */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCinputs, AudioNcd, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_stereo),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_CD_VOLUME, 0x8808, 5, 0, 1, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* Video Volume */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCinputs, AudioNvideo, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_stereo),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_VIDEO_VOLUME, 0x8808, 5, 0, 1, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* AUX volume */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCinputs, AudioNaux, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_stereo),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_AUX_VOLUME, 0x8808, 5, 0, 1, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* PCM out volume */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCinputs, AudioNdac, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_stereo),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_PCMOUT_VOLUME, 0x8808, 5, 0, 1, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* Record Source - some logic for this is hard coded - see below */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCrecord, AudioNsource, NULL,
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_source),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_RECORD_SELECT, 0x0000, 3, 0, 0, 0, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* Record Gain */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCrecord, AudioNvolume, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_stereo),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_RECORD_GAIN, 0x8000, 4, 0, 1, 1, 0, 0, 0, 0, 0,
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* Record Gain mic */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCrecord, AudioNmicrophone, NULL,
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_RECORD_GAIN_MIC, 0x8000, 4, 0, 1, 1, 0, CHECK_MIC, 0, 0, 0
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
/* */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCoutputs, AudioNloudness, NULL,
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_GP, 0x0000, 1, 12, 0, 0, 0, CHECK_LOUDNESS, 0, 0, 0
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCoutputs, AudioNspatial, NULL,
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_GP, 0x0000, 1, 13, 0, 1, 0, CHECK_3D, 0, 0, 0
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCoutputs, AudioNspatial, "center",
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_3D_CONTROL, 0x0000, 4, 8, 0, 1, 0, CHECK_3D, 0, 0, 0
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCoutputs, AudioNspatial, "depth",
|
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_3D_CONTROL, 0x0000, 4, 0, 0, 1, 0, CHECK_3D, 0, 0, 0
|
1999-10-27 17:18:02 +04:00
|
|
|
},
|
|
|
|
|
2006-07-26 18:44:33 +04:00
|
|
|
/* SPDIF */
|
|
|
|
{ "spdif", NULL, NULL,
|
|
|
|
AUDIO_MIXER_CLASS, NULL, 0,
|
2006-09-02 21:02:57 +04:00
|
|
|
0, 0, 0, 0, 0, 0, 0, CHECK_SPDIF, 0, 0, 0
|
|
|
|
},
|
2006-07-26 18:44:33 +04:00
|
|
|
{ "spdif", "enable", NULL,
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_EXT_AUDIO_CTRL, -1, 1, 2, 0, 0, 0, CHECK_SPDIF, 0, 0, 0
|
|
|
|
},
|
2006-07-26 18:44:33 +04:00
|
|
|
|
1999-10-27 17:18:02 +04:00
|
|
|
/* Missing features: Simulated Stereo, POP, Loopback mode */
|
2004-08-24 04:53:28 +04:00
|
|
|
};
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2005-04-08 03:24:05 +04:00
|
|
|
static const struct ac97_source_info modem_source_info[] = {
|
|
|
|
/* Classes */
|
2005-04-12 21:28:02 +04:00
|
|
|
{ AudioCinputs, NULL, NULL,
|
2006-09-02 21:02:57 +04:00
|
|
|
AUDIO_MIXER_CLASS, NULL, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
2005-04-12 21:28:02 +04:00
|
|
|
{ AudioCoutputs, NULL, NULL,
|
2006-09-02 21:02:57 +04:00
|
|
|
AUDIO_MIXER_CLASS, NULL, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
2006-07-26 18:44:33 +04:00
|
|
|
{ AudioCinputs, Ac97Nline1, NULL,
|
2005-04-08 03:24:05 +04:00
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_LINE1_LEVEL, 0x8080, 4, 0, 0, 1, 0, CHECK_LINE1, 0, 0, 0
|
2005-04-08 03:24:05 +04:00
|
|
|
},
|
2005-04-12 21:28:02 +04:00
|
|
|
{ AudioCoutputs, Ac97Nline1, NULL,
|
2005-04-08 03:24:05 +04:00
|
|
|
AUDIO_MIXER_VALUE, WRAP(ac97_volume_mono),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_LINE1_LEVEL, 0x8080, 4, 8, 0, 1, 0, CHECK_LINE1, 0, 0, 0
|
2005-04-08 03:24:05 +04:00
|
|
|
},
|
2005-04-12 21:28:02 +04:00
|
|
|
{ AudioCinputs, Ac97Nline1, AudioNmute,
|
2005-04-08 03:24:05 +04:00
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_LINE1_LEVEL, 0x8080, 1, 7, 0, 0, 0, CHECK_LINE1, 0, 0, 0
|
2005-04-08 03:24:05 +04:00
|
|
|
},
|
2005-04-12 21:28:02 +04:00
|
|
|
{ AudioCoutputs, Ac97Nline1, AudioNmute,
|
2005-04-08 03:24:05 +04:00
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_REG_LINE1_LEVEL, 0x8080, 1, 15, 0, 0, 0, CHECK_LINE1, 0, 0, 0
|
2005-04-08 03:24:05 +04:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
#define AUDIO_SOURCE_INFO_SIZE \
|
|
|
|
(sizeof(audio_source_info)/sizeof(audio_source_info[0]))
|
|
|
|
#define MODEM_SOURCE_INFO_SIZE \
|
|
|
|
(sizeof(modem_source_info)/sizeof(modem_source_info[0]))
|
2005-04-11 22:26:48 +04:00
|
|
|
#define SOURCE_INFO_SIZE(as) ((as)->type == AC97_CODEC_TYPE_MODEM ? \
|
2006-07-26 18:44:33 +04:00
|
|
|
MODEM_SOURCE_INFO_SIZE : AUDIO_SOURCE_INFO_SIZE)
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
/*
|
2007-02-17 00:05:40 +03:00
|
|
|
* Check out http://www.intel.com/support/motherboards/desktop/sb/cs-025406.htm for
|
|
|
|
* AC'97 Component Specification
|
1999-10-27 17:18:02 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
struct ac97_softc {
|
2002-10-08 13:19:44 +04:00
|
|
|
/* ac97_codec_if must be at the first of ac97_softc. */
|
2000-11-04 11:07:14 +03:00
|
|
|
struct ac97_codec_if codec_if;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2000-11-04 11:07:14 +03:00
|
|
|
struct ac97_host_if *host_if;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
kmutex_t *lock;
|
|
|
|
|
2005-04-08 03:24:05 +04:00
|
|
|
#define AUDIO_MAX_SOURCES (2 * AUDIO_SOURCE_INFO_SIZE)
|
|
|
|
#define MODEM_MAX_SOURCES (2 * MODEM_SOURCE_INFO_SIZE)
|
|
|
|
struct ac97_source_info audio_source_info[AUDIO_MAX_SOURCES];
|
|
|
|
struct ac97_source_info modem_source_info[MODEM_MAX_SOURCES];
|
|
|
|
struct ac97_source_info *source_info;
|
1999-10-27 17:18:02 +04:00
|
|
|
int num_source_info;
|
2000-11-04 11:07:14 +03:00
|
|
|
|
|
|
|
enum ac97_host_flags host_flags;
|
2002-10-08 13:19:44 +04:00
|
|
|
unsigned int ac97_clock; /* usually 48000 */
|
|
|
|
#define AC97_STANDARD_CLOCK 48000U
|
2005-05-11 17:13:11 +04:00
|
|
|
uint16_t power_all;
|
2006-04-16 01:18:34 +04:00
|
|
|
uint16_t power_reg; /* -> AC97_REG_POWER */
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
uint16_t caps; /* -> AC97_REG_RESET */
|
|
|
|
uint16_t ext_id; /* -> AC97_REG_EXT_AUDIO_ID */
|
2005-04-04 06:08:58 +04:00
|
|
|
uint16_t ext_mid; /* -> AC97_REG_EXT_MODEM_ID */
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
uint16_t shadow_reg[128];
|
2005-04-04 22:52:30 +04:00
|
|
|
|
2006-07-26 18:44:33 +04:00
|
|
|
int lock_counter;
|
2005-04-08 03:24:05 +04:00
|
|
|
int type;
|
|
|
|
|
2005-04-04 22:52:30 +04:00
|
|
|
/* sysctl */
|
|
|
|
struct sysctllog *log;
|
|
|
|
int offhook_line1_mib;
|
|
|
|
int offhook_line2_mib;
|
|
|
|
int offhook_line1;
|
|
|
|
int offhook_line2;
|
1999-10-27 17:18:02 +04:00
|
|
|
};
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static struct ac97_codec_if_vtbl ac97civ = {
|
2002-10-08 13:19:44 +04:00
|
|
|
ac97_mixer_get_port,
|
1999-10-27 17:18:02 +04:00
|
|
|
ac97_mixer_set_port,
|
|
|
|
ac97_query_devinfo,
|
2000-11-04 11:07:14 +03:00
|
|
|
ac97_get_portnum_by_name,
|
|
|
|
ac97_restore_shadow,
|
2002-10-08 13:19:44 +04:00
|
|
|
ac97_get_extcaps,
|
|
|
|
ac97_set_rate,
|
|
|
|
ac97_set_clock,
|
2004-11-08 17:24:17 +03:00
|
|
|
ac97_detach,
|
2006-07-26 18:44:33 +04:00
|
|
|
ac97_lock,
|
|
|
|
ac97_unlock,
|
1999-10-27 17:18:02 +04:00
|
|
|
};
|
|
|
|
|
2000-04-26 04:00:41 +04:00
|
|
|
static const struct ac97_codecid {
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
uint32_t id;
|
|
|
|
uint32_t mask;
|
2000-04-26 04:00:41 +04:00
|
|
|
const char *name;
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
void (*init)(struct ac97_softc *);
|
1999-10-27 17:18:02 +04:00
|
|
|
} ac97codecid[] = {
|
2002-11-06 16:41:22 +03:00
|
|
|
/*
|
|
|
|
* Analog Devices SoundMAX
|
|
|
|
* http://www.soundmax.com/products/information/codecs.html
|
|
|
|
* http://www.analog.com/productSelection/pdf/AD1881A_0.pdf
|
|
|
|
* http://www.analog.com/productSelection/pdf/AD1885_0.pdf
|
2003-09-07 15:27:32 +04:00
|
|
|
* http://www.analog.com/UploadedFiles/Data_Sheets/206585810AD1980_0.pdf
|
2002-11-06 16:41:22 +03:00
|
|
|
* http://www.analog.com/productSelection/pdf/AD1981A_0.pdf
|
|
|
|
* http://www.analog.com/productSelection/pdf/AD1981B_0.pdf
|
2003-09-28 19:39:09 +04:00
|
|
|
* http://www.analog.com/UploadedFiles/Data_Sheets/180644528AD1985_0.pdf
|
2002-11-06 16:41:22 +03:00
|
|
|
*/
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 3),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Analog Devices AD1819B", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 0x40),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Analog Devices AD1881", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 0x48),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Analog Devices AD1881A", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 0x60),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Analog Devices AD1885", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 0x61),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Analog Devices AD1886", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 0x63),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Analog Devices AD1886A", NULL, },
|
2004-08-07 21:37:31 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 0x68),
|
|
|
|
0xffffffff, "Analog Devices AD1888", ac97_ad198x_init },
|
2002-12-26 23:56:52 +03:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 0x70),
|
2003-11-22 09:15:29 +03:00
|
|
|
0xffffffff, "Analog Devices AD1980", ac97_ad198x_init },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 0x72),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Analog Devices AD1981A", NULL, },
|
2002-11-06 16:41:22 +03:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 0x74),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Analog Devices AD1981B", NULL, },
|
2003-09-28 19:39:09 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 0x75),
|
2003-11-22 09:15:29 +03:00
|
|
|
0xffffffff, "Analog Devices AD1985", ac97_ad198x_init },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'D', 'S', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Analog Devices unknown", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
/*
|
|
|
|
* Datasheets:
|
2006-05-10 13:07:57 +04:00
|
|
|
* http://www.asahi-kasei.co.jp/akm/japanese/product/ak4543/ek4543.pdf
|
|
|
|
* http://www.asahi-kasei.co.jp/akm/japanese/product/ak4544a/ek4544a.pdf
|
|
|
|
* http://www.asahi-kasei.co.jp/akm/japanese/product/ak4545/ak4545_f00e.pdf
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
*/
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'K', 'M', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Asahi Kasei AK4540", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'K', 'M', 1),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Asahi Kasei AK4542", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'K', 'M', 2),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Asahi Kasei AK4541/AK4543", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'K', 'M', 5),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Asahi Kasei AK4544", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'K', 'M', 6),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Asahi Kasei AK4544A", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'K', 'M', 7),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Asahi Kasei AK4545", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'K', 'M', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Asahi Kasei unknown", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
/*
|
|
|
|
* Realtek & Avance Logic
|
|
|
|
* http://www.realtek.com.tw/downloads/downloads1-3.aspx?lineid=5&famid=All&series=All&Spec=True
|
2004-08-07 20:59:54 +04:00
|
|
|
*
|
|
|
|
* ALC650 and ALC658 support VRA, but it supports only 8000, 11025,
|
|
|
|
* 12000, 16000, 22050, 24000, 32000, 44100, and 48000 Hz.
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
*/
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'C', 0x00),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff0, "Realtek RL5306", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'C', 0x10),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff0, "Realtek RL5382", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'C', 0x20),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff0, "Realtek RL5383/RL5522/ALC100", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'G', 0x10),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Avance Logic ALC200/ALC201", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'G', 0x20),
|
2004-08-07 20:59:54 +04:00
|
|
|
0xfffffff0, "Avance Logic ALC650", ac97_alc650_init },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'G', 0x30),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Avance Logic ALC101", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'G', 0x40),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Avance Logic ALC202", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'G', 0x50),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Avance Logic ALC250", NULL, },
|
2004-08-07 20:59:54 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'G', 0x60),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff0, "Avance Logic ALC655", NULL, },
|
2011-11-27 19:08:04 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'G', 0x70),
|
|
|
|
0xffffffff, "Avance Logic ALC203", NULL, },
|
2004-08-07 20:59:54 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'G', 0x80),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff0, "Avance Logic ALC658", NULL, },
|
2004-08-07 20:59:54 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'G', 0x90),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff0, "Avance Logic ALC850", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'C', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Realtek unknown", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('A', 'L', 'G', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Avance Logic unknown", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
|
2004-08-08 07:50:56 +04:00
|
|
|
/**
|
|
|
|
* C-Media Electronics Inc.
|
|
|
|
* http://www.cmedia.com.tw/doc/CMI9739%206CH%20Audio%20Codec%20SPEC_Ver12.pdf
|
|
|
|
*/
|
|
|
|
{ AC97_CODEC_ID('C', 'M', 'I', 0x61),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "C-Media CMI9739", NULL, },
|
2004-08-08 07:50:56 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'M', 'I', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "C-Media unknown", NULL, },
|
2004-08-08 07:50:56 +04:00
|
|
|
|
2002-10-09 16:06:17 +04:00
|
|
|
/* Cirrus Logic, Crystal series:
|
|
|
|
* 'C' 'R' 'Y' 0x0[0-7] - CS4297
|
|
|
|
* 0x1[0-7] - CS4297A
|
|
|
|
* 0x2[0-7] - CS4298
|
|
|
|
* 0x2[8-f] - CS4294
|
|
|
|
* 0x3[0-7] - CS4299
|
|
|
|
* 0x4[8-f] - CS4201
|
|
|
|
* 0x5[8-f] - CS4205
|
|
|
|
* 0x6[0-7] - CS4291
|
|
|
|
* 0x7[0-7] - CS4202
|
|
|
|
* Datasheets:
|
|
|
|
* http://www.cirrus.com/pubs/cs4297A-5.pdf?DocumentID=593
|
|
|
|
* http://www.cirrus.com/pubs/cs4294.pdf?DocumentID=32
|
|
|
|
* http://www.cirrus.com/pubs/cs4299-5.pdf?DocumentID=594
|
|
|
|
* http://www.cirrus.com/pubs/cs4201-2.pdf?DocumentID=492
|
|
|
|
* http://www.cirrus.com/pubs/cs4205-2.pdf?DocumentID=492
|
|
|
|
* http://www.cirrus.com/pubs/cs4202-1.pdf?DocumentID=852
|
|
|
|
*/
|
|
|
|
{ AC97_CODEC_ID('C', 'R', 'Y', 0x00),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff8, "Crystal CS4297", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'R', 'Y', 0x10),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff8, "Crystal CS4297A", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'R', 'Y', 0x20),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff8, "Crystal CS4298", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'R', 'Y', 0x28),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff8, "Crystal CS4294", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'R', 'Y', 0x30),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff8, "Crystal CS4299", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'R', 'Y', 0x48),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff8, "Crystal CS4201", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'R', 'Y', 0x58),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff8, "Crystal CS4205", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'R', 'Y', 0x60),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff8, "Crystal CS4291", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'R', 'Y', 0x70),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xfffffff8, "Crystal CS4202", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'R', 'Y', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Cirrus Logic unknown", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
|
2006-09-02 21:02:57 +04:00
|
|
|
{ 0x45838308, 0xffffffff, "ESS Technology ES1921", NULL, },
|
|
|
|
{ 0x45838300, AC97_VENDOR_ID_MASK, "ESS Technology unknown", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('H', 'R', 'S', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Intersil HMP9701", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('H', 'R', 'S', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Intersil unknown", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
|
2002-10-22 17:48:30 +04:00
|
|
|
/*
|
|
|
|
* IC Ensemble (VIA)
|
|
|
|
* http://www.viatech.com/en/datasheet/DS1616.pdf
|
|
|
|
*/
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('I', 'C', 'E', 0x01),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "ICEnsemble ICE1230/VT1611", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('I', 'C', 'E', 0x11),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "ICEnsemble ICE1232/VT1611A", NULL, },
|
2002-10-22 17:48:30 +04:00
|
|
|
{ AC97_CODEC_ID('I', 'C', 'E', 0x14),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "ICEnsemble ICE1232A", NULL, },
|
2002-10-22 17:48:30 +04:00
|
|
|
{ AC97_CODEC_ID('I', 'C', 'E', 0x51),
|
|
|
|
0xffffffff, "VIA Technologies VT1616", ac97_vt1616_init },
|
2004-08-08 14:41:57 +04:00
|
|
|
{ AC97_CODEC_ID('I', 'C', 'E', 0x52),
|
|
|
|
0xffffffff, "VIA Technologies VT1616i", ac97_vt1616_init },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('I', 'C', 'E', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "ICEnsemble/VIA unknown", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
|
|
|
|
{ AC97_CODEC_ID('N', 'S', 'C', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "National Semiconductor LM454[03568]", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('N', 'S', 'C', 49),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "National Semiconductor LM4549", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('N', 'S', 'C', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "National Semiconductor unknown", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
|
2003-03-03 05:14:12 +03:00
|
|
|
{ AC97_CODEC_ID('P', 'S', 'C', 4),
|
2009-07-13 16:54:11 +04:00
|
|
|
0xffffffff, "Philips Semiconductor UCB1400", ac97_ucb1400_init, },
|
2003-03-03 05:14:12 +03:00
|
|
|
{ AC97_CODEC_ID('P', 'S', 'C', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Philips Semiconductor unknown", NULL, },
|
2003-03-03 05:14:12 +03:00
|
|
|
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('S', 'I', 'L', 34),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Silicon Laboratory Si3036", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('S', 'I', 'L', 35),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Silicon Laboratory Si3038", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('S', 'I', 'L', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Silicon Laboratory unknown", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('T', 'R', 'A', 2),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "TriTech TR28022", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('T', 'R', 'A', 3),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "TriTech TR28023", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('T', 'R', 'A', 6),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "TriTech TR28026", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('T', 'R', 'A', 8),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "TriTech TR28028", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('T', 'R', 'A', 35),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "TriTech TR28602", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('T', 'R', 'A', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "TriTech unknown", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('T', 'X', 'N', 0x20),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Texas Instruments TLC320AD9xC", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('T', 'X', 'N', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Texas Instruments unknown", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* VIA
|
|
|
|
* http://www.viatech.com/en/multimedia/audio.jsp
|
|
|
|
*/
|
|
|
|
{ AC97_CODEC_ID('V', 'I', 'A', 0x61),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "VIA Technologies VT1612A", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('V', 'I', 'A', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "VIA Technologies unknown", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
|
|
|
|
{ AC97_CODEC_ID('W', 'E', 'C', 1),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Winbond W83971D", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('W', 'E', 'C', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Winbond unknown", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
/*
|
|
|
|
* http://www.wolfsonmicro.com/product_list.asp?cid=64
|
2002-10-16 20:38:25 +04:00
|
|
|
* http://www.wolfsonmicro.com/download.asp/did.56/WM9701A.pdf - 00
|
|
|
|
* http://www.wolfsonmicro.com/download.asp/did.57/WM9703.pdf - 03
|
|
|
|
* http://www.wolfsonmicro.com/download.asp/did.58/WM9704M.pdf - 04
|
|
|
|
* http://www.wolfsonmicro.com/download.asp/did.59/WM9704Q.pdf - 04
|
|
|
|
* http://www.wolfsonmicro.com/download.asp/did.184/WM9705_Rev34.pdf - 05
|
|
|
|
* http://www.wolfsonmicro.com/download.asp/did.60/WM9707.pdf - 03
|
|
|
|
* http://www.wolfsonmicro.com/download.asp/did.136/WM9708.pdf - 03
|
|
|
|
* http://www.wolfsonmicro.com/download.asp/did.243/WM9710.pdf - 05
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
*/
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('W', 'M', 'L', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Wolfson WM9701A", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('W', 'M', 'L', 3),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Wolfson WM9703/WM9707/WM9708", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('W', 'M', 'L', 4),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Wolfson WM9704", NULL, },
|
2002-10-16 20:38:25 +04:00
|
|
|
{ AC97_CODEC_ID('W', 'M', 'L', 5),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Wolfson WM9705/WM9710", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('W', 'M', 'L', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Wolfson unknown", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* http://www.yamaha.co.jp/english/product/lsi/us/products/pcaudio.html
|
|
|
|
* Datasheets:
|
|
|
|
* http://www.yamaha.co.jp/english/product/lsi/us/products/pdf/4MF743A20.pdf
|
|
|
|
* http://www.yamaha.co.jp/english/product/lsi/us/products/pdf/4MF753A20.pdf
|
|
|
|
*/
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('Y', 'M', 'H', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Yamaha YMF743-S", NULL, },
|
2002-10-09 16:06:17 +04:00
|
|
|
{ AC97_CODEC_ID('Y', 'M', 'H', 3),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Yamaha YMF753-S", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AC97_CODEC_ID('Y', 'M', 'H', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Yamaha unknown", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
|
|
|
|
/*
|
2004-06-01 17:35:59 +04:00
|
|
|
* http://www.sigmatel.com/products/technical_docs.htm
|
|
|
|
* and
|
|
|
|
* http://www.sigmatel.com/documents/c-major-brochure-9-0.pdf
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
*/
|
2006-09-02 21:02:57 +04:00
|
|
|
{ 0x83847600, 0xffffffff, "SigmaTel STAC9700", NULL, },
|
|
|
|
{ 0x83847604, 0xffffffff, "SigmaTel STAC9701/3/4/5", NULL, },
|
|
|
|
{ 0x83847605, 0xffffffff, "SigmaTel STAC9704", NULL, },
|
|
|
|
{ 0x83847608, 0xffffffff, "SigmaTel STAC9708", NULL, },
|
|
|
|
{ 0x83847609, 0xffffffff, "SigmaTel STAC9721/23", NULL, },
|
|
|
|
{ 0x83847644, 0xffffffff, "SigmaTel STAC9744/45", NULL, },
|
|
|
|
{ 0x83847650, 0xffffffff, "SigmaTel STAC9750/51", NULL, },
|
|
|
|
{ 0x83847652, 0xffffffff, "SigmaTel STAC9752/53", NULL, },
|
|
|
|
{ 0x83847656, 0xffffffff, "SigmaTel STAC9756/57", NULL, },
|
|
|
|
{ 0x83847658, 0xffffffff, "SigmaTel STAC9758/59", NULL, },
|
|
|
|
{ 0x83847666, 0xffffffff, "SigmaTel STAC9766/67", NULL, },
|
|
|
|
{ 0x83847684, 0xffffffff, "SigmaTel STAC9783/84", NULL, },
|
|
|
|
{ 0x83847600, AC97_VENDOR_ID_MASK, "SigmaTel unknown", NULL, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
|
2005-04-08 03:24:05 +04:00
|
|
|
/* Conexant AC'97 modems -- good luck finding datasheets! */
|
2005-04-08 16:50:00 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'X', 'T', 33),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Conexant HSD11246", NULL, },
|
2005-04-08 03:24:05 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'X', 'T', 34),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Conexant D480 MDC V.92 Modem", NULL, },
|
2005-11-06 13:08:24 +03:00
|
|
|
{ AC97_CODEC_ID('C', 'X', 'T', 48),
|
2006-09-02 21:02:57 +04:00
|
|
|
0xffffffff, "Conexant CXT48", NULL, },
|
2005-04-08 03:24:05 +04:00
|
|
|
{ AC97_CODEC_ID('C', 'X', 'T', 0),
|
2006-09-02 21:02:57 +04:00
|
|
|
AC97_VENDOR_ID_MASK, "Conexant unknown", NULL, },
|
2005-04-08 03:24:05 +04:00
|
|
|
|
2002-10-09 16:06:17 +04:00
|
|
|
{ 0,
|
2006-09-02 21:02:57 +04:00
|
|
|
0, NULL, NULL, },
|
1999-10-27 17:18:02 +04:00
|
|
|
};
|
|
|
|
|
2001-01-18 23:28:15 +03:00
|
|
|
static const char * const ac97enhancement[] = {
|
1999-11-02 08:41:27 +03:00
|
|
|
"no 3D stereo",
|
1999-10-27 17:18:02 +04:00
|
|
|
"Analog Devices Phat Stereo",
|
2002-01-23 17:50:45 +03:00
|
|
|
"Creative",
|
1999-10-27 17:18:02 +04:00
|
|
|
"National Semi 3D",
|
|
|
|
"Yamaha Ymersion",
|
|
|
|
"BBE 3D",
|
2002-01-23 17:50:45 +03:00
|
|
|
"Crystal Semi 3D",
|
1999-10-27 17:18:02 +04:00
|
|
|
"Qsound QXpander",
|
|
|
|
"Spatializer 3D",
|
|
|
|
"SRS 3D",
|
|
|
|
"Platform Tech 3D",
|
|
|
|
"AKM 3D",
|
|
|
|
"Aureal",
|
|
|
|
"AZTECH 3D",
|
|
|
|
"Binaura 3D",
|
|
|
|
"ESS Technology",
|
|
|
|
"Harman International VMAx",
|
|
|
|
"Nvidea 3D",
|
|
|
|
"Philips Incredible Sound",
|
|
|
|
"Texas Instruments' 3D",
|
|
|
|
"VLSI Technology 3D",
|
|
|
|
"TriTech 3D",
|
|
|
|
"Realtek 3D",
|
|
|
|
"Samsung 3D",
|
|
|
|
"Wolfson Microelectronics 3D",
|
|
|
|
"Delta Integration 3D",
|
|
|
|
"SigmaTel 3D",
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
"KS Waves 3D",
|
1999-10-27 17:18:02 +04:00
|
|
|
"Rockwell 3D",
|
|
|
|
"Unknown 3D",
|
|
|
|
"Unknown 3D",
|
|
|
|
"Unknown 3D",
|
|
|
|
};
|
|
|
|
|
2001-01-18 23:28:15 +03:00
|
|
|
static const char * const ac97feature[] = {
|
2002-10-06 20:33:35 +04:00
|
|
|
"dedicated mic channel",
|
1999-10-27 17:18:02 +04:00
|
|
|
"reserved",
|
|
|
|
"tone",
|
|
|
|
"simulated stereo",
|
|
|
|
"headphone",
|
|
|
|
"bass boost",
|
|
|
|
"18 bit DAC",
|
|
|
|
"20 bit DAC",
|
|
|
|
"18 bit ADC",
|
|
|
|
"20 bit ADC"
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* #define AC97_DEBUG 10 */
|
2004-08-28 11:02:11 +04:00
|
|
|
/* #define AC97_IO_DEBUG */
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
#ifdef AUDIO_DEBUG
|
|
|
|
#define DPRINTF(x) if (ac97debug) printf x
|
|
|
|
#define DPRINTFN(n,x) if (ac97debug>(n)) printf x
|
|
|
|
#ifdef AC97_DEBUG
|
|
|
|
int ac97debug = AC97_DEBUG;
|
|
|
|
#else
|
|
|
|
int ac97debug = 0;
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#define DPRINTF(x)
|
|
|
|
#define DPRINTFN(n,x)
|
|
|
|
#endif
|
|
|
|
|
2004-08-28 11:02:11 +04:00
|
|
|
#ifdef AC97_IO_DEBUG
|
|
|
|
static const char *ac97_register_names[0x80 / 2] = {
|
|
|
|
"RESET", "MASTER_VOLUME", "HEADPHONE_VOLUME", "MASTER_VOLUME_MONO",
|
|
|
|
"MASTER_TONE", "PCBEEP_VOLUME", "PHONE_VOLUME", "MIC_VOLUME",
|
|
|
|
"LINEIN_VOLUME", "CD_VOLUME", "VIDEO_VOLUME", "AUX_VOLUME",
|
|
|
|
"PCMOUT_VOLUME", "RECORD_SELECT", "RECORD_GATIN", "RECORD_GAIN_MIC",
|
|
|
|
"GP", "3D_CONTROL", "AUDIO_INT", "POWER",
|
|
|
|
"EXT_AUDIO_ID", "EXT_AUDIO_CTRL", "PCM_FRONT_DAC_RATE", "PCM_SURR_DAC_RATE",
|
|
|
|
"PCM_LFE_DAC_RATE", "PCM_LR_ADC_RATE", "PCM_MIC_ADC_RATE", "CENTER_LFE_MASTER",
|
|
|
|
"SURR_MASTER", "SPDIF_CTRL", "EXT_MODEM_ID", "EXT_MODEM_CTRL",
|
|
|
|
"LINE1_RATE", "LINE2_RATE", "HANDSET_RATE", "LINE1_LEVEL",
|
|
|
|
"LINE2_LEVEL", "HANDSET_LEVEL", "GPIO_PIN_CONFIG", "GPIO_PIN_POLARITY",
|
|
|
|
"GPIO_PIN_STICKY", "GPIO_PIN_WAKEUP", "GPIO_PIN_STATUS", "MISC_MODEM_CTRL",
|
|
|
|
"0x58", "VENDOR-5A", "VENDOR-5C", "VENDOR-5E",
|
|
|
|
"0x60", "0x62", "0x64", "0x66",
|
|
|
|
"0x68", "0x6a", "0x6c", "0x6e",
|
|
|
|
"VENDOR-70", "VENDOR-72", "VENDOR-74", "VENDOR-76",
|
|
|
|
"VENDOR-78", "VENDOR-7A", "VENDOR_ID1", "VENDOR_ID2"
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2006-04-16 01:18:34 +04:00
|
|
|
/*
|
|
|
|
* XXX Some cards have an inverted AC97_POWER_EAMP bit.
|
|
|
|
* These cards will produce no sound unless AC97_HOST_INVERTED_EAMP is set.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define POWER_EAMP_ON(as) ((as->host_flags & AC97_HOST_INVERTED_EAMP) \
|
|
|
|
? AC97_POWER_EAMP : 0)
|
|
|
|
#define POWER_EAMP_OFF(as) ((as->host_flags & AC97_HOST_INVERTED_EAMP) \
|
|
|
|
? 0 : AC97_POWER_EAMP)
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static void
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
ac97_read(struct ac97_softc *as, uint8_t reg, uint16_t *val)
|
2000-11-04 11:07:14 +03:00
|
|
|
{
|
2011-11-24 03:07:28 +04:00
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2000-11-04 11:07:14 +03:00
|
|
|
if (as->host_flags & AC97_HOST_DONT_READ &&
|
|
|
|
(reg != AC97_REG_VENDOR_ID1 && reg != AC97_REG_VENDOR_ID2 &&
|
|
|
|
reg != AC97_REG_RESET)) {
|
|
|
|
*val = as->shadow_reg[reg >> 1];
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-01-20 10:20:01 +03:00
|
|
|
if (as->host_if->read(as->host_if->arg, reg, val)) {
|
2000-11-04 11:07:14 +03:00
|
|
|
*val = as->shadow_reg[reg >> 1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static int
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
ac97_write(struct ac97_softc *as, uint8_t reg, uint16_t val)
|
2000-11-04 11:07:14 +03:00
|
|
|
{
|
2011-11-24 03:07:28 +04:00
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2004-08-28 11:02:11 +04:00
|
|
|
#ifndef AC97_IO_DEBUG
|
2000-11-04 11:07:14 +03:00
|
|
|
as->shadow_reg[reg >> 1] = val;
|
2003-11-22 08:40:48 +03:00
|
|
|
return as->host_if->write(as->host_if->arg, reg, val);
|
2004-08-28 11:02:11 +04:00
|
|
|
#else
|
|
|
|
int ret;
|
|
|
|
uint16_t actual;
|
|
|
|
|
|
|
|
as->shadow_reg[reg >> 1] = val;
|
|
|
|
ret = as->host_if->write(as->host_if->arg, reg, val);
|
|
|
|
as->host_if->read(as->host_if->arg, reg, &actual);
|
|
|
|
if (val != actual && reg < 0x80) {
|
|
|
|
printf("ac97_write: reg=%s, written=0x%04x, read=0x%04x\n",
|
|
|
|
ac97_register_names[reg / 2], val, actual);
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
#endif
|
2000-11-04 11:07:14 +03:00
|
|
|
}
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static void
|
2003-11-22 08:40:48 +03:00
|
|
|
ac97_setup_defaults(struct ac97_softc *as)
|
2000-11-04 11:07:14 +03:00
|
|
|
{
|
|
|
|
int idx;
|
2001-01-18 23:28:15 +03:00
|
|
|
const struct ac97_source_info *si;
|
2000-11-04 11:07:14 +03:00
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2000-11-04 11:07:14 +03:00
|
|
|
memset(as->shadow_reg, 0, sizeof(as->shadow_reg));
|
|
|
|
|
2005-04-08 03:24:05 +04:00
|
|
|
for (idx = 0; idx < AUDIO_SOURCE_INFO_SIZE; idx++) {
|
|
|
|
si = &audio_source_info[idx];
|
2006-07-26 18:44:33 +04:00
|
|
|
if (si->default_value >= 0)
|
|
|
|
ac97_write(as, si->reg, si->default_value);
|
2005-04-08 03:24:05 +04:00
|
|
|
}
|
|
|
|
for (idx = 0; idx < MODEM_SOURCE_INFO_SIZE; idx++) {
|
|
|
|
si = &modem_source_info[idx];
|
2006-07-26 18:44:33 +04:00
|
|
|
if (si->default_value >= 0)
|
|
|
|
ac97_write(as, si->reg, si->default_value);
|
2000-11-04 11:07:14 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static void
|
2012-10-27 21:17:22 +04:00
|
|
|
ac97_restore_shadow(struct ac97_codec_if *codec_if)
|
2000-11-04 11:07:14 +03:00
|
|
|
{
|
2003-11-22 08:40:48 +03:00
|
|
|
struct ac97_softc *as;
|
2001-01-18 23:28:15 +03:00
|
|
|
const struct ac97_source_info *si;
|
2003-11-22 08:40:48 +03:00
|
|
|
int idx;
|
2004-08-20 18:36:13 +04:00
|
|
|
uint16_t val;
|
2000-11-04 11:07:14 +03:00
|
|
|
|
2012-10-27 21:17:22 +04:00
|
|
|
as = (struct ac97_softc *)codec_if;
|
2004-08-20 18:36:13 +04:00
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2005-05-11 17:13:11 +04:00
|
|
|
if (as->type == AC97_CODEC_TYPE_AUDIO) {
|
2006-04-16 01:18:34 +04:00
|
|
|
/* restore AC97_REG_POWER */
|
|
|
|
ac97_write(as, AC97_REG_POWER, as->power_reg);
|
2005-05-11 17:13:11 +04:00
|
|
|
/* make sure chip is fully operational */
|
|
|
|
for (idx = 50000; idx >= 0; idx--) {
|
|
|
|
ac97_read(as, AC97_REG_POWER, &val);
|
|
|
|
if ((val & as->power_all) == as->power_all)
|
|
|
|
break;
|
|
|
|
DELAY(10);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* actually try changing a value!
|
|
|
|
* The default value of AC97_REG_MASTER_VOLUME is 0x8000.
|
|
|
|
*/
|
|
|
|
for (idx = 50000; idx >= 0; idx--) {
|
|
|
|
ac97_write(as, AC97_REG_MASTER_VOLUME, 0x1010);
|
|
|
|
ac97_read(as, AC97_REG_MASTER_VOLUME, &val);
|
|
|
|
if (val == 0x1010)
|
|
|
|
break;
|
|
|
|
DELAY(10);
|
|
|
|
}
|
2004-08-20 18:36:13 +04:00
|
|
|
}
|
2004-10-17 12:20:15 +04:00
|
|
|
|
2005-04-08 03:24:05 +04:00
|
|
|
for (idx = 0; idx < SOURCE_INFO_SIZE(as); idx++) {
|
2005-04-11 22:26:48 +04:00
|
|
|
if (as->type == AC97_CODEC_TYPE_MODEM)
|
2005-04-08 03:24:05 +04:00
|
|
|
si = &modem_source_info[idx];
|
|
|
|
else
|
|
|
|
si = &audio_source_info[idx];
|
2004-08-20 18:36:13 +04:00
|
|
|
/* don't "restore" to the reset reg! */
|
|
|
|
if (si->reg != AC97_REG_RESET)
|
|
|
|
ac97_write(as, si->reg, as->shadow_reg[si->reg >> 1]);
|
2000-11-04 11:07:14 +03:00
|
|
|
}
|
2003-06-11 18:22:27 +04:00
|
|
|
|
|
|
|
if (as->ext_id & (AC97_EXT_AUDIO_VRA | AC97_EXT_AUDIO_DRA
|
|
|
|
| AC97_EXT_AUDIO_SPDIF | AC97_EXT_AUDIO_VRM
|
|
|
|
| AC97_EXT_AUDIO_CDAC | AC97_EXT_AUDIO_SDAC
|
|
|
|
| AC97_EXT_AUDIO_LDAC)) {
|
|
|
|
ac97_write(as, AC97_REG_EXT_AUDIO_CTRL,
|
|
|
|
as->shadow_reg[AC97_REG_EXT_AUDIO_CTRL >> 1]);
|
|
|
|
}
|
2005-04-08 03:24:05 +04:00
|
|
|
if (as->ext_mid & (AC97_EXT_MODEM_LINE1 | AC97_EXT_MODEM_LINE2
|
|
|
|
| AC97_EXT_MODEM_HANDSET | AC97_EXT_MODEM_CID1
|
|
|
|
| AC97_EXT_MODEM_CID2 | AC97_EXT_MODEM_ID0
|
|
|
|
| AC97_EXT_MODEM_ID1)) {
|
|
|
|
ac97_write(as, AC97_REG_EXT_MODEM_CTRL,
|
|
|
|
as->shadow_reg[AC97_REG_EXT_MODEM_CTRL >> 1]);
|
|
|
|
}
|
2000-11-04 11:07:14 +03:00
|
|
|
}
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static int
|
2003-11-22 08:40:48 +03:00
|
|
|
ac97_str_equal(const char *a, const char *b)
|
1999-10-27 17:18:02 +04:00
|
|
|
{
|
2003-11-22 08:40:48 +03:00
|
|
|
return (a == b) || (a && b && (!strcmp(a, b)));
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static int
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
ac97_check_capability(struct ac97_softc *as, int check)
|
|
|
|
{
|
|
|
|
switch (check) {
|
|
|
|
case CHECK_NONE:
|
|
|
|
return 1;
|
|
|
|
case CHECK_SURROUND:
|
|
|
|
return as->ext_id & AC97_EXT_AUDIO_SDAC;
|
|
|
|
case CHECK_CENTER:
|
|
|
|
return as->ext_id & AC97_EXT_AUDIO_CDAC;
|
|
|
|
case CHECK_LFE:
|
|
|
|
return as->ext_id & AC97_EXT_AUDIO_LDAC;
|
2006-07-26 18:44:33 +04:00
|
|
|
case CHECK_SPDIF:
|
|
|
|
return as->ext_id & AC97_EXT_AUDIO_SPDIF;
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
case CHECK_HEADPHONES:
|
|
|
|
return as->caps & AC97_CAPS_HEADPHONES;
|
|
|
|
case CHECK_TONE:
|
|
|
|
return as->caps & AC97_CAPS_TONECTRL;
|
|
|
|
case CHECK_MIC:
|
|
|
|
return as->caps & AC97_CAPS_MICIN;
|
|
|
|
case CHECK_LOUDNESS:
|
|
|
|
return as->caps & AC97_CAPS_LOUDNESS;
|
|
|
|
case CHECK_3D:
|
|
|
|
return AC97_CAPS_ENHANCEMENT(as->caps) != 0;
|
2005-04-08 03:24:05 +04:00
|
|
|
case CHECK_LINE1:
|
|
|
|
return as->ext_mid & AC97_EXT_MODEM_LINE1;
|
|
|
|
case CHECK_LINE2:
|
|
|
|
return as->ext_mid & AC97_EXT_MODEM_LINE2;
|
|
|
|
case CHECK_HANDSET:
|
|
|
|
return as->ext_mid & AC97_EXT_MODEM_HANDSET;
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
default:
|
|
|
|
printf("%s: internal error: feature=%d\n", __func__, check);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static void
|
2003-11-22 08:40:48 +03:00
|
|
|
ac97_setup_source_info(struct ac97_softc *as)
|
1999-10-27 17:18:02 +04:00
|
|
|
{
|
|
|
|
int idx, ouridx;
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
struct ac97_source_info *si, *si2;
|
2006-08-23 15:24:07 +04:00
|
|
|
uint16_t value1, value2, value3;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2005-04-08 03:24:05 +04:00
|
|
|
for (idx = 0, ouridx = 0; idx < SOURCE_INFO_SIZE(as); idx++) {
|
1999-10-27 17:18:02 +04:00
|
|
|
si = &as->source_info[ouridx];
|
2005-04-11 22:26:48 +04:00
|
|
|
if (as->type == AC97_CODEC_TYPE_MODEM) {
|
2005-04-08 03:24:05 +04:00
|
|
|
memcpy(si, &modem_source_info[idx], sizeof(*si));
|
|
|
|
} else {
|
|
|
|
memcpy(si, &audio_source_info[idx], sizeof(*si));
|
|
|
|
}
|
2006-08-23 15:24:07 +04:00
|
|
|
if (!ac97_check_capability(as, si->req_feature))
|
|
|
|
continue;
|
|
|
|
if (si->checkbits) {
|
|
|
|
/* read the register value */
|
|
|
|
ac97_read(as, si->reg, &value1);
|
|
|
|
/* write 0b100000 */
|
|
|
|
value2 = value1 & 0xffc0;
|
|
|
|
value2 |= 0x20;
|
|
|
|
ac97_write(as, si->reg, value2);
|
|
|
|
/* verify */
|
|
|
|
ac97_read(as, si->reg, &value3);
|
|
|
|
if (value2 == value3) {
|
|
|
|
si->bits = 6;
|
|
|
|
} else {
|
|
|
|
si->bits = 5;
|
|
|
|
}
|
|
|
|
DPRINTF(("%s: register=%02x bits=%d\n",
|
|
|
|
__func__, si->reg, si->bits));
|
|
|
|
ac97_write(as, si->reg, value1);
|
|
|
|
}
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
switch (si->type) {
|
|
|
|
case AUDIO_MIXER_CLASS:
|
2002-11-06 16:41:22 +03:00
|
|
|
si->mixer_class = ouridx;
|
1999-10-27 17:18:02 +04:00
|
|
|
ouridx++;
|
|
|
|
break;
|
|
|
|
case AUDIO_MIXER_VALUE:
|
|
|
|
/* Todo - Test to see if it works */
|
|
|
|
ouridx++;
|
|
|
|
|
|
|
|
/* Add an entry for mute, if necessary */
|
|
|
|
if (si->mute) {
|
|
|
|
si = &as->source_info[ouridx];
|
2005-04-11 22:26:48 +04:00
|
|
|
if (as->type == AC97_CODEC_TYPE_MODEM)
|
2005-04-08 03:24:05 +04:00
|
|
|
memcpy(si, &modem_source_info[idx],
|
|
|
|
sizeof(*si));
|
|
|
|
else
|
|
|
|
memcpy(si, &audio_source_info[idx],
|
|
|
|
sizeof(*si));
|
1999-10-27 17:18:02 +04:00
|
|
|
si->qualifier = AudioNmute;
|
|
|
|
si->type = AUDIO_MIXER_ENUM;
|
|
|
|
si->info = &ac97_on_off;
|
|
|
|
si->info_size = sizeof(ac97_on_off);
|
|
|
|
si->bits = 1;
|
|
|
|
si->ofs = 15;
|
|
|
|
si->mute = 0;
|
|
|
|
si->polarity = 0;
|
|
|
|
ouridx++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case AUDIO_MIXER_ENUM:
|
|
|
|
/* Todo - Test to see if it works */
|
|
|
|
ouridx++;
|
|
|
|
break;
|
|
|
|
default:
|
2003-01-31 03:26:25 +03:00
|
|
|
aprint_error ("ac97: shouldn't get here\n");
|
1999-10-27 17:18:02 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
as->num_source_info = ouridx;
|
|
|
|
|
|
|
|
for (idx = 0; idx < as->num_source_info; idx++) {
|
|
|
|
int idx2, previdx;
|
|
|
|
|
|
|
|
si = &as->source_info[idx];
|
|
|
|
|
|
|
|
/* Find mixer class */
|
|
|
|
for (idx2 = 0; idx2 < as->num_source_info; idx2++) {
|
|
|
|
si2 = &as->source_info[idx2];
|
|
|
|
|
2002-11-06 16:41:22 +03:00
|
|
|
if (si2->type == AUDIO_MIXER_CLASS &&
|
1999-10-27 17:18:02 +04:00
|
|
|
ac97_str_equal(si->class,
|
|
|
|
si2->class)) {
|
|
|
|
si->mixer_class = idx2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Setup prev and next pointers */
|
|
|
|
if (si->prev != 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (si->qualifier)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
si->prev = AUDIO_MIXER_LAST;
|
|
|
|
previdx = idx;
|
|
|
|
|
|
|
|
for (idx2 = 0; idx2 < as->num_source_info; idx2++) {
|
|
|
|
if (idx2 == idx)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
si2 = &as->source_info[idx2];
|
|
|
|
|
|
|
|
if (!si2->prev &&
|
|
|
|
ac97_str_equal(si->class, si2->class) &&
|
|
|
|
ac97_str_equal(si->device, si2->device)) {
|
|
|
|
as->source_info[previdx].next = idx2;
|
|
|
|
as->source_info[idx2].prev = previdx;
|
2002-11-06 16:41:22 +03:00
|
|
|
|
1999-10-27 17:18:02 +04:00
|
|
|
previdx = idx2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
as->source_info[previdx].next = AUDIO_MIXER_LAST;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-16 01:18:34 +04:00
|
|
|
/* backward compatibility */
|
2002-10-08 13:19:44 +04:00
|
|
|
int
|
2011-11-24 03:07:28 +04:00
|
|
|
ac97_attach(struct ac97_host_if *host_if, device_t sc_dev, kmutex_t *lk)
|
2005-04-11 22:26:48 +04:00
|
|
|
{
|
2011-11-24 03:07:28 +04:00
|
|
|
return ac97_attach_type(host_if, sc_dev, AC97_CODEC_TYPE_AUDIO, lk);
|
2005-04-11 22:26:48 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2011-11-24 03:07:28 +04:00
|
|
|
ac97_attach_type(struct ac97_host_if *host_if, device_t sc_dev, int type, kmutex_t *lk)
|
1999-10-27 17:18:02 +04:00
|
|
|
{
|
|
|
|
struct ac97_softc *as;
|
|
|
|
int error, i, j;
|
2004-08-20 18:36:13 +04:00
|
|
|
uint32_t id;
|
|
|
|
uint16_t id1, id2;
|
|
|
|
uint16_t extstat, rate;
|
|
|
|
uint16_t val;
|
2000-04-28 16:39:59 +04:00
|
|
|
mixer_ctrl_t ctl;
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
void (*initfunc)(struct ac97_softc *);
|
2003-09-07 15:27:32 +04:00
|
|
|
#define FLAGBUFLEN 140
|
|
|
|
char flagbuf[FLAGBUFLEN];
|
2002-10-08 13:19:44 +04:00
|
|
|
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
initfunc = NULL;
|
2002-01-12 19:03:11 +03:00
|
|
|
as = malloc(sizeof(struct ac97_softc), M_DEVBUF, M_WAITOK|M_ZERO);
|
1999-10-27 17:18:02 +04:00
|
|
|
|
1999-11-02 08:41:27 +03:00
|
|
|
if (as == NULL)
|
2003-11-22 08:40:48 +03:00
|
|
|
return ENOMEM;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2000-11-04 11:07:14 +03:00
|
|
|
as->codec_if.vtbl = &ac97civ;
|
|
|
|
as->host_if = host_if;
|
2005-04-11 22:26:48 +04:00
|
|
|
as->type = type;
|
2011-11-24 03:07:28 +04:00
|
|
|
as->lock = lk;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2000-11-04 11:07:14 +03:00
|
|
|
if ((error = host_if->attach(host_if->arg, &as->codec_if))) {
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
free(as, M_DEVBUF);
|
2003-11-22 08:40:48 +03:00
|
|
|
return error;
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_enter(as->lock);
|
|
|
|
|
2006-04-16 01:18:34 +04:00
|
|
|
if (host_if->reset != NULL) {
|
|
|
|
if ((error = host_if->reset(host_if->arg))) {
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_exit(as->lock);
|
2006-04-16 01:18:34 +04:00
|
|
|
free(as, M_DEVBUF);
|
|
|
|
return error;
|
|
|
|
}
|
2004-09-22 16:20:24 +04:00
|
|
|
}
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2000-11-04 11:07:14 +03:00
|
|
|
if (host_if->flags)
|
|
|
|
as->host_flags = host_if->flags(host_if->arg);
|
2005-05-11 17:13:11 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Assume codec has all four power bits.
|
|
|
|
* XXXSCW: what to do for modems?
|
|
|
|
*/
|
|
|
|
as->power_all = AC97_POWER_REF | AC97_POWER_ANL | AC97_POWER_DAC |
|
|
|
|
AC97_POWER_ADC;
|
2005-04-12 21:28:02 +04:00
|
|
|
if (as->type == AC97_CODEC_TYPE_AUDIO) {
|
|
|
|
host_if->write(host_if->arg, AC97_REG_RESET, 0);
|
2005-05-11 17:13:11 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Power-up everything except the analogue mixer.
|
|
|
|
* If this codec doesn't support analogue mixer power-down,
|
|
|
|
* AC97_POWER_MIXER will read back as zero.
|
|
|
|
*/
|
|
|
|
host_if->write(host_if->arg, AC97_REG_POWER, AC97_POWER_MIXER);
|
|
|
|
ac97_read(as, AC97_REG_POWER, &val);
|
|
|
|
if ((val & AC97_POWER_MIXER) == 0) {
|
|
|
|
/* Codec doesn't support analogue mixer power-down */
|
|
|
|
as->power_all &= ~AC97_POWER_ANL;
|
|
|
|
}
|
2006-04-16 01:18:34 +04:00
|
|
|
host_if->write(host_if->arg, AC97_REG_POWER, POWER_EAMP_ON(as));
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2005-04-12 21:28:02 +04:00
|
|
|
for (i = 500000; i >= 0; i--) {
|
|
|
|
ac97_read(as, AC97_REG_POWER, &val);
|
2005-05-11 17:13:11 +04:00
|
|
|
if ((val & as->power_all) == as->power_all)
|
2005-04-12 21:28:02 +04:00
|
|
|
break;
|
|
|
|
DELAY(1);
|
|
|
|
}
|
2006-04-16 01:18:34 +04:00
|
|
|
|
|
|
|
/* save AC97_REG_POWER so that we can restore it later */
|
|
|
|
ac97_read(as, AC97_REG_POWER, &as->power_reg);
|
2005-04-12 21:28:02 +04:00
|
|
|
} else if (as->type == AC97_CODEC_TYPE_MODEM) {
|
|
|
|
host_if->write(host_if->arg, AC97_REG_EXT_MODEM_ID, 0);
|
|
|
|
}
|
2004-08-20 18:36:13 +04:00
|
|
|
|
2000-11-04 11:07:14 +03:00
|
|
|
ac97_setup_defaults(as);
|
2005-04-12 21:28:02 +04:00
|
|
|
if (as->type == AC97_CODEC_TYPE_AUDIO)
|
|
|
|
ac97_read(as, AC97_REG_RESET, &as->caps);
|
2000-11-05 08:41:25 +03:00
|
|
|
ac97_read(as, AC97_REG_VENDOR_ID1, &id1);
|
|
|
|
ac97_read(as, AC97_REG_VENDOR_ID2, &id2);
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_exit(as->lock);
|
|
|
|
|
1999-10-27 17:18:02 +04:00
|
|
|
id = (id1 << 16) | id2;
|
2008-04-08 16:07:25 +04:00
|
|
|
aprint_normal_dev(sc_dev, "ac97: ");
|
1999-11-02 08:41:27 +03:00
|
|
|
|
|
|
|
for (i = 0; ; i++) {
|
|
|
|
if (ac97codecid[i].id == 0) {
|
1999-11-20 04:16:15 +03:00
|
|
|
char pnp[4];
|
2011-11-27 19:08:04 +04:00
|
|
|
|
2000-04-26 04:00:41 +04:00
|
|
|
AC97_GET_CODEC_ID(id, pnp);
|
1999-11-20 04:16:15 +03:00
|
|
|
#define ISASCII(c) ((c) >= ' ' && (c) < 0x7f)
|
|
|
|
if (ISASCII(pnp[0]) && ISASCII(pnp[1]) &&
|
|
|
|
ISASCII(pnp[2]))
|
2003-01-31 03:26:25 +03:00
|
|
|
aprint_normal("%c%c%c%d",
|
|
|
|
pnp[0], pnp[1], pnp[2], pnp[3]);
|
1999-11-20 04:16:15 +03:00
|
|
|
else
|
2003-01-31 03:26:25 +03:00
|
|
|
aprint_normal("unknown (0x%08x)", id);
|
2000-06-06 21:25:52 +04:00
|
|
|
break;
|
|
|
|
}
|
2002-10-09 16:06:17 +04:00
|
|
|
if (ac97codecid[i].id == (id & ac97codecid[i].mask)) {
|
2003-01-31 03:26:25 +03:00
|
|
|
aprint_normal("%s", ac97codecid[i].name);
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
if (ac97codecid[i].mask == AC97_VENDOR_ID_MASK) {
|
2003-01-31 03:26:25 +03:00
|
|
|
aprint_normal(" (0x%08x)", id);
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
}
|
|
|
|
initfunc = ac97codecid[i].init;
|
1999-11-02 08:41:27 +03:00
|
|
|
break;
|
|
|
|
}
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
2003-01-31 03:26:25 +03:00
|
|
|
aprint_normal(" codec; ");
|
1999-10-27 17:18:02 +04:00
|
|
|
for (i = j = 0; i < 10; i++) {
|
2002-10-08 13:19:44 +04:00
|
|
|
if (as->caps & (1 << i)) {
|
2003-11-22 08:40:48 +03:00
|
|
|
aprint_normal("%s%s", j ? ", " : "", ac97feature[i]);
|
1999-10-27 17:18:02 +04:00
|
|
|
j++;
|
|
|
|
}
|
|
|
|
}
|
2003-01-31 03:26:25 +03:00
|
|
|
aprint_normal("%s%s\n", j ? ", " : "",
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
ac97enhancement[AC97_CAPS_ENHANCEMENT(as->caps)]);
|
2002-10-08 13:19:44 +04:00
|
|
|
|
|
|
|
as->ac97_clock = AC97_STANDARD_CLOCK;
|
2005-04-08 03:24:05 +04:00
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_enter(as->lock);
|
|
|
|
|
2005-04-12 21:28:02 +04:00
|
|
|
if (as->type == AC97_CODEC_TYPE_AUDIO) {
|
|
|
|
ac97_read(as, AC97_REG_EXT_AUDIO_ID, &as->ext_id);
|
|
|
|
if (as->ext_id != 0) {
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_exit(as->lock);
|
|
|
|
|
2005-04-12 21:28:02 +04:00
|
|
|
/* Print capabilities */
|
2008-12-17 01:35:21 +03:00
|
|
|
snprintb(flagbuf, sizeof(flagbuf),
|
|
|
|
"\20\20SECONDARY10\17SECONDARY01"
|
|
|
|
"\14AC97_23\13AC97_22\12AMAP\11LDAC\10SDAC"
|
|
|
|
"\7CDAC\4VRM\3SPDIF\2DRA\1VRA", as->ext_id);
|
2008-04-08 16:07:25 +04:00
|
|
|
aprint_normal_dev(sc_dev, "ac97: ext id %s\n",
|
2005-04-12 21:28:02 +04:00
|
|
|
flagbuf);
|
|
|
|
|
|
|
|
/* Print unusual settings */
|
|
|
|
if (as->ext_id & AC97_EXT_AUDIO_DSA_MASK) {
|
2008-04-08 16:07:25 +04:00
|
|
|
aprint_normal_dev(sc_dev, "ac97: Slot assignment: ");
|
2005-04-12 21:28:02 +04:00
|
|
|
switch (as->ext_id & AC97_EXT_AUDIO_DSA_MASK) {
|
|
|
|
case AC97_EXT_AUDIO_DSA01:
|
|
|
|
aprint_normal("7&8, 6&9, 10&11.\n");
|
|
|
|
break;
|
|
|
|
case AC97_EXT_AUDIO_DSA10:
|
|
|
|
aprint_normal("6&9, 10&11, 3&4.\n");
|
|
|
|
break;
|
|
|
|
case AC97_EXT_AUDIO_DSA11:
|
|
|
|
aprint_normal("10&11, 3&4, 7&8.\n");
|
|
|
|
break;
|
|
|
|
}
|
2003-09-07 15:27:32 +04:00
|
|
|
}
|
2006-04-16 01:18:34 +04:00
|
|
|
if (as->host_flags & AC97_HOST_INVERTED_EAMP) {
|
2008-04-08 16:07:25 +04:00
|
|
|
aprint_normal_dev(sc_dev, "ac97: using inverted "
|
|
|
|
"AC97_POWER_EAMP bit\n");
|
2006-04-16 01:18:34 +04:00
|
|
|
}
|
2002-10-06 20:33:35 +04:00
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_enter(as->lock);
|
|
|
|
|
2005-04-12 21:28:02 +04:00
|
|
|
/* Enable and disable features */
|
|
|
|
ac97_read(as, AC97_REG_EXT_AUDIO_CTRL, &extstat);
|
|
|
|
extstat &= ~AC97_EXT_AUDIO_DRA;
|
|
|
|
if (as->ext_id & AC97_EXT_AUDIO_LDAC)
|
|
|
|
extstat |= AC97_EXT_AUDIO_LDAC;
|
|
|
|
if (as->ext_id & AC97_EXT_AUDIO_SDAC)
|
|
|
|
extstat |= AC97_EXT_AUDIO_SDAC;
|
|
|
|
if (as->ext_id & AC97_EXT_AUDIO_CDAC)
|
|
|
|
extstat |= AC97_EXT_AUDIO_CDAC;
|
|
|
|
if (as->ext_id & AC97_EXT_AUDIO_VRM)
|
|
|
|
extstat |= AC97_EXT_AUDIO_VRM;
|
|
|
|
if (as->ext_id & AC97_EXT_AUDIO_SPDIF) {
|
|
|
|
/* Output the same data as DAC to SPDIF output */
|
|
|
|
extstat &= ~AC97_EXT_AUDIO_SPSA_MASK;
|
|
|
|
extstat |= AC97_EXT_AUDIO_SPSA34;
|
2006-07-26 18:44:33 +04:00
|
|
|
ac97_read(as, AC97_REG_SPDIF_CTRL, &val);
|
|
|
|
val = (val & ~AC97_SPDIF_SPSR_MASK)
|
|
|
|
| AC97_SPDIF_SPSR_48K;
|
|
|
|
ac97_write(as, AC97_REG_SPDIF_CTRL, val);
|
2005-04-12 21:28:02 +04:00
|
|
|
}
|
|
|
|
if (as->ext_id & AC97_EXT_AUDIO_VRA)
|
|
|
|
extstat |= AC97_EXT_AUDIO_VRA;
|
|
|
|
ac97_write(as, AC97_REG_EXT_AUDIO_CTRL, extstat);
|
|
|
|
if (as->ext_id & AC97_EXT_AUDIO_VRA) {
|
|
|
|
/* VRA should be enabled. */
|
|
|
|
/* so it claims to do variable rate, let's make sure */
|
|
|
|
ac97_write(as, AC97_REG_PCM_FRONT_DAC_RATE,
|
|
|
|
44100);
|
|
|
|
ac97_read(as, AC97_REG_PCM_FRONT_DAC_RATE,
|
|
|
|
&rate);
|
|
|
|
if (rate != 44100) {
|
|
|
|
/* We can't believe ext_id */
|
|
|
|
as->ext_id = 0;
|
2011-11-27 19:08:04 +04:00
|
|
|
aprint_normal_dev(sc_dev,
|
2008-04-08 16:07:25 +04:00
|
|
|
"Ignore these capabilities.\n");
|
2005-04-12 21:28:02 +04:00
|
|
|
}
|
|
|
|
/* restore the default value */
|
|
|
|
ac97_write(as, AC97_REG_PCM_FRONT_DAC_RATE,
|
|
|
|
AC97_SINGLE_RATE);
|
2002-10-08 13:19:44 +04:00
|
|
|
}
|
|
|
|
}
|
2005-04-12 21:28:02 +04:00
|
|
|
} else if (as->type == AC97_CODEC_TYPE_MODEM) {
|
2005-06-20 06:49:18 +04:00
|
|
|
const struct sysctlnode *node;
|
|
|
|
const struct sysctlnode *node_line1;
|
|
|
|
const struct sysctlnode *node_line2;
|
2005-05-30 08:43:46 +04:00
|
|
|
uint16_t xrate = 8000;
|
|
|
|
uint16_t xval, reg;
|
2005-04-04 22:52:30 +04:00
|
|
|
int err;
|
2005-04-04 06:08:58 +04:00
|
|
|
|
2005-04-12 21:28:02 +04:00
|
|
|
ac97_read(as, AC97_REG_EXT_MODEM_ID, &as->ext_mid);
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_exit(as->lock);
|
|
|
|
|
2005-04-12 21:28:02 +04:00
|
|
|
if (as->ext_mid == 0 || as->ext_mid == 0xffff) {
|
2008-04-08 16:07:25 +04:00
|
|
|
aprint_normal_dev(sc_dev, "no modem codec found\n");
|
2005-04-12 21:28:02 +04:00
|
|
|
return ENXIO;
|
|
|
|
}
|
2005-04-11 22:26:48 +04:00
|
|
|
as->type = AC97_CODEC_TYPE_MODEM;
|
2005-04-08 03:24:05 +04:00
|
|
|
|
2005-04-04 06:08:58 +04:00
|
|
|
/* Print capabilities */
|
2008-12-17 01:35:21 +03:00
|
|
|
snprintb(flagbuf, sizeof(flagbuf),
|
|
|
|
"\20\5CID2\4CID1\3HANDSET\2LINE2\1LINE1", as->ext_mid);
|
2008-04-08 16:07:25 +04:00
|
|
|
aprint_normal_dev(sc_dev, "ac97: ext mid %s",
|
2005-04-04 06:08:58 +04:00
|
|
|
flagbuf);
|
|
|
|
aprint_normal(", %s codec\n",
|
|
|
|
(as->ext_mid & 0xc000) == 0 ?
|
|
|
|
"primary" : "secondary");
|
|
|
|
|
2005-04-04 22:52:30 +04:00
|
|
|
/* Setup modem and sysctls */
|
|
|
|
err = sysctl_createv(&as->log, 0, NULL, NULL, 0, CTLTYPE_NODE,
|
|
|
|
"hw", NULL, NULL, 0, NULL, 0, CTL_HW,
|
|
|
|
CTL_EOL);
|
|
|
|
if (err != 0)
|
2005-04-12 21:28:02 +04:00
|
|
|
goto setup_modem;
|
2005-04-04 22:52:30 +04:00
|
|
|
err = sysctl_createv(&as->log, 0, NULL, &node, 0,
|
2008-04-08 16:07:25 +04:00
|
|
|
CTLTYPE_NODE, device_xname(sc_dev), NULL,
|
2005-04-04 22:52:30 +04:00
|
|
|
NULL, 0, NULL, 0, CTL_HW, CTL_CREATE,
|
|
|
|
CTL_EOL);
|
|
|
|
if (err != 0)
|
2005-04-12 21:28:02 +04:00
|
|
|
goto setup_modem;
|
|
|
|
setup_modem:
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_enter(as->lock);
|
|
|
|
|
2005-04-12 21:28:02 +04:00
|
|
|
/* reset */
|
|
|
|
ac97_write(as, AC97_REG_EXT_MODEM_ID, 1);
|
|
|
|
|
|
|
|
/* program rates */
|
2005-05-30 08:43:46 +04:00
|
|
|
xval = 0xff00 & ~AC97_EXT_MODEM_CTRL_PRA;
|
2005-04-04 06:08:58 +04:00
|
|
|
if (as->ext_mid & AC97_EXT_MODEM_LINE1) {
|
2005-05-30 08:43:46 +04:00
|
|
|
ac97_write(as, AC97_REG_LINE1_RATE, xrate);
|
|
|
|
xval &= ~(AC97_EXT_MODEM_CTRL_PRC |
|
2005-04-12 21:28:02 +04:00
|
|
|
AC97_EXT_MODEM_CTRL_PRD);
|
2005-04-04 06:08:58 +04:00
|
|
|
}
|
|
|
|
if (as->ext_mid & AC97_EXT_MODEM_LINE2) {
|
2005-05-30 08:43:46 +04:00
|
|
|
ac97_write(as, AC97_REG_LINE2_RATE, xrate);
|
|
|
|
xval &= ~(AC97_EXT_MODEM_CTRL_PRE |
|
2005-04-12 21:28:02 +04:00
|
|
|
AC97_EXT_MODEM_CTRL_PRF);
|
2005-04-04 06:08:58 +04:00
|
|
|
}
|
|
|
|
if (as->ext_mid & AC97_EXT_MODEM_HANDSET) {
|
2005-05-30 08:43:46 +04:00
|
|
|
ac97_write(as, AC97_REG_HANDSET_RATE, xrate);
|
|
|
|
xval &= ~(AC97_EXT_MODEM_CTRL_PRG |
|
2005-04-12 21:28:02 +04:00
|
|
|
AC97_EXT_MODEM_CTRL_PRH);
|
2005-04-04 06:08:58 +04:00
|
|
|
}
|
2005-04-12 21:28:02 +04:00
|
|
|
|
|
|
|
/* power-up everything */
|
|
|
|
ac97_write(as, AC97_REG_EXT_MODEM_CTRL, 0);
|
2005-04-13 01:11:43 +04:00
|
|
|
for (i = 5000; i >= 0; i--) {
|
2005-04-04 22:52:30 +04:00
|
|
|
ac97_read(as, AC97_REG_EXT_MODEM_CTRL, ®);
|
2005-04-12 21:28:02 +04:00
|
|
|
if ((reg & /*XXXval*/0xf) == /*XXXval*/0xf)
|
|
|
|
break;
|
|
|
|
DELAY(1);
|
|
|
|
}
|
2005-04-13 01:11:43 +04:00
|
|
|
if (i <= 0) {
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_exit(as->lock);
|
2005-04-13 01:11:43 +04:00
|
|
|
printf("%s: codec not responding, status=0x%x\n",
|
2008-04-08 16:07:25 +04:00
|
|
|
device_xname(sc_dev), reg);
|
2005-04-13 01:11:43 +04:00
|
|
|
return ENXIO;
|
|
|
|
}
|
2005-04-04 06:08:58 +04:00
|
|
|
|
2005-04-04 22:52:30 +04:00
|
|
|
/* setup sysctls */
|
|
|
|
if (as->ext_mid & AC97_EXT_MODEM_LINE1) {
|
|
|
|
ac97_read(as, AC97_REG_GPIO_CFG, ®);
|
|
|
|
reg &= ~AC97_GPIO_LINE1_OH;
|
|
|
|
ac97_write(as, AC97_REG_GPIO_CFG, reg);
|
|
|
|
ac97_read(as, AC97_REG_GPIO_POLARITY, ®);
|
|
|
|
reg &= ~AC97_GPIO_LINE1_OH;
|
|
|
|
ac97_write(as, AC97_REG_GPIO_POLARITY, reg);
|
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_exit(as->lock);
|
2005-04-04 22:52:30 +04:00
|
|
|
err = sysctl_createv(&as->log, 0, NULL, &node_line1,
|
|
|
|
CTLFLAG_READWRITE, CTLTYPE_INT,
|
|
|
|
"line1",
|
|
|
|
SYSCTL_DESCR("off-hook line1"),
|
2012-06-03 01:36:41 +04:00
|
|
|
ac97_sysctl_verify, 0, (void *)as, 0,
|
2005-04-04 22:52:30 +04:00
|
|
|
CTL_HW, node->sysctl_num,
|
|
|
|
CTL_CREATE, CTL_EOL);
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_enter(as->lock);
|
|
|
|
|
2005-04-04 22:52:30 +04:00
|
|
|
if (err != 0)
|
|
|
|
goto sysctl_err;
|
|
|
|
as->offhook_line1_mib = node_line1->sysctl_num;
|
|
|
|
}
|
|
|
|
if (as->ext_mid & AC97_EXT_MODEM_LINE2) {
|
|
|
|
ac97_read(as, AC97_REG_GPIO_CFG, ®);
|
|
|
|
reg &= ~AC97_GPIO_LINE2_OH;
|
|
|
|
ac97_write(as, AC97_REG_GPIO_CFG, reg);
|
|
|
|
ac97_read(as, AC97_REG_GPIO_POLARITY, ®);
|
|
|
|
reg &= ~AC97_GPIO_LINE2_OH;
|
|
|
|
ac97_write(as, AC97_REG_GPIO_POLARITY, reg);
|
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_exit(as->lock);
|
2005-04-04 22:52:30 +04:00
|
|
|
err = sysctl_createv(&as->log, 0, NULL, &node_line2,
|
|
|
|
CTLFLAG_READWRITE, CTLTYPE_INT,
|
|
|
|
"line2",
|
|
|
|
SYSCTL_DESCR("off-hook line2"),
|
2012-06-03 01:36:41 +04:00
|
|
|
ac97_sysctl_verify, 0, (void *)as, 0,
|
2005-04-04 22:52:30 +04:00
|
|
|
CTL_HW, node->sysctl_num,
|
|
|
|
CTL_CREATE, CTL_EOL);
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_enter(as->lock);
|
|
|
|
|
2005-04-04 22:52:30 +04:00
|
|
|
if (err != 0)
|
|
|
|
goto sysctl_err;
|
|
|
|
as->offhook_line2_mib = node_line2->sysctl_num;
|
|
|
|
}
|
2005-04-12 21:28:02 +04:00
|
|
|
sysctl_err:
|
2005-04-04 22:52:30 +04:00
|
|
|
|
2005-04-04 06:08:58 +04:00
|
|
|
ac97_write(as, AC97_REG_GPIO_STICKY, 0xffff);
|
|
|
|
ac97_write(as, AC97_REG_GPIO_WAKEUP, 0x0);
|
|
|
|
ac97_write(as, AC97_REG_MISC_AFE, 0x0);
|
|
|
|
}
|
|
|
|
|
2005-04-11 22:26:48 +04:00
|
|
|
as->source_info = (as->type == AC97_CODEC_TYPE_MODEM ?
|
2005-04-08 03:24:05 +04:00
|
|
|
as->modem_source_info : as->audio_source_info);
|
1999-10-27 17:18:02 +04:00
|
|
|
ac97_setup_source_info(as);
|
|
|
|
|
2000-04-28 16:39:59 +04:00
|
|
|
memset(&ctl, 0, sizeof(ctl));
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
/* disable mutes */
|
|
|
|
for (i = 0; i < 11; i++) {
|
|
|
|
static struct {
|
2005-05-30 08:43:46 +04:00
|
|
|
const char *class, *device;
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
} d[11] = {
|
|
|
|
{ AudioCoutputs, AudioNmaster},
|
|
|
|
{ AudioCoutputs, AudioNheadphone},
|
|
|
|
{ AudioCoutputs, AudioNsurround},
|
|
|
|
{ AudioCoutputs, AudioNcenter},
|
|
|
|
{ AudioCoutputs, AudioNlfe},
|
|
|
|
{ AudioCinputs, AudioNdac},
|
|
|
|
{ AudioCinputs, AudioNcd},
|
|
|
|
{ AudioCinputs, AudioNline},
|
|
|
|
{ AudioCinputs, AudioNaux},
|
|
|
|
{ AudioCinputs, AudioNvideo},
|
|
|
|
{ AudioCrecord, AudioNvolume},
|
|
|
|
};
|
|
|
|
|
|
|
|
ctl.type = AUDIO_MIXER_ENUM;
|
|
|
|
ctl.un.ord = 0;
|
|
|
|
|
|
|
|
ctl.dev = ac97_get_portnum_by_name(&as->codec_if,
|
|
|
|
d[i].class, d[i].device, AudioNmute);
|
|
|
|
ac97_mixer_set_port(&as->codec_if, &ctl);
|
|
|
|
}
|
2000-04-28 16:39:59 +04:00
|
|
|
ctl.type = AUDIO_MIXER_ENUM;
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
ctl.un.ord = 0;
|
|
|
|
ctl.dev = ac97_get_portnum_by_name(&as->codec_if, AudioCrecord,
|
|
|
|
AudioNsource, NULL);
|
2000-11-04 11:07:14 +03:00
|
|
|
ac97_mixer_set_port(&as->codec_if, &ctl);
|
2000-04-28 16:39:59 +04:00
|
|
|
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
/* set a reasonable default volume */
|
|
|
|
ctl.type = AUDIO_MIXER_VALUE;
|
|
|
|
ctl.un.value.num_channels = 2;
|
|
|
|
ctl.un.value.level[AUDIO_MIXER_LEVEL_LEFT] = \
|
|
|
|
ctl.un.value.level[AUDIO_MIXER_LEVEL_RIGHT] = 127;
|
|
|
|
ctl.dev = ac97_get_portnum_by_name(&as->codec_if, AudioCoutputs,
|
|
|
|
AudioNmaster, NULL);
|
2000-11-04 11:07:14 +03:00
|
|
|
ac97_mixer_set_port(&as->codec_if, &ctl);
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
ctl.dev = ac97_get_portnum_by_name(&as->codec_if, AudioCoutputs,
|
|
|
|
AudioNsurround, NULL);
|
2000-11-04 11:07:14 +03:00
|
|
|
ac97_mixer_set_port(&as->codec_if, &ctl);
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
ctl.un.value.num_channels = 1;
|
|
|
|
ctl.dev = ac97_get_portnum_by_name(&as->codec_if, AudioCoutputs,
|
|
|
|
AudioNcenter, NULL);
|
|
|
|
ac97_mixer_set_port(&as->codec_if, &ctl);
|
|
|
|
ctl.dev = ac97_get_portnum_by_name(&as->codec_if, AudioCoutputs,
|
|
|
|
AudioNlfe, NULL);
|
2000-11-04 11:07:14 +03:00
|
|
|
ac97_mixer_set_port(&as->codec_if, &ctl);
|
2000-04-28 16:39:59 +04:00
|
|
|
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
if (initfunc != NULL)
|
|
|
|
initfunc(as);
|
2006-04-16 01:18:34 +04:00
|
|
|
|
|
|
|
/* restore AC97_REG_POWER */
|
|
|
|
if (as->type == AC97_CODEC_TYPE_AUDIO)
|
|
|
|
ac97_write(as, AC97_REG_POWER, as->power_reg);
|
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_exit(as->lock);
|
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
return 0;
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
2004-11-08 17:24:17 +03:00
|
|
|
static void
|
|
|
|
ac97_detach(struct ac97_codec_if *codec_if)
|
|
|
|
{
|
|
|
|
struct ac97_softc *as;
|
|
|
|
|
|
|
|
as = (struct ac97_softc *)codec_if;
|
2011-11-24 03:07:28 +04:00
|
|
|
|
|
|
|
mutex_enter(as->lock);
|
2004-11-08 17:24:17 +03:00
|
|
|
ac97_write(as, AC97_REG_POWER, AC97_POWER_IN | AC97_POWER_OUT
|
|
|
|
| AC97_POWER_MIXER | AC97_POWER_MIXER_VREF
|
|
|
|
| AC97_POWER_ACLINK | AC97_POWER_CLK | AC97_POWER_AUX
|
2006-04-16 01:18:34 +04:00
|
|
|
| POWER_EAMP_OFF(as));
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_exit(as->lock);
|
|
|
|
|
2004-11-08 17:24:17 +03:00
|
|
|
free(as, M_DEVBUF);
|
|
|
|
}
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2006-07-26 18:44:33 +04:00
|
|
|
static void
|
|
|
|
ac97_lock(struct ac97_codec_if *codec_if)
|
|
|
|
{
|
|
|
|
struct ac97_softc *as;
|
|
|
|
|
|
|
|
as = (struct ac97_softc *)codec_if;
|
2011-11-24 03:07:28 +04:00
|
|
|
|
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2006-07-26 18:44:33 +04:00
|
|
|
as->lock_counter++;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ac97_unlock(struct ac97_codec_if *codec_if)
|
|
|
|
{
|
|
|
|
struct ac97_softc *as;
|
|
|
|
|
|
|
|
as = (struct ac97_softc *)codec_if;
|
2011-11-24 03:07:28 +04:00
|
|
|
|
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2006-07-26 18:44:33 +04:00
|
|
|
as->lock_counter--;
|
|
|
|
}
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static int
|
2003-11-22 08:40:48 +03:00
|
|
|
ac97_query_devinfo(struct ac97_codec_if *codec_if, mixer_devinfo_t *dip)
|
1999-10-27 17:18:02 +04:00
|
|
|
{
|
2003-11-22 08:40:48 +03:00
|
|
|
struct ac97_softc *as;
|
|
|
|
struct ac97_source_info *si;
|
|
|
|
const char *name;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
as = (struct ac97_softc *)codec_if;
|
1999-10-27 17:18:02 +04:00
|
|
|
if (dip->index < as->num_source_info) {
|
2003-11-22 08:40:48 +03:00
|
|
|
si = &as->source_info[dip->index];
|
1999-10-27 17:18:02 +04:00
|
|
|
dip->type = si->type;
|
|
|
|
dip->mixer_class = si->mixer_class;
|
|
|
|
dip->prev = si->prev;
|
|
|
|
dip->next = si->next;
|
2002-11-06 16:41:22 +03:00
|
|
|
|
1999-10-27 17:18:02 +04:00
|
|
|
if (si->qualifier)
|
|
|
|
name = si->qualifier;
|
|
|
|
else if (si->device)
|
|
|
|
name = si->device;
|
|
|
|
else if (si->class)
|
|
|
|
name = si->class;
|
2000-03-16 01:41:29 +03:00
|
|
|
else
|
|
|
|
name = 0;
|
2002-11-06 16:41:22 +03:00
|
|
|
|
1999-10-27 17:18:02 +04:00
|
|
|
if (name)
|
|
|
|
strcpy(dip->label.name, name);
|
|
|
|
|
2001-07-07 19:56:07 +04:00
|
|
|
memcpy(&dip->un, si->info, si->info_size);
|
2001-04-29 06:47:25 +04:00
|
|
|
|
|
|
|
/* Set the delta for volume sources */
|
|
|
|
if (dip->type == AUDIO_MIXER_VALUE)
|
|
|
|
dip->un.v.delta = 1 << (8 - si->bits);
|
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
return 0;
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
return ENXIO;
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static int
|
2003-11-22 08:40:48 +03:00
|
|
|
ac97_mixer_set_port(struct ac97_codec_if *codec_if, mixer_ctrl_t *cp)
|
1999-10-27 17:18:02 +04:00
|
|
|
{
|
2003-11-22 08:40:48 +03:00
|
|
|
struct ac97_softc *as;
|
|
|
|
struct ac97_source_info *si;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
uint16_t mask;
|
|
|
|
uint16_t val, newval;
|
1999-10-27 17:18:02 +04:00
|
|
|
int error;
|
2007-02-22 01:59:35 +03:00
|
|
|
bool spdif;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
as = (struct ac97_softc *)codec_if;
|
2011-11-24 03:07:28 +04:00
|
|
|
|
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
1999-10-27 17:18:02 +04:00
|
|
|
if (cp->dev < 0 || cp->dev >= as->num_source_info)
|
2003-11-22 08:40:48 +03:00
|
|
|
return EINVAL;
|
2006-07-26 18:44:33 +04:00
|
|
|
si = &as->source_info[cp->dev];
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2006-07-26 18:44:33 +04:00
|
|
|
if (cp->type == AUDIO_MIXER_CLASS || cp->type != si->type)
|
2003-11-22 08:40:48 +03:00
|
|
|
return EINVAL;
|
2006-07-26 18:44:33 +04:00
|
|
|
spdif = si->req_feature == CHECK_SPDIF && si->reg == AC97_REG_EXT_AUDIO_CTRL;
|
|
|
|
if (spdif && as->lock_counter >= 0) {
|
|
|
|
/* When the value of lock_counter is the default 0,
|
|
|
|
* it is not allowed to change the SPDIF mode. */
|
|
|
|
return EBUSY;
|
|
|
|
}
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2000-11-05 08:41:25 +03:00
|
|
|
ac97_read(as, si->reg, &val);
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
DPRINTFN(5, ("read(%x) = %x\n", si->reg, val));
|
|
|
|
|
|
|
|
mask = (1 << si->bits) - 1;
|
|
|
|
|
|
|
|
switch (cp->type) {
|
|
|
|
case AUDIO_MIXER_ENUM:
|
|
|
|
if (cp->un.ord > mask || cp->un.ord < 0)
|
2003-11-22 08:40:48 +03:00
|
|
|
return EINVAL;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
newval = (cp->un.ord << si->ofs);
|
|
|
|
if (si->reg == AC97_REG_RECORD_SELECT) {
|
|
|
|
newval |= (newval << (8 + si->ofs));
|
|
|
|
mask |= (mask << 8);
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
mask = mask << si->ofs;
|
|
|
|
} else if (si->reg == AC97_REG_SURR_MASTER) {
|
|
|
|
newval = cp->un.ord ? 0x8080 : 0x0000;
|
|
|
|
mask = 0x8080;
|
|
|
|
} else
|
|
|
|
mask = mask << si->ofs;
|
1999-10-27 17:18:02 +04:00
|
|
|
break;
|
|
|
|
case AUDIO_MIXER_VALUE:
|
|
|
|
{
|
2001-01-18 23:28:15 +03:00
|
|
|
const struct audio_mixer_value *value = si->info;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
uint16_t l, r, ol, or;
|
2003-09-29 02:24:09 +04:00
|
|
|
int deltal, deltar;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
if ((cp->un.value.num_channels <= 0) ||
|
2002-11-06 16:41:22 +03:00
|
|
|
(cp->un.value.num_channels > value->num_channels))
|
2003-11-22 08:40:48 +03:00
|
|
|
return EINVAL;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
if (cp->un.value.num_channels == 1) {
|
|
|
|
l = r = cp->un.value.level[AUDIO_MIXER_LEVEL_MONO];
|
|
|
|
} else {
|
2001-01-10 02:14:25 +03:00
|
|
|
if (!(as->host_flags & AC97_HOST_SWAPPED_CHANNELS)) {
|
|
|
|
l = cp->un.value.level[AUDIO_MIXER_LEVEL_LEFT];
|
|
|
|
r = cp->un.value.level[AUDIO_MIXER_LEVEL_RIGHT];
|
|
|
|
} else { /* left/right is reversed here */
|
|
|
|
r = cp->un.value.level[AUDIO_MIXER_LEVEL_LEFT];
|
|
|
|
l = cp->un.value.level[AUDIO_MIXER_LEVEL_RIGHT];
|
|
|
|
}
|
|
|
|
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!si->polarity) {
|
|
|
|
l = 255 - l;
|
|
|
|
r = 255 - r;
|
|
|
|
}
|
2002-11-06 16:41:22 +03:00
|
|
|
|
2003-09-29 02:24:09 +04:00
|
|
|
ol = (val >> (8+si->ofs)) & mask;
|
|
|
|
or = (val >> si->ofs) & mask;
|
|
|
|
|
|
|
|
deltal = (ol << (8 - si->bits)) - l;
|
|
|
|
deltar = (or << (8 - si->bits)) - r;
|
|
|
|
|
1999-10-27 17:18:02 +04:00
|
|
|
l = l >> (8 - si->bits);
|
|
|
|
r = r >> (8 - si->bits);
|
|
|
|
|
2003-09-29 02:24:09 +04:00
|
|
|
if (deltal && ol == l)
|
|
|
|
l += (deltal > 0) ? (l ? -1 : 0) : (l < mask ? 1 : 0);
|
|
|
|
if (deltar && or == r)
|
|
|
|
r += (deltar > 0) ? (r ? -1 : 0) : (r < mask ? 1 : 0);
|
|
|
|
|
|
|
|
newval = ((r & mask) << si->ofs);
|
1999-10-27 17:18:02 +04:00
|
|
|
if (value->num_channels == 2) {
|
2003-09-29 02:24:09 +04:00
|
|
|
newval = newval | ((l & mask) << (si->ofs+8));
|
1999-10-27 17:18:02 +04:00
|
|
|
mask |= (mask << 8);
|
|
|
|
}
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
mask = mask << si->ofs;
|
1999-10-27 17:18:02 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2003-11-22 08:40:48 +03:00
|
|
|
return EINVAL;
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
2000-11-05 08:41:25 +03:00
|
|
|
error = ac97_write(as, si->reg, (val & ~mask) | newval);
|
1999-10-27 17:18:02 +04:00
|
|
|
if (error)
|
2003-11-22 08:40:48 +03:00
|
|
|
return error;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2006-07-26 18:44:33 +04:00
|
|
|
if (spdif && as->host_if->spdif_event != NULL) {
|
|
|
|
DPRINTF(("%s: call spdif_event(%d)\n", __func__, cp->un.ord));
|
|
|
|
as->host_if->spdif_event(as->host_if->arg, cp->un.ord);
|
|
|
|
}
|
2003-11-22 08:40:48 +03:00
|
|
|
return 0;
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static int
|
2003-11-22 08:40:48 +03:00
|
|
|
ac97_get_portnum_by_name(struct ac97_codec_if *codec_if, const char *class,
|
|
|
|
const char *device, const char *qualifier)
|
1999-10-27 17:18:02 +04:00
|
|
|
{
|
2003-11-22 08:40:48 +03:00
|
|
|
struct ac97_softc *as;
|
1999-10-27 17:18:02 +04:00
|
|
|
int idx;
|
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
as = (struct ac97_softc *)codec_if;
|
2011-11-24 03:07:28 +04:00
|
|
|
|
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
1999-10-27 17:18:02 +04:00
|
|
|
for (idx = 0; idx < as->num_source_info; idx++) {
|
|
|
|
struct ac97_source_info *si = &as->source_info[idx];
|
|
|
|
if (ac97_str_equal(class, si->class) &&
|
|
|
|
ac97_str_equal(device, si->device) &&
|
|
|
|
ac97_str_equal(qualifier, si->qualifier))
|
2003-11-22 08:40:48 +03:00
|
|
|
return idx;
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
return -1;
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static int
|
2003-11-22 08:40:48 +03:00
|
|
|
ac97_mixer_get_port(struct ac97_codec_if *codec_if, mixer_ctrl_t *cp)
|
1999-10-27 17:18:02 +04:00
|
|
|
{
|
2003-11-22 08:40:48 +03:00
|
|
|
struct ac97_softc *as;
|
|
|
|
struct ac97_source_info *si;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
uint16_t mask;
|
|
|
|
uint16_t val;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
as = (struct ac97_softc *)codec_if;
|
2011-11-24 03:07:28 +04:00
|
|
|
|
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
si = &as->source_info[cp->dev];
|
1999-10-27 17:18:02 +04:00
|
|
|
if (cp->dev < 0 || cp->dev >= as->num_source_info)
|
2003-11-22 08:40:48 +03:00
|
|
|
return EINVAL;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
if (cp->type != si->type)
|
2003-11-22 08:40:48 +03:00
|
|
|
return EINVAL;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
2000-11-05 08:41:25 +03:00
|
|
|
ac97_read(as, si->reg, &val);
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
DPRINTFN(5, ("read(%x) = %x\n", si->reg, val));
|
|
|
|
|
|
|
|
mask = (1 << si->bits) - 1;
|
|
|
|
|
|
|
|
switch (cp->type) {
|
|
|
|
case AUDIO_MIXER_ENUM:
|
|
|
|
cp->un.ord = (val >> si->ofs) & mask;
|
2002-11-06 16:41:22 +03:00
|
|
|
DPRINTFN(4, ("AUDIO_MIXER_ENUM: %x %d %x %d\n",
|
|
|
|
val, si->ofs, mask, cp->un.ord));
|
1999-10-27 17:18:02 +04:00
|
|
|
break;
|
|
|
|
case AUDIO_MIXER_VALUE:
|
|
|
|
{
|
2001-01-18 23:28:15 +03:00
|
|
|
const struct audio_mixer_value *value = si->info;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
uint16_t l, r;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
if ((cp->un.value.num_channels <= 0) ||
|
2002-11-06 16:41:22 +03:00
|
|
|
(cp->un.value.num_channels > value->num_channels))
|
2003-11-22 08:40:48 +03:00
|
|
|
return EINVAL;
|
1999-10-27 17:18:02 +04:00
|
|
|
|
|
|
|
if (value->num_channels == 1) {
|
|
|
|
l = r = (val >> si->ofs) & mask;
|
|
|
|
} else {
|
2001-01-10 02:14:25 +03:00
|
|
|
if (!(as->host_flags & AC97_HOST_SWAPPED_CHANNELS)) {
|
|
|
|
l = (val >> (si->ofs + 8)) & mask;
|
2002-11-06 19:58:37 +03:00
|
|
|
r = (val >> si->ofs) & mask;
|
|
|
|
} else { /* host has reversed channels */
|
|
|
|
r = (val >> (si->ofs + 8)) & mask;
|
|
|
|
l = (val >> si->ofs) & mask;
|
2001-01-10 02:14:25 +03:00
|
|
|
}
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
l = (l << (8 - si->bits));
|
|
|
|
r = (r << (8 - si->bits));
|
|
|
|
if (!si->polarity) {
|
|
|
|
l = 255 - l;
|
|
|
|
r = 255 - r;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The EAP driver averages l and r for stereo
|
|
|
|
channels that are requested in MONO mode. Does this
|
|
|
|
make sense? */
|
|
|
|
if (cp->un.value.num_channels == 1) {
|
|
|
|
cp->un.value.level[AUDIO_MIXER_LEVEL_MONO] = l;
|
|
|
|
} else if (cp->un.value.num_channels == 2) {
|
|
|
|
cp->un.value.level[AUDIO_MIXER_LEVEL_LEFT] = l;
|
|
|
|
cp->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] = r;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2003-11-22 08:40:48 +03:00
|
|
|
return EINVAL;
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
2003-11-22 08:40:48 +03:00
|
|
|
return 0;
|
1999-10-27 17:18:02 +04:00
|
|
|
}
|
|
|
|
|
2002-10-08 13:19:44 +04:00
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static int
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
ac97_set_rate(struct ac97_codec_if *codec_if, int target, u_int *rate)
|
2002-10-08 13:19:44 +04:00
|
|
|
{
|
|
|
|
struct ac97_softc *as;
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
u_int value;
|
|
|
|
uint16_t ext_stat;
|
|
|
|
uint16_t actual;
|
|
|
|
uint16_t power;
|
|
|
|
uint16_t power_bit;
|
2002-10-08 13:19:44 +04:00
|
|
|
|
|
|
|
as = (struct ac97_softc *)codec_if;
|
2011-11-24 03:07:28 +04:00
|
|
|
|
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2002-10-08 16:33:34 +04:00
|
|
|
if (target == AC97_REG_PCM_MIC_ADC_RATE) {
|
|
|
|
if (!(as->ext_id & AC97_EXT_AUDIO_VRM)) {
|
|
|
|
*rate = AC97_SINGLE_RATE;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (!(as->ext_id & AC97_EXT_AUDIO_VRA)) {
|
|
|
|
*rate = AC97_SINGLE_RATE;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2002-10-08 13:19:44 +04:00
|
|
|
value = *rate * AC97_STANDARD_CLOCK / as->ac97_clock;
|
|
|
|
ext_stat = 0;
|
|
|
|
/*
|
|
|
|
* PCM_FRONT_DAC_RATE/PCM_SURR_DAC_RATE/PCM_LFE_DAC_RATE
|
|
|
|
* Check VRA, DRA
|
|
|
|
* PCM_LR_ADC_RATE
|
|
|
|
* Check VRA
|
|
|
|
* PCM_MIC_ADC_RATE
|
|
|
|
* Check VRM
|
|
|
|
*/
|
|
|
|
switch (target) {
|
|
|
|
case AC97_REG_PCM_FRONT_DAC_RATE:
|
|
|
|
case AC97_REG_PCM_SURR_DAC_RATE:
|
|
|
|
case AC97_REG_PCM_LFE_DAC_RATE:
|
|
|
|
power_bit = AC97_POWER_OUT;
|
|
|
|
if (!(as->ext_id & AC97_EXT_AUDIO_VRA)) {
|
|
|
|
*rate = AC97_SINGLE_RATE;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (as->ext_id & AC97_EXT_AUDIO_DRA) {
|
|
|
|
ac97_read(as, AC97_REG_EXT_AUDIO_CTRL, &ext_stat);
|
|
|
|
if (value > 0x1ffff) {
|
|
|
|
return EINVAL;
|
|
|
|
} else if (value > 0xffff) {
|
|
|
|
/* Enable DRA */
|
|
|
|
ext_stat |= AC97_EXT_AUDIO_DRA;
|
|
|
|
ac97_write(as, AC97_REG_EXT_AUDIO_CTRL, ext_stat);
|
|
|
|
value /= 2;
|
|
|
|
} else {
|
|
|
|
/* Disable DRA */
|
|
|
|
ext_stat &= ~AC97_EXT_AUDIO_DRA;
|
|
|
|
ac97_write(as, AC97_REG_EXT_AUDIO_CTRL, ext_stat);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (value > 0xffff)
|
|
|
|
return EINVAL;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case AC97_REG_PCM_LR_ADC_RATE:
|
|
|
|
power_bit = AC97_POWER_IN;
|
|
|
|
if (!(as->ext_id & AC97_EXT_AUDIO_VRA)) {
|
|
|
|
*rate = AC97_SINGLE_RATE;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (value > 0xffff)
|
|
|
|
return EINVAL;
|
|
|
|
break;
|
|
|
|
case AC97_REG_PCM_MIC_ADC_RATE:
|
|
|
|
power_bit = AC97_POWER_IN;
|
|
|
|
if (!(as->ext_id & AC97_EXT_AUDIO_VRM)) {
|
|
|
|
*rate = AC97_SINGLE_RATE;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (value > 0xffff)
|
|
|
|
return EINVAL;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf("%s: Unknown register: 0x%x\n", __func__, target);
|
|
|
|
return EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ac97_read(as, AC97_REG_POWER, &power);
|
|
|
|
ac97_write(as, AC97_REG_POWER, power | power_bit);
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
ac97_write(as, target, (uint16_t)value);
|
2002-10-08 13:19:44 +04:00
|
|
|
ac97_read(as, target, &actual);
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
actual = (uint32_t)actual * as->ac97_clock / AC97_STANDARD_CLOCK;
|
2002-10-08 13:19:44 +04:00
|
|
|
|
|
|
|
ac97_write(as, AC97_REG_POWER, power);
|
|
|
|
if (ext_stat & AC97_EXT_AUDIO_DRA) {
|
|
|
|
*rate = actual * 2;
|
|
|
|
} else {
|
|
|
|
*rate = actual;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static void
|
2002-10-08 13:19:44 +04:00
|
|
|
ac97_set_clock(struct ac97_codec_if *codec_if, unsigned int clock)
|
|
|
|
{
|
|
|
|
struct ac97_softc *as;
|
|
|
|
|
|
|
|
as = (struct ac97_softc *)codec_if;
|
2011-11-24 03:07:28 +04:00
|
|
|
|
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2002-10-08 13:19:44 +04:00
|
|
|
as->ac97_clock = clock;
|
|
|
|
}
|
|
|
|
|
merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework
Summary of changes:
* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.
* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t
* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.
* add `struct device *' parameter to ac97_attach()
* all of audio HW drivers follow audio_hw_if and ac97 changes
2005-01-11 01:01:36 +03:00
|
|
|
static uint16_t
|
2002-10-08 13:19:44 +04:00
|
|
|
ac97_get_extcaps(struct ac97_codec_if *codec_if)
|
|
|
|
{
|
|
|
|
struct ac97_softc *as;
|
|
|
|
|
|
|
|
as = (struct ac97_softc *)codec_if;
|
2011-11-24 03:07:28 +04:00
|
|
|
|
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2002-10-08 13:19:44 +04:00
|
|
|
return as->ext_id;
|
|
|
|
}
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
|
2004-08-24 04:53:28 +04:00
|
|
|
static int
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
ac97_add_port(struct ac97_softc *as, const struct ac97_source_info *src)
|
|
|
|
{
|
|
|
|
struct ac97_source_info *si;
|
|
|
|
int ouridx, idx;
|
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2005-04-11 22:26:48 +04:00
|
|
|
if ((as->type == AC97_CODEC_TYPE_AUDIO &&
|
2005-04-08 03:24:05 +04:00
|
|
|
as->num_source_info >= AUDIO_MAX_SOURCES) ||
|
2005-04-11 22:26:48 +04:00
|
|
|
(as->type == AC97_CODEC_TYPE_MODEM &&
|
2005-04-08 03:24:05 +04:00
|
|
|
as->num_source_info >= MODEM_MAX_SOURCES)) {
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
printf("%s: internal error: increase MAX_SOURCES in %s\n",
|
|
|
|
__func__, __FILE__);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (!ac97_check_capability(as, src->req_feature))
|
|
|
|
return -1;
|
|
|
|
ouridx = as->num_source_info;
|
|
|
|
si = &as->source_info[ouridx];
|
|
|
|
memcpy(si, src, sizeof(*si));
|
|
|
|
|
|
|
|
switch (si->type) {
|
|
|
|
case AUDIO_MIXER_CLASS:
|
|
|
|
case AUDIO_MIXER_VALUE:
|
|
|
|
printf("%s: adding class/value is not supported yet.\n",
|
|
|
|
__func__);
|
|
|
|
return -1;
|
|
|
|
case AUDIO_MIXER_ENUM:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf("%s: unknown type: %d\n", __func__, si->type);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
as->num_source_info++;
|
|
|
|
|
|
|
|
si->mixer_class = ac97_get_portnum_by_name(&as->codec_if, si->class,
|
|
|
|
NULL, NULL);
|
|
|
|
/* Find the root of the device */
|
|
|
|
idx = ac97_get_portnum_by_name(&as->codec_if, si->class,
|
|
|
|
si->device, NULL);
|
|
|
|
/* Find the last item */
|
|
|
|
while (as->source_info[idx].next != AUDIO_MIXER_LAST)
|
|
|
|
idx = as->source_info[idx].next;
|
|
|
|
/* Append */
|
|
|
|
as->source_info[idx].next = ouridx;
|
|
|
|
si->prev = idx;
|
|
|
|
si->next = AUDIO_MIXER_LAST;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-06-13 09:31:29 +04:00
|
|
|
/**
|
|
|
|
* Codec-dependent initialization
|
|
|
|
*/
|
|
|
|
|
2003-09-08 17:58:21 +04:00
|
|
|
#define AD1980_REG_MISC 0x76
|
2004-08-07 21:37:31 +04:00
|
|
|
#define AD1980_MISC_MBG0 0x0001 /* 0 1888/1980/1981 /1985 */
|
|
|
|
#define AD1980_MISC_MBG1 0x0002 /* 1 1888/1980/1981 /1985 */
|
|
|
|
#define AD1980_MISC_VREFD 0x0004 /* 2 1888/1980/1981 /1985 */
|
|
|
|
#define AD1980_MISC_VREFH 0x0008 /* 3 1888/1980/1981 /1985 */
|
|
|
|
#define AD1980_MISC_SRU 0x0010 /* 4 1888/1980 /1985 */
|
|
|
|
#define AD1980_MISC_LOSEL 0x0020 /* 5 1888/1980/1981 /1985 */
|
|
|
|
#define AD1980_MISC_2CMIC 0x0040 /* 6 1980/1981B/1985 */
|
|
|
|
#define AD1980_MISC_SPRD 0x0080 /* 7 1888/1980 /1985 */
|
|
|
|
#define AD1980_MISC_DMIX0 0x0100 /* 8 1888/1980 /1985 */
|
|
|
|
#define AD1980_MISC_DMIX1 0x0200 /* 9 1888/1980 /1985 */
|
|
|
|
#define AD1980_MISC_HPSEL 0x0400 /*10 1888/1980 /1985 */
|
|
|
|
#define AD1980_MISC_CLDIS 0x0800 /*11 1888/1980 /1985 */
|
|
|
|
#define AD1980_MISC_LODIS 0x1000 /*12 1888/1980/1981 /1985 */
|
|
|
|
#define AD1980_MISC_MSPLT 0x2000 /*13 1888/1980/1981 /1985 */
|
|
|
|
#define AD1980_MISC_AC97NC 0x4000 /*14 1888/1980 /1985 */
|
|
|
|
#define AD1980_MISC_DACZ 0x8000 /*15 1888/1980/1981 /1985 */
|
2003-09-08 17:58:21 +04:00
|
|
|
#define AD1981_REG_MISC 0x76
|
2004-08-07 21:37:31 +04:00
|
|
|
#define AD1981_MISC_MADST 0x0010 /* 4 */
|
|
|
|
#define AD1981A_MISC_MADPD 0x0040 /* 6 */
|
|
|
|
#define AD1981B_MISC_MADPD 0x0080 /* 7 */
|
|
|
|
#define AD1981_MISC_FMXE 0x0200 /* 9 */
|
|
|
|
#define AD1981_MISC_DAM 0x0800 /*11 */
|
2003-06-13 09:31:29 +04:00
|
|
|
static void
|
2003-11-22 09:15:29 +03:00
|
|
|
ac97_ad198x_init(struct ac97_softc *as)
|
2003-06-13 09:31:29 +04:00
|
|
|
{
|
2003-09-11 13:21:29 +04:00
|
|
|
int i;
|
2004-08-07 21:37:31 +04:00
|
|
|
uint16_t misc;
|
2003-06-13 09:31:29 +04:00
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2003-09-08 17:58:21 +04:00
|
|
|
ac97_read(as, AD1980_REG_MISC, &misc);
|
|
|
|
ac97_write(as, AD1980_REG_MISC,
|
|
|
|
misc | AD1980_MISC_LOSEL | AD1980_MISC_HPSEL);
|
2003-09-11 13:21:29 +04:00
|
|
|
|
|
|
|
for (i = 0; i < as->num_source_info; i++) {
|
|
|
|
if (as->source_info[i].type != AUDIO_MIXER_VALUE)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (as->source_info[i].reg == AC97_REG_MASTER_VOLUME)
|
|
|
|
as->source_info[i].reg = AC97_REG_SURR_MASTER;
|
|
|
|
else if (as->source_info[i].reg == AC97_REG_SURR_MASTER)
|
|
|
|
as->source_info[i].reg = AC97_REG_MASTER_VOLUME;
|
|
|
|
}
|
2003-06-13 09:31:29 +04:00
|
|
|
}
|
|
|
|
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
#define ALC650_REG_MULTI_CHANNEL_CONTROL 0x6a
|
|
|
|
#define ALC650_MCC_SLOT_MODIFY_MASK 0xc000
|
2002-10-22 17:48:30 +04:00
|
|
|
#define ALC650_MCC_FRONTDAC_FROM_SPDIFIN 0x2000 /* 13 */
|
|
|
|
#define ALC650_MCC_SPDIFOUT_FROM_ADC 0x1000 /* 12 */
|
|
|
|
#define ALC650_MCC_PCM_FROM_SPDIFIN 0x0800 /* 11 */
|
|
|
|
#define ALC650_MCC_MIC_OR_CENTERLFE 0x0400 /* 10 */
|
|
|
|
#define ALC650_MCC_LINEIN_OR_SURROUND 0x0200 /* 9 */
|
|
|
|
#define ALC650_MCC_INDEPENDENT_MASTER_L 0x0080 /* 7 */
|
|
|
|
#define ALC650_MCC_INDEPENDENT_MASTER_R 0x0040 /* 6 */
|
|
|
|
#define ALC650_MCC_ANALOG_TO_CENTERLFE 0x0020 /* 5 */
|
|
|
|
#define ALC650_MCC_ANALOG_TO_SURROUND 0x0010 /* 4 */
|
|
|
|
#define ALC650_MCC_EXCHANGE_CENTERLFE 0x0008 /* 3 */
|
|
|
|
#define ALC650_MCC_CENTERLFE_DOWNMIX 0x0004 /* 2 */
|
|
|
|
#define ALC650_MCC_SURROUND_DOWNMIX 0x0002 /* 1 */
|
|
|
|
#define ALC650_MCC_LINEOUT_TO_SURROUND 0x0001 /* 0 */
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
static void
|
|
|
|
ac97_alc650_init(struct ac97_softc *as)
|
|
|
|
{
|
2002-10-22 17:48:30 +04:00
|
|
|
static const struct ac97_source_info sources[6] = {
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCoutputs, AudioNsurround, "lineinjack",
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
|
|
|
ALC650_REG_MULTI_CHANNEL_CONTROL,
|
2006-09-02 21:02:57 +04:00
|
|
|
0x0000, 1, 9, 0, 0, 0, CHECK_SURROUND, 0, 0, 0, },
|
2002-10-22 17:48:30 +04:00
|
|
|
{ AudioCoutputs, AudioNsurround, "mixtofront",
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
|
|
|
ALC650_REG_MULTI_CHANNEL_CONTROL,
|
2006-09-02 21:02:57 +04:00
|
|
|
0x0000, 1, 1, 0, 0, 0, CHECK_SURROUND, 0, 0, 0, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCoutputs, AudioNcenter, "micjack",
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
|
|
|
ALC650_REG_MULTI_CHANNEL_CONTROL,
|
2006-09-02 21:02:57 +04:00
|
|
|
0x0000, 1, 10, 0, 0, 0, CHECK_CENTER, 0, 0, 0, },
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
{ AudioCoutputs, AudioNlfe, "micjack",
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
|
|
|
ALC650_REG_MULTI_CHANNEL_CONTROL,
|
2006-09-02 21:02:57 +04:00
|
|
|
0x0000, 1, 10, 0, 0, 0, CHECK_LFE, 0, 0, 0, },
|
2002-10-22 17:48:30 +04:00
|
|
|
{ AudioCoutputs, AudioNcenter, "mixtofront",
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
|
|
|
ALC650_REG_MULTI_CHANNEL_CONTROL,
|
2006-09-02 21:02:57 +04:00
|
|
|
0x0000, 1, 2, 0, 0, 0, CHECK_CENTER, 0, 0, 0, },
|
2002-10-22 17:48:30 +04:00
|
|
|
{ AudioCoutputs, AudioNlfe, "mixtofront",
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
|
|
|
ALC650_REG_MULTI_CHANNEL_CONTROL,
|
2006-09-02 21:02:57 +04:00
|
|
|
0x0000, 1, 2, 0, 0, 0, CHECK_LFE, 0, 0, 0, },
|
2002-10-22 17:48:30 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
ac97_add_port(as, &sources[0]);
|
|
|
|
ac97_add_port(as, &sources[1]);
|
|
|
|
ac97_add_port(as, &sources[2]);
|
|
|
|
ac97_add_port(as, &sources[3]);
|
|
|
|
ac97_add_port(as, &sources[4]);
|
|
|
|
ac97_add_port(as, &sources[5]);
|
|
|
|
}
|
|
|
|
|
2009-07-13 16:54:11 +04:00
|
|
|
#define UCB1400_REG_FEATURE_CSR1 0x6a
|
|
|
|
#define UCB1400_BB(bb) (((bb) & 0xf) << 11)
|
|
|
|
#define UCB1400_TR(tr) (((tr) & 0x3) << 9)
|
|
|
|
#define UCB1400_M_MAXIMUM (3 << 7)
|
|
|
|
#define UCB1400_M_MINIMUM (1 << 7)
|
|
|
|
#define UCB1400_M_FLAT (0 << 7)
|
|
|
|
#define UCB1400_HPEN (1 << 6)
|
|
|
|
#define UCB1400_DE (1 << 5)
|
|
|
|
#define UCB1400_DC (1 << 4)
|
|
|
|
#define UCB1400_HIPS (1 << 3)
|
|
|
|
#define UCB1400_GIEN (1 << 2)
|
|
|
|
#define UCB1400_OVFL (1 << 0)
|
|
|
|
#define UCB1400_REG_FEATURE_CSR2 0x6c
|
|
|
|
#define UCB1400_SMT (1 << 15) /* Must be 0 */
|
|
|
|
#define UCB1400_SUEV1 (1 << 14) /* Must be 0 */
|
|
|
|
#define UCB1400_SUEV0 (1 << 13) /* Must be 0 */
|
|
|
|
#define UCB1400_AVE (1 << 12)
|
|
|
|
#define UCB1400_AVEN1 (1 << 11) /* Must be 0 */
|
|
|
|
#define UCB1400_AVEN0 (1 << 10) /* Must be 0 */
|
|
|
|
#define UCB1400_SLP_ON \
|
|
|
|
(UCB1400_SLP_PLL | UCB1400_SLP_CODEC)
|
|
|
|
#define UCB1400_SLP_PLL (2 << 4)
|
|
|
|
#define UCB1400_SLP_CODEC (1 << 4)
|
|
|
|
#define UCB1400_SLP_NO (0 << 4)
|
|
|
|
#define UCB1400_EV2 (1 << 2) /* Must be 0 */
|
|
|
|
#define UCB1400_EV1 (1 << 1) /* Must be 0 */
|
|
|
|
#define UCB1400_EV0 (1 << 0) /* Must be 0 */
|
|
|
|
static void
|
|
|
|
ac97_ucb1400_init(struct ac97_softc *as)
|
|
|
|
{
|
|
|
|
|
|
|
|
ac97_write(as, UCB1400_REG_FEATURE_CSR1,
|
|
|
|
UCB1400_HPEN | UCB1400_DC | UCB1400_HIPS | UCB1400_OVFL);
|
|
|
|
ac97_write(as, UCB1400_REG_FEATURE_CSR2, UCB1400_AVE | UCB1400_SLP_ON);
|
|
|
|
}
|
|
|
|
|
2002-10-22 17:48:30 +04:00
|
|
|
#define VT1616_REG_IO_CONTROL 0x5a
|
|
|
|
#define VT1616_IC_LVL (1 << 15)
|
|
|
|
#define VT1616_IC_LFECENTER_TO_FRONT (1 << 12)
|
|
|
|
#define VT1616_IC_SURROUND_TO_FRONT (1 << 11)
|
|
|
|
#define VT1616_IC_BPDC (1 << 10)
|
|
|
|
#define VT1616_IC_DC (1 << 9)
|
|
|
|
#define VT1616_IC_IB_MASK 0x000c
|
|
|
|
static void
|
|
|
|
ac97_vt1616_init(struct ac97_softc *as)
|
|
|
|
{
|
|
|
|
static const struct ac97_source_info sources[3] = {
|
|
|
|
{ AudioCoutputs, AudioNsurround, "mixtofront",
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
|
|
|
VT1616_REG_IO_CONTROL,
|
2006-09-02 21:02:57 +04:00
|
|
|
0x0000, 1, 11, 0, 0, 0, CHECK_SURROUND, 0, 0, 0, },
|
2002-10-22 17:48:30 +04:00
|
|
|
{ AudioCoutputs, AudioNcenter, "mixtofront",
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
|
|
|
VT1616_REG_IO_CONTROL,
|
2006-09-02 21:02:57 +04:00
|
|
|
0x0000, 1, 12, 0, 0, 0, CHECK_CENTER, 0, 0, 0, },
|
2002-10-22 17:48:30 +04:00
|
|
|
{ AudioCoutputs, AudioNlfe, "mixtofront",
|
|
|
|
AUDIO_MIXER_ENUM, WRAP(ac97_on_off),
|
|
|
|
VT1616_REG_IO_CONTROL,
|
2006-09-02 21:02:57 +04:00
|
|
|
0x0000, 1, 12, 0, 0, 0, CHECK_LFE, 0, 0, 0, },
|
2002-10-22 17:48:30 +04:00
|
|
|
};
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
Mixer changes:
- Add "outputs.surround", "outputs.center", and "outputs.lfe"
- If the codec is not capable of a feature, mixer variables
about the feature is not created. For example, no
"outputs.tone" for a codec without tone control.
- Set the following mixer values in ac97_attach():
outputs.master=127,127
outputs.master.mute=off
outputs.headphones.mute=off
outputs.surround=127,127
outputs.surround.mute=off
outputs.center=127
outputs.center.mute=off
outputs.lfe=127
outputs.lfe.mute=off
inputs.dac.mute=off
inputs.cd.mute=off
inputs.line.mute=off
inputs.aux.mute=off
inputs.video.mute=off
record.volume.mute=off
because the default setting of AC'97 codec (all mutes are on,
and maximum volume) is troublesome.
- Make "char*" parameters of ac97_get_portnum_by_name() "const char*"
Codec ID changes:
- If a codec ID is unknown but its vendor ID is known,
ac97_attach() prints the vendor name like "dev0: <vendor name>
unknown (0xXXXXXXXX) codec;"
- Add IDs of Asahi Kasei AK4542, AK4544, AK4544A, AK4545,
Realtek ALC100
- Correct a vendor name: "Advance Logic" -> "Avance Logic"
- Add capability of codec-specific initialization
ac97_attach():
- CDAC, SDAC, and LDAC are eanabled.
- DELAY() before mixer settings. ThinkPad X24 needs it.
ALC650 codec specific change:
- Add "outputs.surround.lineinjack" to switch the line-in jack
to the surround output
- Add "outputs.center.micjack" and "outputs.lfe.micjack" (alias
of "outputs.center.micjack") to switch the mic jack to the
center/lfe output.
2002-10-14 12:48:15 +04:00
|
|
|
ac97_add_port(as, &sources[0]);
|
|
|
|
ac97_add_port(as, &sources[1]);
|
|
|
|
ac97_add_port(as, &sources[2]);
|
|
|
|
}
|
2005-04-04 22:52:30 +04:00
|
|
|
|
|
|
|
static int
|
|
|
|
ac97_modem_offhook_set(struct ac97_softc *as, int line, int newval)
|
|
|
|
{
|
2005-04-08 03:24:05 +04:00
|
|
|
uint16_t val;
|
2005-04-04 22:52:30 +04:00
|
|
|
|
2011-11-24 03:07:28 +04:00
|
|
|
KASSERT(mutex_owned(as->lock));
|
|
|
|
|
2005-04-08 03:24:05 +04:00
|
|
|
val = as->shadow_reg[AC97_REG_GPIO_STATUS >> 1];
|
2005-04-04 22:52:30 +04:00
|
|
|
switch (newval) {
|
|
|
|
case 0:
|
|
|
|
val &= ~line;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
val |= line;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
ac97_write(as, AC97_REG_GPIO_STATUS, val);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
ac97_sysctl_verify(SYSCTLFN_ARGS)
|
|
|
|
{
|
|
|
|
int error, tmp;
|
|
|
|
struct sysctlnode node;
|
|
|
|
struct ac97_softc *as;
|
|
|
|
|
|
|
|
node = *rnode;
|
|
|
|
as = rnode->sysctl_data;
|
|
|
|
if (node.sysctl_num == as->offhook_line1_mib) {
|
|
|
|
tmp = as->offhook_line1;
|
|
|
|
node.sysctl_data = &tmp;
|
|
|
|
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
|
|
|
if (error || newp == NULL)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
if (tmp < 0 || tmp > 1)
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
as->offhook_line1 = tmp;
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_enter(as->lock);
|
2005-04-04 22:52:30 +04:00
|
|
|
ac97_modem_offhook_set(as, AC97_GPIO_LINE1_OH, tmp);
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_exit(as->lock);
|
2005-04-04 22:52:30 +04:00
|
|
|
} else if (node.sysctl_num == as->offhook_line2_mib) {
|
|
|
|
tmp = as->offhook_line2;
|
|
|
|
node.sysctl_data = &tmp;
|
|
|
|
error = sysctl_lookup(SYSCTLFN_CALL(&node));
|
|
|
|
if (error || newp == NULL)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
if (tmp < 0 || tmp > 1)
|
|
|
|
return EINVAL;
|
|
|
|
|
|
|
|
as->offhook_line2 = tmp;
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_enter(as->lock);
|
2005-04-04 22:52:30 +04:00
|
|
|
ac97_modem_offhook_set(as, AC97_GPIO_LINE2_OH, tmp);
|
2011-11-24 03:07:28 +04:00
|
|
|
mutex_exit(as->lock);
|
2005-04-04 22:52:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|