Home | History | Annotate | Download | only in isa
History log of /src/sys/dev/isa/wss.c
RevisionDateAuthorComments
 1.77  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.76  26-Apr-2021  thorpej branches: 1.76.6;
Be explicit about using the "wss" interface attribute when attaching
the "opl" instance.
 1.75  24-Apr-2021  thorpej branches: 1.75.2;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.74  29-Feb-2020  isaki branches: 1.74.8;
Remove rounding by 4 bytes on round_blocksize().
For drivers which supports only 16bit * 2channels sampling,
rounding by 4 bytes no longer meaningful.
 1.73  08-May-2019  isaki branches: 1.73.4;
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.72  16-Mar-2019  isaki branches: 1.72.2;
Use C99 style struct initializer to audio_hw_if.
 1.71  24-Nov-2011  mrg branches: 1.71.50;
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.70  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.69  02-Jun-2011  nonaka branches: 1.69.2; 1.69.4;
fix compile failure.
 1.68  19-Oct-2007  ad branches: 1.68.32; 1.68.42; 1.68.48; 1.68.52;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.67  16-Nov-2006  christos branches: 1.67.6; 1.67.8; 1.67.22; 1.67.24; 1.67.28;
__unused removal on arguments; approved by core.
 1.66  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.65  03-Sep-2006  christos branches: 1.65.2; 1.65.4;
add missing initializer
 1.64  29-Mar-2006  thorpej Use device_cfdata().
 1.63  11-Dec-2005  christos branches: 1.63.4; 1.63.6; 1.63.8; 1.63.10; 1.63.12;
merge ktrace-lwp.
 1.62  14-Jan-2005  kent branches: 1.62.10;
ansify and KNF
 1.61  29-Oct-2004  yamt constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.60  27-Sep-2002  provos branches: 1.60.6;
remove trailing \n in panic(). approved perry.
 1.59  13-Nov-2001  lukem add RCSID
 1.58  03-Oct-2001  augustss Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).
 1.57  18-Feb-1999  mycroft branches: 1.57.20; 1.57.22; 1.57.24;
Add separate halt_input and halt_output methods in ad1848_isa, which disable
the DMA channel.
 1.56  17-Feb-1999  mycroft Use the trigger interface, and clean up a pile of cruft.
 1.55  17-Feb-1999  mycroft Pass the direction to the allocm and round_buffersize methods.
