Commit Graph

18 Commits

Author SHA1 Message Date
jmcneill f08bb8f847 * Add a flag AC97_HOST_INVERTED_EAMP. (kern/18880, kern/24488).
* Make reset callback optional; not all devices need it. (port-i386/14260, kern/12603, kern/12723, kern/24957).
2006-04-15 21:18:34 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
jmcneill c674ab7b1d Add ac97_attach_type(), to allow the hw driver to skip probes for audio or
modem devices. ac97_attach now calls ac97_attach_type() with
AC97_CODEC_TYPE_AUDIO, for backwords compatibility.
2005-04-11 18:26:48 +00:00
jmcneill c74eb31f21 * Add support for skipping either the modem or audio AC'97 probes
via host_flags: AC97_HOST_SKIP_AUDIO, AC97_HOST_SKIP_MODEM
* If we're dealing with a modem codec, print the extended modem
  capabilities.
* Add basic AC'97 modem initialization support.
* Add some (but not all) AC'97 modem registers. More will be added later.
2005-04-04 02:08:58 +00:00
kent 23b5d91433 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-10 22:01:36 +00:00
reinoud cca3038b40 Add convenience macro AC97_HAS_SPDIF to check if SPDIF output is supported
in the codec in the line of AC97_IS_4CH and AC97_IS_FIXED_RATE macro's.
2004-12-22 00:54:55 +00:00
kent 145085fc2f move IS_FIXED_RATE(), SUPPORTS_4CH(), and SUPPORTS_6CH to ac97var.h 2004-11-10 04:20:26 +00:00
kent 80620cc14f - nuke __P()
- add ac97_codec_if_vtbl::detach()
2004-11-08 14:24:17 +00:00
kent 54cf6460d6 ac97_host_if::reset() returns non-zero value if codec reset fails, and
ac97 is not attached in that case.

PR: kern/26973
2004-09-22 12:20:24 +00:00
thorpej 45bd8be9fa Protect against multiple inclusion. 2004-08-23 23:17:54 +00:00
itojun 7f6ed16ef4 function prototype must not have variable name 2003-07-08 10:06:28 +00:00
kent 297e3c5d35 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 08:48:15 +00:00
kent 20040ef785 Add IDs for YMF743-S and YMF753-S.
ac97_attach(): Enable VRA/VRM if the codec is capable of them.

The struct ac97_softc keeps the clock of the codec, the basic
features flag (the value of AC97_REG_RESET), and the extended
features flag (the value of AC97_REG_EXT_AUDIO_ID).

ac97_codec_if: Add get_extcaps(), set_rate(), and set_clock()
methods.
2002-10-08 09:19:44 +00:00
thorpej aedf82267c Move the declaration of an enum to avoid an "unnamed field not allowed"
warning in gcc 3.1.
2001-12-31 21:30:01 +00:00
lukem a9bf1b0410 delint 2001-05-07 08:15:41 +00:00
rh cb2d30303b Add new AC97_HOST_SWAPPED_CHANNELS host flag that causes left and right
mixer channels to be swapped (required for hardware that has wiring
reversed).
2001-01-09 23:14:25 +00:00
thorpej 05d5f37522 Shadow the AC'97 codec registers. This adds two capabilities:
* support devices that crash when reading the codec registers; a flags
  interface is added to the host interface and one flag is defined
  (AC97_HOST_DONT_READ).
* new API (restore_ports) for restoring the user's settings.  This
  can be useful after an APM resume after a suspend to disk.

From OpenBSD.
2000-11-04 08:07:14 +00:00
thorpej 1838aef29c ac97.h -> ac97var.h 2000-05-15 01:27:44 +00:00