The __UNCONST macro is now used only where necessary and the RW macros
are gone. Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
* Ignore ICH_PCM246_MASK for modem devices
* Set LINE1 rate and level in set_params
* Enable mmap for modem devices. This was previously disallowed due to
the ext_id field not advertising that the device supported variable
rates. Since modems don't use ext_id (they use ext_mid instead), enable
mmap. Multiple rates are supported on AC'97 modems.
1) After setting an input or output channel to pause, watch for DCH (DMA
halted) to be set before resetting the registers. The manual says this is
required. This *may* fix random auich lockups.
2) Add auich_{trigger,intr,halt}_pipe(), which can operate on any of the
input and output channels. This reduces code duplication quite a bit.
While I'm at it, fill in the mic interrupt handling.
3) The mic in interrupt is MINT, not MIINT. (The latter is modem input.)
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
attach time the way Linux does it. Reported and tested by Jonathan
Schleifer, I checked it didn't break my own 7012 device which doesn't need
that manipulation.
* Encapsulate all the ring-specific variables into a substructure. (This will
help with some potential code sharing.)
* Don't bother with "last buffer complete" interrupts -- we should be taking an
interrupt anyway because we set IOC on every buffer.
* Likewise, ignore CELV; it's meaningless to us.
* Get rid of the FIFO error counters, since this doesn't actually happen any
more.
Also, allow any sample rate between 8000 and 48000Hz. (This range should
probably be larger, but this is what's known to work.)
Another 180 bytes shaved.
was causing some "fifo under/overrun" errors during the initial trigger.
Also fixes a ring synchronization problem introduced in the earlier changes.
This should completely fix the FIFO errors with auich.
1) Update the queue pointers any time we get a block completion interrupt,
not just when we hit the last block.
2) Set the "back-to-back enable" bit.
In addition:
3) Make sure we ack every block we transfer; there was a bug that could cause
the audio layer to get out of sync.
It is needed because automatic calibration by auich_calibrate() is not
so precise.
- Why not ioctl?
It is not good idea to add a new ioctl operation to MI audio for
a specific audio device.
- Why not mixerctl item?
AC'97 linke rate is not related to audio mixing.
FIFOE/BCIS/LVBCI bits; it's is cleared automatically by the hardware.
- Separate AUICH_DEBUG out from AUDIO_DEBUG and make it possible to debug
interrupt handling separately.
- A little KNF.