Some drivers need this to properly allocate DMAable memory.
 1.54  08-Dec-1998  augustss Make the OPL information string more informative.
 1.53  06-Sep-1998  pk Use `ad1848_isa_{open|close}' (Ezra Story; PR#6108).
 1.52  25-Aug-1998  pk Split the AD1848 driver into MI (dev/ic/ad1848.c) and ISA parts.
 1.51  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.50  29-Jul-1998  augustss Don't print chip name in attach, the ad1848 attach already does.
 1.49  30-Jun-1998  mycroft Nuke unused variable.
 1.48  30-Jun-1998  mycroft Add a monitor mute. The mixer here really needs more work for the
Crystal chips.
 1.47  09-Jun-1998  thorpej Adjust for changes to the ISA DMA API.
 1.46  21-May-1998  augustss KNF.
 1.45  20-May-1998  augustss Add a Yamaha OPL3-SA3 driver and clean up all AD1848 drivers.
Submitted by Constantine Sapuntzakis <csapuntz@reeducation-labor.lcs.mit.edu>
and originally written for OpenBSD.
 1.44  12-Mar-1998  augustss Update probing for GUS a little. From soren@t.dk,
closes PR kern/5148.
 1.43  23-Feb-1998  drochner -make compile without BROKEN_INDIRECT_CONFIG
-don't include <machine/pio.h>
 1.42  19-Jan-1998  augustss Split out the ISA part of the WSS driver to allow PnP attachment.
Make the AD1848 driver a little more readable with some macros.
 1.41  12-Jan-1998  thorpej Update for config changes.
 1.40  30-Nov-1997  drochner fix inconsistent declaration in non-"__BROKEN_INDIRECT_CONFIG" case
 1.39  19-Oct-1997  augustss branches: 1.39.2;
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.38  11-Oct-1997  mycroft AudioC[A-Z] -> AudioC[a-z]
 1.37  28-Aug-1997  augustss Zap drq2 if unused.
 1.36  26-Aug-1997  augustss XXX Add a drq2 locator for the ISA bus. Many sound cards need
two DMA channels to do e.g. full-duplex. This allows
a way of specifying the second channel in a sane way.
THIS IS TEMPORARY. The drq2 locator will go away when
the locator system has been changed to allow multiple
values per locator.
 1.35  25-Aug-1997  augustss Fix the "non-broken" indirect configuration so it might actually work.
 1.34  24-Aug-1997  augustss Improve error message.
 1.33  20-Aug-1997  augustss Convert WSS driver to use non-broken indirect configuration.
 1.32  19-Aug-1997  augustss Change the MI audio driver so it attaches to the MD driver in the
normal way. This requires adding a line to the config files to
get audio to work again.
 1.31  04-Aug-1997  augustss Implement a function to test if a drq is taken and use it
in two drivers. There are still many drivers left to fix...
 1.30  31-Jul-1997  augustss Audio changes:
- Change the way attach and open works to allow multiple audio
devices.
- Split the mulaw.c file into two to avoid dragging in mulaw
convertsion when they are not needed. Add 16 bit alaw/mulaw tables.
- Change the way audio properties are gotten.
- Recognize more versions os SoundBlaster.
 1.29  28-Jul-1997  augustss branches: 1.29.2;
Audio: Remove the machine dependant code I put in audio.c by mistake.
This adds another method to audio_hw_if. Also remove a field from
audio_hw_if that was not read-only.
 1.28  27-Jul-1997  augustss audio: Simplify handling of AUDIO_SETFD and committing of encoding mode.
 1.27  27-Jul-1997  augustss Changes to the sudio system:
- It is now possible to handle devices that want "looping" DMA,
e.g. the SoundBlaster correctly. The WSS and SB drivers use this.
To do this several new methods were introduced in audio_hw_if.
- Different silence handling (forced by previous change).
- The audio driver can now be mmap()-ed, but due to problems in
the VM system only for writing for now.
- The OSS (Linux) audio emulation takes advantage of some of the
new features.
 1.26  06-Jun-1997  thorpej Pull thorpej-bus-dma branch into mainline.
 1.25  09-May-1997  augustss branches: 1.25.2;
Change the interface between high and lowlevel audio drivers again:
Set the encoding parameters slightly differently.
Remove the SW encoding/decodinf functions from this interface
and move them to the audio_parameter struct; this is both more efficient
and flexible.
 1.24  07-May-1997  augustss Convert to new orthogonal audio encoding scheme and implement
some of the new encodings. The change to ioctl AUDIO_GETENC is
NOT backwards compatible.
 1.23  29-Apr-1997  augustss Change the interface between the high and low level audio drivers
so that all audio encoding parameters are set at once. This simplifies
the interface and make error checking easier.
 1.22  06-Apr-1997  augustss Make sure the bus tag is set where we need it.
 1.21  06-Apr-1997  augustss Add support for MAD16 based audio cards.
XXX Change the way we determine to probe for it when
multiple I/O ranges are available.
 1.20  05-Apr-1997  augustss Busify the WSS driver.
 1.19  20-Mar-1997  mycroft Combine set_encoding and set_precision into a single set_format interface.
 1.18  19-Mar-1997  mikel normalize off-by-four ad1848 register offsets.
also silence probe unless debugging is enabled.
 1.17  13-Mar-1997  mycroft Don't share the silence block between devices. Make silence filling work for
more encodings, and make it device-independent. From Lennart Augustsson, in
PR kern/3305.
 1.16  05-Dec-1996  mikel return proper output port. Fixes PR kern/2014.
 1.15  13-Oct-1996  christos backout kprintf changes
 1.14  10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.13  12-May-1996  mycroft Use intr.h.
 1.12  29-Apr-1996  christos Prototype fixes
 1.11  11-Apr-1996  cgd update for addition of a machine-dependent cookie as the first argument
to isa_intr_{,dis}establish().
 1.10  17-Mar-1996  thorpej New device attachment scheme:

- split softc size and match/attach out from cfdriver into
a new struct cfattach.

- new "attach" directive for files.*. May specify the name of
the cfattach structure, so that devices may be easily attached
to parents with different autoconfiguration semantics.
 1.9  16-Feb-1996  mycroft Prototype the probe and attach functions.
 1.8  24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.7  10-Nov-1995  mycroft Convert IRQ, DRQ, and port numbers to int.
 1.6  07-Jul-1995  brezak Setup irq correctly (PR#1179)
 1.5  08-May-1995  brezak Remove strings
 1.4  17-Apr-1995  cgd update for new locations
 1.3  17-Apr-1995  cgd clean up several ISA device interfaces: autoconfiguration, header
inclusion, and interrupt configuration. more work still needs to be done,
but it's getting better...
 1.2  25-Mar-1995  mycroft Use void* rather than caddr_t in many places.
 1.1  21-Feb-1995  brezak Driver for Windows sound system; not extensively tested
 1.25.2.1  13-May-1997  thorpej Adapt to new software interface to the on-board ISA DMA controller.
 1.29.2.4  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.29.2.3  01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.29.2.2  27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.29.2.1  23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.39.2.1  05-Dec-1998  cgd work around a problem that could cause the wss driver to panic during
attach when a DRQ gets allocated twice. Done differently in -current.
(augustss)
 1.57.24.1  11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.57.22.2  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.57.22.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.57.20.3  18-Oct-2002  nathanw Catch up to -current.
 1.57.20.2  14-Nov-2001  nathanw Catch up to -current.
 1.57.20.1  08-Oct-2001  nathanw Catch up to -current.
 1.60.6.2  17-Jan-2005  skrll Sync with HEAD.
 1.60.6.1  02-Nov-2004  skrll Sync with HEAD.
 1.62.10.3  27-Oct-2007  yamt sync with head.
 1.62.10.2  30-Dec-2006  yamt sync with head.
 1.62.10.1  21-Jun-2006  yamt sync with head.
 1.63.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.63.10.1  19-Apr-2006  elad sync with head.
 1.63.8.2  14-Sep-2006  yamt sync with head.
 1.63.8.1  01-Apr-2006  yamt sync with head.
 1.63.6.1  22-Apr-2006  simonb Sync with head.
 1.63.4.1  09-Sep-2006  rpaulo sync with head
 1.65.4.2  10-Dec-2006  yamt sync with head.
 1.65.4.1  22-Oct-2006  yamt sync with head
 1.65.2.1  18-Nov-2006  ad Sync with head.
 1.67.28.1  25-Oct-2007  bouyer Sync with HEAD.
 1.67.24.1  06-Nov-2007  matt sync with HEAD
 1.67.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.67.8.1  23-Oct-2007  ad Sync with head.
 1.67.6.1  27-Feb-2007  ad Add MP locking for audio drivers.
 1.68.52.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.68.48.1  06-Jun-2011  jruoho Sync with HEAD.
 1.68.42.1  12-Jun-2011  rmind sync with head
 1.68.32.2  12-Dec-2008  ad Checkpoint work in progress.
 1.68.32.1  11-Dec-2008  ad Checkpoint work in progress.
 1.69.4.3  23-Nov-2011  jakllsch Hold the intr lock for the duration of ad1848_isa_intr().
 1.69.4.2  22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.69.4.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.69.2.1  17-Apr-2012  yamt sync with head
 1.71.50.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.71.50.1  10-Jun-2019  christos Sync with HEAD
 1.72.2.3  04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.72.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.72.2.1  21-Apr-2019  isaki Adapt ad1848/cs4231 families to audio2.
 1.73.4.1  29-Feb-2020  ad Sync with head.
 1.74.8.1  21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.75.2.1  13-May-2021  thorpej Sync with HEAD.
 1.76.6.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed