Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/interwave.c
RevisionDateAuthorComments
 1.44  05-Feb-2024  andvar triple "r" typos, mainly s/interrrupt/interrupt/ in comments and one definition.
 1.43  29-Feb-2020  isaki Remove rounding by 4 bytes on round_blocksize().
For drivers which supports only 16bit * 2channels sampling,
rounding by 4 bytes no longer meaningful.
 1.42  08-Jun-2019  isaki branches: 1.42.4;
Clean get_props().
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly.
This eliminates need for audio.c to take care of such (old)
drivers which don't return both of PLAYBACK and CAPTURE.
- All get_props() doesn't need to return AUDIO_PROP_MMAP.
It is handled in the audio layer now.
 1.41  08-May-2019  isaki Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
 1.40  03-Feb-2019  mrg branches: 1.40.2;
add missing break; after case IW_LINE_IN_LVL case.
it was being overridden by the IW_REC_LVL case.
 1.39  14-Jul-2016  msaitoh branches: 1.39.18;
- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.
 1.38  08-Nov-2013  christos branches: 1.38.6;
fix unused variable warnings
 1.37  27-Oct-2012  chs branches: 1.37.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.36  24-Nov-2011  mrg branches: 1.36.8;
put back IPL_AUDIO and splaudio(), at the request of rmind. they are
aliases and now we can easily revert audio to IPL_VM if necessary,
without having to revert the whole branch.
 1.35  23-Nov-2011  jmcneill Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.34  14-Mar-2009  dsl branches: 1.34.12; 1.34.14;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.33  28-Apr-2008  martin branches: 1.33.8; 1.33.12; 1.33.14;
Remove clause 3 and 4 from TNF licenses
 1.32  08-Apr-2008  cegger branches: 1.32.2; 1.32.4;
use aprint_*_dev and device_xname
 1.31  19-Oct-2007  ad branches: 1.31.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.30  16-Nov-2006  christos branches: 1.30.8; 1.30.22; 1.30.24; 1.30.28;
__unused removal on arguments; approved by core.
 1.29  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.28  08-Mar-2006  lukem branches: 1.28.10; 1.28.12;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.27  11-Dec-2005  christos branches: 1.27.4; 1.27.6; 1.27.8; 1.27.10;
merge ktrace-lwp.
 1.26  30-May-2005  christos branches: 1.26.2;
- add missing const
- fix variable shadowing
- remove unneeded casts
 1.25  15-Jan-2005  kent ansify and KNF
 1.24  10-Jan-2005  kent 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
 1.23  09-Jul-2004  mycroft branches: 1.23.2;
Kill unused variable.
 1.22  09-Jul-2004  mycroft Remove some more code.
 1.21  09-Jul-2004  mycroft Slight code redux.
 1.20  22-Apr-2004  itojun sprintf -> snprintf
 1.19  30-Oct-2003  simonb Remove some assigned-to but otherwise unused variables.
 1.18  03-May-2003  wiz branches: 1.18.2;
DMA, not dma nor Dma.
 1.17  06-Apr-2003  wiz Respect the law: Use A-law and mu-law as spellings as far as easily possible.
Inspired by Igor Sobrado in PR 19680.
 1.16  01-Feb-2003  thorpej Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
 1.15  06-Feb-2002  pooka Remove inclusion of unused machine/cpufunc.h, it doesn't belong here anyways.
 1.14  13-Nov-2001  lukem add/cleanup RCSID
 1.13  26-Jun-2000  simonb branches: 1.13.2; 1.13.4;
Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
 1.12  07-Feb-2000  thorpej branches: 1.12.4;
Add a new function call to the ISA DMA API: isa_dmamaxsize(), which returns
the maximum transfer size for the specified DMA channel. Make all clients
of ISA DMA use this call to determine their maximum transfer size.
 1.11  17-Feb-1999  mycroft branches: 1.11.8;
Update comments.
 1.10  17-Feb-1999  mycroft Fix slight ommission in previous.
 1.9  17-Feb-1999  mycroft Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.
 1.8  17-Aug-1998  augustss * Redo the way the way the MIDI driver attaches to audio devices.
* Improve the midisyn layer a little.
* Add a driver for the Yamaha OPL[23] FM synths.
The opl driver is not finished yet; it sounds pretty awful.

For some strange reason I cannot get any FM sound from my SB64 cards,
but a regular SB16 works fine.
 1.7  10-Jun-1998  bouyer Make this compile with the recent ISA DMA changes.
 1.6  20-Apr-1998  augustss Make probe message more consistent with usual practice.
From "Soren S. Jorvang" <soren@t.dk>.
 1.5  19-Oct-1997  augustss Make the audio API (almost) SunOS compatible.
The changes is to allow some limited mixer manipulation through
the audio device (instead of the mixer device).
This rendered 4 methods in audio_hw_if unused so garbage collect these.
 1.4  11-Oct-1997  mycroft branches: 1.4.2;
AudioElinear -> AudioEslinear
 1.3  11-Oct-1997  mycroft AudioC[A-Z] -> AudioC[a-z]
 1.2  09-Oct-1997  jtc Fix tipo inherited from old version of TNF copyright template.
 1.1  06-Oct-1997  augustss Driver for the Interwave audio chip used in the GUS PnP sound card.
 1.4.2.2  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.4.2.1  11-Oct-1997  thorpej file interwave.c was added on branch marc-pcmcia on 1997-10-14 10:22:31 +0000
 1.11.8.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.12.4.1  30-Jun-2000  simonb Pull up mmap paddr_t/off_t changes from trunk.
 1.13.4.2  11-Feb-2002  jdolecek Sync w/ -current.
 1.13.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.13.2.2  28-Feb-2002  nathanw Catch up to -current.
 1.13.2.1  14-Nov-2001  nathanw Catch up to -current.
 1.18.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.18.2.4  17-Jan-2005  skrll Sync with HEAD.
 1.18.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.18.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.18.2.1  03-Aug-2004  skrll Sync with HEAD
 1.23.2.3  09-Jan-2005  kent audio_hw_if change
* make open() and close() optional
* add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
 1.23.2.2  03-Jan-2005  kent * remove stream_filter_list_append and stream_filter_list_prepend
* add stream_filter_list_t::{append(), prepend(), set()}
 1.23.2.1  03-Jan-2005  kent * adopt the filter pipeline framework

* ic/ad1848.c, isa/ess.c, isa/sbdsp.c
remove direct call of set_params() for the default encoding.
It should be called by the MI audio framework.
 1.26.2.3  27-Oct-2007  yamt sync with head.
 1.26.2.2  30-Dec-2006  yamt sync with head.
 1.26.2.1  21-Jun-2006  yamt sync with head.
 1.27.10.1  19-Apr-2006  elad sync with head.
 1.27.8.1  13-Mar-2006  yamt sync with head.
 1.27.6.1  22-Apr-2006  simonb Sync with head.
 1.27.4.1  09-Sep-2006  rpaulo sync with head
 1.28.12.2  10-Dec-2006  yamt sync with head.
 1.28.12.1  22-Oct-2006  yamt sync with head
 1.28.10.1  18-Nov-2006  ad Sync with head.
 1.30.28.1  25-Oct-2007  bouyer Sync with HEAD.
 1.30.24.1  06-Nov-2007  matt sync with HEAD
 1.30.22.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.30.8.1  23-Oct-2007  ad Sync with head.
 1.31.16.1  02-Jun-2008  mjf Sync with HEAD.
 1.32.4.2  04-May-2009  yamt sync with head.
 1.32.4.1  16-May-2008  yamt sync with head.
 1.32.2.1  18-May-2008  yamt sync with head.
 1.33.14.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.33.12.2  13-Dec-2008  ad Missing get_locks() method.
 1.33.12.1  12-Dec-2008  ad Checkpoint work in progress.
 1.33.8.1  28-Apr-2009  skrll Sync with HEAD.
 1.34.14.1  19-Nov-2011  jmcneill port ad-audiomp2 branch changes to 5.99.56
todo:
- port ad-audiomp2 pcppi changes
- these drivers need to be fixed:
- emuxki
- gcscaudio
- hdafg
- uaudio
- umidi
- MD audio drivers
 1.34.12.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.34.12.2  30-Oct-2012  yamt sync with head
 1.34.12.1  17-Apr-2012  yamt sync with head
 1.36.8.3  03-Dec-2017  jdolecek update from HEAD
 1.36.8.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.36.8.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.37.2.1  18-May-2014  rmind sync with head
 1.38.6.1  05-Oct-2016  skrll Sync with HEAD
 1.39.18.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.39.18.1  10-Jun-2019  christos Sync with HEAD
 1.40.2.3  04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.40.2.2  04-May-2019  isaki Remove obsoleted methods in audio_hw_if.
- drain: is handled in audio upper layer now.
- mappage: is handled in audio upper layer now.
- setfd: no one uses and it's meaningless now.
 1.40.2.1  21-Apr-2019  isaki Adapt ad1848/cs4231 families to audio2.
 1.42.4.1  29-Feb-2020  ad Sync with head.

RSS XML Feed