History log of /netbsd-current/sys/dev/pci/esa.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.66 10-May-2023 riastradh

esa(4): Use config_detach_children.


Revision tags: netbsd-10-base bouyer-sunxi-drm-base netbsd-9-3-RELEASE thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base netbsd-9-1-RELEASE bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 netbsd-9-0-RELEASE netbsd-9-0-RC2 ad-namecache-base2 ad-namecache-base1 ad-namecache-base netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609
# 1.65 08-Jun-2019 isaki

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.64 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


Revision tags: isaki-audio2-base
# 1.63 16-Mar-2019 isaki

branches: 1.63.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.62 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.61 01-Jun-2017 chs

branches: 1.61.8; 1.61.10;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.60 29-Mar-2014 christos

branches: 1.60.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.59 16-Oct-2013 christos

- use proper types (uint16_t instead of uint32_t)
- don't index past the end of arrays
- use __arraycount() consistently instead of manual cruft.
- remove useless cast


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.58 30-Jan-2012 drochner

branches: 1.58.6; 1.58.10;
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base
# 1.57 03-Dec-2011 ryo

branches: 1.57.2;
the argument of esa_get_locks() is struct esa_voice *, not struct esa_softc *.

ok by mrg@ jmcneill@


# 1.56 24-Nov-2011 mrg

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.55 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.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9
# 1.54 24-Feb-2010 dyoung

branches: 1.54.10; 1.54.12;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.


Revision tags: uebayasi-xip-base
# 1.53 08-Jan-2010 dyoung

branches: 1.53.2;
Expand PMF_FN_* macros.


Revision tags: matt-premerge-20091211
# 1.52 26-Nov-2009 njoly

Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase jym-xensuspend-base
# 1.51 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base wrstuden-revivesa-base mjf-devfs2-base
# 1.50 10-Jun-2008 dyoung

branches: 1.50.8; 1.50.10;
Fix a couple of mistakes in the device_t/softc split that cause
machines such as my HP Pavilion N3270 to freeze at boot. This
should fix PR kern/38815, too.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2
# 1.49 13-May-2008 jmcneill

branches: 1.49.2;
Hook hardware volume buttons into pmf.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.48 27-Mar-2008 jmcneill

branches: 1.48.2; 1.48.4; 1.48.6;
Split device_t and softc


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.47 21-Mar-2008 dyoung

Use aprint_*_dev() instead of accessing struct device member dv_xname
directly.


# 1.46 21-Mar-2008 dyoung

pci_activate() expects for its void * argument to be a device_t,
so change the type of the argument to device_t. Update each use
of pci_activate().

Use device_t and accessors. Use aprint_*_dev().


Revision tags: hpcarm-cleanup-base
# 1.45 22-Feb-2008 dyoung

Add methods for detaching self and for detaching children.

Use device_t and accessors. Use aprint_*_dev().


Revision tags: nick-net80211-sync-base mjf-devfs-base
# 1.44 27-Jan-2008 jmcneill

branches: 1.44.2; 1.44.6;
On resume, ensure that esa is powered up, and ensure we power the
AC97 codec once the host controller is up and running.


Revision tags: bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base matt-armv6-base
# 1.43 09-Dec-2007 jmcneill

Merge jmcneill-pm branch.


Revision tags: yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base reinoud-bufcleanup-base
# 1.42 19-Oct-2007 ad

branches: 1.42.2; 1.42.4; 1.42.6;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.41 04-Mar-2007 christos

branches: 1.41.2; 1.41.14; 1.41.16; 1.41.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.40 16-Nov-2006 christos

branches: 1.40.4; 1.40.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.39 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


# 1.38 25-Sep-2006 jmcneill

No need to call pci_set_powerstate from our powerhook, the bus handles this
for us now.


# 1.37 24-Sep-2006 jmcneill

PR# 23620: channels are swapped


# 1.36 24-Sep-2006 jmcneill

Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@


# 1.35 24-Sep-2006 jmcneill

Formatting fixups, remove commented out code that should not have been here,
and remove a few unnecessary XXX comments.


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.34 30-Aug-2006 christos

branches: 1.34.2; 1.34.4;
missing comma


# 1.33 30-Aug-2006 christos

fix incomplete initializers


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase chap-midi-base
# 1.32 17-Jun-2006 christos

re-factor the pci powestate api. reviewed by gimpy


Revision tags: gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.8; 1.31.14; 1.31.16;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 ktrace-lwp-base
# 1.30 29-Oct-2005 jmcneill

Wow, this is clearly wrong (found in esa_set_params):
if (p->channels < 1 && p->channels > 2)
return EINVAL;
Change the 'and' to an 'or' so the check actually does something.


Revision tags: yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.29 28-Jun-2005 thorpej

branches: 1.29.2; 1.29.4;
Use ANSI function decls and static.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base
# 1.28 15-Jan-2005 kent

ansify and KNF


# 1.27 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


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.26 29-Oct-2004 yamt

branches: 1.26.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.25 22-Sep-2004 kent

ac97_host_if::reset() returns non-zero value if codec reset fails, and
ac97 is not attached in that case.

PR: kern/26973


# 1.24 21-Jul-2004 scw

- Don't hardcode buffer size and block size in esa_round_buffersize() and
esa_round_blocksize().
- Fix esa_trigger_output() and esa_trigger_input() to initialise the
channel's buffer/block size using the supplied parameters.
- While here, simplify esa_intr().

This gets kphone working on my esa(4)-equipped laptop.


# 1.23 23-Apr-2004 itojun

pass string length (= boundary info) to pci_devinfo so that we do not run over
the end of memory region


Revision tags: netbsd-2-0-base
# 1.22 25-Oct-2003 christos

branches: 1.22.2;
Fix uninitialized variable warnings


# 1.21 14-Jul-2003 lukem

add missing __KERNEL_RCSID()


# 1.20 01-Feb-2003 thorpej

branches: 1.20.2;
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.19 31-Jan-2003 thorpej

Use aprint_*().


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.18 23-Dec-2002 tsutsui

Replace magic numbers for power management control with PCI_PMCSR* macros.

XXX Should we use pci_get_powerstate() and pci_set_powerstate() in pci.c?


Revision tags: gmcgarry_ctxsw_base gmcgarry_ucred_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.17 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.16 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.15 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: gehenna-devsw-base
# 1.14 08-Aug-2002 itojun

audit bitmask test mistake (s/&&/&/). from openbsd


# 1.13 02-Jun-2002 jmcneill

Fix the mixer controls to work a bit better.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.12 24-Mar-2002 jmcneill

branches: 1.12.2;
Fix suspend/resume. Previously, suspending/resuming while playback was active
would either:

1. Cause the machine to stop responding, or
2. Cause the currently playing voices to stop output.

With this change, voices are stopped on suspend, and continue from where they
left off on resume.


Revision tags: eeh-devprop-base
# 1.11 16-Mar-2002 jmcneill

Add multiple voice support to the ESS Allegro-1 / Maestro-3 family of
audio accelerators.

Mixing is done in hardware by the ASSP, but is limited to 4 simultaneous
channels due to the restricted "minisrc" image that we are currently
working with.

Due to limitations in the audio subsystem, I'm currently attaching multiple
'audio' devices to 'esa', one for each voice. Because of this hack, the
default ESA_NUM_VOICES is 1.


# 1.10 10-Mar-2002 jmcneill

Correctly enable/disable the low-pass filter, depending on the sample rate.
This fixes timing issues when playing back at 48kHz (noticable using
pkgsrc/graphics/mplayer and DivX ;-) streams).


Revision tags: newlock-base ifpoll-base
# 1.9 26-Feb-2002 joda

in esa_resume, call esa_codec_reset; makes it much more happy after a
suspend on my O500 (snatched from FreeBSD)


# 1.8 23-Jan-2002 pooka

branches: 1.8.2;
free memory allocated for suspend save area in detach


# 1.7 14-Jan-2002 pooka

Use standard PCI power management definitions from pcireg.h instead
of homegrown ones.

suggested by Soren


# 1.6 13-Jan-2002 jmcneill

Every card I've seen has had their channels swapped with respect
to the mixer. Ie:
$ mixerctl -w outputs.master=0,191
Would result in the _right_ speaker being turned off.

So, we will swap the left and right mixer channels to compensate
for this.


# 1.5 13-Jan-2002 jmcneill

Use malloc's M_ZERO flag instead of malloc/memset.


# 1.4 13-Jan-2002 pooka

Add support for the driver to work after suspend/resume. Does nothing
fancy, works for the basic output case, but does not support programs
which use playback while going into suspend.

Sketched after code found in FreeBSD and Linux drivers.


# 1.3 07-Jan-2002 jmcneill

branches: 1.3.2; 1.3.4;
Integrate recording support into the driver. Not very heavily tested yet.


# 1.2 06-Jan-2002 augustss

Note that Don Kim wrote the original Linux driver.


# 1.1 06-Jan-2002 jmcneill

Import driver for the ESS Allegro-1 / Maestro-3 based PCI Audio Accelerators.


# 1.65 08-Jun-2019 isaki

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.64 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


Revision tags: isaki-audio2-base
# 1.63 16-Mar-2019 isaki

branches: 1.63.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.62 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.61 01-Jun-2017 chs

branches: 1.61.8;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.60 29-Mar-2014 christos

branches: 1.60.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.59 16-Oct-2013 christos

- use proper types (uint16_t instead of uint32_t)
- don't index past the end of arrays
- use __arraycount() consistently instead of manual cruft.
- remove useless cast


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.58 30-Jan-2012 drochner

branches: 1.58.6; 1.58.10;
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base
# 1.57 03-Dec-2011 ryo

branches: 1.57.2;
the argument of esa_get_locks() is struct esa_voice *, not struct esa_softc *.

ok by mrg@ jmcneill@


# 1.56 24-Nov-2011 mrg

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.55 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.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9
# 1.54 24-Feb-2010 dyoung

branches: 1.54.10; 1.54.12;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.


Revision tags: uebayasi-xip-base
# 1.53 08-Jan-2010 dyoung

branches: 1.53.2;
Expand PMF_FN_* macros.


Revision tags: matt-premerge-20091211
# 1.52 26-Nov-2009 njoly

Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase jym-xensuspend-base
# 1.51 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base wrstuden-revivesa-base mjf-devfs2-base
# 1.50 10-Jun-2008 dyoung

branches: 1.50.8; 1.50.10;
Fix a couple of mistakes in the device_t/softc split that cause
machines such as my HP Pavilion N3270 to freeze at boot. This
should fix PR kern/38815, too.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2
# 1.49 13-May-2008 jmcneill

branches: 1.49.2;
Hook hardware volume buttons into pmf.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.48 27-Mar-2008 jmcneill

branches: 1.48.2; 1.48.4; 1.48.6;
Split device_t and softc


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.47 21-Mar-2008 dyoung

Use aprint_*_dev() instead of accessing struct device member dv_xname
directly.


# 1.46 21-Mar-2008 dyoung

pci_activate() expects for its void * argument to be a device_t,
so change the type of the argument to device_t. Update each use
of pci_activate().

Use device_t and accessors. Use aprint_*_dev().


Revision tags: hpcarm-cleanup-base
# 1.45 22-Feb-2008 dyoung

Add methods for detaching self and for detaching children.

Use device_t and accessors. Use aprint_*_dev().


Revision tags: nick-net80211-sync-base mjf-devfs-base
# 1.44 27-Jan-2008 jmcneill

branches: 1.44.2; 1.44.6;
On resume, ensure that esa is powered up, and ensure we power the
AC97 codec once the host controller is up and running.


Revision tags: bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base matt-armv6-base
# 1.43 09-Dec-2007 jmcneill

Merge jmcneill-pm branch.


Revision tags: yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base reinoud-bufcleanup-base
# 1.42 19-Oct-2007 ad

branches: 1.42.2; 1.42.4; 1.42.6;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.41 04-Mar-2007 christos

branches: 1.41.2; 1.41.14; 1.41.16; 1.41.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.40 16-Nov-2006 christos

branches: 1.40.4; 1.40.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.39 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


# 1.38 25-Sep-2006 jmcneill

No need to call pci_set_powerstate from our powerhook, the bus handles this
for us now.


# 1.37 24-Sep-2006 jmcneill

PR# 23620: channels are swapped


# 1.36 24-Sep-2006 jmcneill

Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@


# 1.35 24-Sep-2006 jmcneill

Formatting fixups, remove commented out code that should not have been here,
and remove a few unnecessary XXX comments.


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.34 30-Aug-2006 christos

branches: 1.34.2; 1.34.4;
missing comma


# 1.33 30-Aug-2006 christos

fix incomplete initializers


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase chap-midi-base
# 1.32 17-Jun-2006 christos

re-factor the pci powestate api. reviewed by gimpy


Revision tags: gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.8; 1.31.14; 1.31.16;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 ktrace-lwp-base
# 1.30 29-Oct-2005 jmcneill

Wow, this is clearly wrong (found in esa_set_params):
if (p->channels < 1 && p->channels > 2)
return EINVAL;
Change the 'and' to an 'or' so the check actually does something.


Revision tags: yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.29 28-Jun-2005 thorpej

branches: 1.29.2; 1.29.4;
Use ANSI function decls and static.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base
# 1.28 15-Jan-2005 kent

ansify and KNF


# 1.27 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


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.26 29-Oct-2004 yamt

branches: 1.26.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.25 22-Sep-2004 kent

ac97_host_if::reset() returns non-zero value if codec reset fails, and
ac97 is not attached in that case.

PR: kern/26973


# 1.24 21-Jul-2004 scw

- Don't hardcode buffer size and block size in esa_round_buffersize() and
esa_round_blocksize().
- Fix esa_trigger_output() and esa_trigger_input() to initialise the
channel's buffer/block size using the supplied parameters.
- While here, simplify esa_intr().

This gets kphone working on my esa(4)-equipped laptop.


# 1.23 23-Apr-2004 itojun

pass string length (= boundary info) to pci_devinfo so that we do not run over
the end of memory region


Revision tags: netbsd-2-0-base
# 1.22 25-Oct-2003 christos

branches: 1.22.2;
Fix uninitialized variable warnings


# 1.21 14-Jul-2003 lukem

add missing __KERNEL_RCSID()


# 1.20 01-Feb-2003 thorpej

branches: 1.20.2;
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.19 31-Jan-2003 thorpej

Use aprint_*().


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.18 23-Dec-2002 tsutsui

Replace magic numbers for power management control with PCI_PMCSR* macros.

XXX Should we use pci_get_powerstate() and pci_set_powerstate() in pci.c?


Revision tags: gmcgarry_ctxsw_base gmcgarry_ucred_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.17 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.16 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.15 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: gehenna-devsw-base
# 1.14 08-Aug-2002 itojun

audit bitmask test mistake (s/&&/&/). from openbsd


# 1.13 02-Jun-2002 jmcneill

Fix the mixer controls to work a bit better.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.12 24-Mar-2002 jmcneill

branches: 1.12.2;
Fix suspend/resume. Previously, suspending/resuming while playback was active
would either:

1. Cause the machine to stop responding, or
2. Cause the currently playing voices to stop output.

With this change, voices are stopped on suspend, and continue from where they
left off on resume.


Revision tags: eeh-devprop-base
# 1.11 16-Mar-2002 jmcneill

Add multiple voice support to the ESS Allegro-1 / Maestro-3 family of
audio accelerators.

Mixing is done in hardware by the ASSP, but is limited to 4 simultaneous
channels due to the restricted "minisrc" image that we are currently
working with.

Due to limitations in the audio subsystem, I'm currently attaching multiple
'audio' devices to 'esa', one for each voice. Because of this hack, the
default ESA_NUM_VOICES is 1.


# 1.10 10-Mar-2002 jmcneill

Correctly enable/disable the low-pass filter, depending on the sample rate.
This fixes timing issues when playing back at 48kHz (noticable using
pkgsrc/graphics/mplayer and DivX ;-) streams).


Revision tags: newlock-base ifpoll-base
# 1.9 26-Feb-2002 joda

in esa_resume, call esa_codec_reset; makes it much more happy after a
suspend on my O500 (snatched from FreeBSD)


# 1.8 23-Jan-2002 pooka

branches: 1.8.2;
free memory allocated for suspend save area in detach


# 1.7 14-Jan-2002 pooka

Use standard PCI power management definitions from pcireg.h instead
of homegrown ones.

suggested by Soren


# 1.6 13-Jan-2002 jmcneill

Every card I've seen has had their channels swapped with respect
to the mixer. Ie:
$ mixerctl -w outputs.master=0,191
Would result in the _right_ speaker being turned off.

So, we will swap the left and right mixer channels to compensate
for this.


# 1.5 13-Jan-2002 jmcneill

Use malloc's M_ZERO flag instead of malloc/memset.


# 1.4 13-Jan-2002 pooka

Add support for the driver to work after suspend/resume. Does nothing
fancy, works for the basic output case, but does not support programs
which use playback while going into suspend.

Sketched after code found in FreeBSD and Linux drivers.


# 1.3 07-Jan-2002 jmcneill

branches: 1.3.2; 1.3.4;
Integrate recording support into the driver. Not very heavily tested yet.


# 1.2 06-Jan-2002 augustss

Note that Don Kim wrote the original Linux driver.


# 1.1 06-Jan-2002 jmcneill

Import driver for the ESS Allegro-1 / Maestro-3 based PCI Audio Accelerators.


# 1.64 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


Revision tags: isaki-audio2-base
# 1.63 16-Mar-2019 isaki

branches: 1.63.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.62 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.61 01-Jun-2017 chs

branches: 1.61.8;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.60 29-Mar-2014 christos

branches: 1.60.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.59 16-Oct-2013 christos

- use proper types (uint16_t instead of uint32_t)
- don't index past the end of arrays
- use __arraycount() consistently instead of manual cruft.
- remove useless cast


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.58 30-Jan-2012 drochner

branches: 1.58.6; 1.58.10;
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base
# 1.57 03-Dec-2011 ryo

branches: 1.57.2;
the argument of esa_get_locks() is struct esa_voice *, not struct esa_softc *.

ok by mrg@ jmcneill@


# 1.56 24-Nov-2011 mrg

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.55 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.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9
# 1.54 24-Feb-2010 dyoung

branches: 1.54.10; 1.54.12;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.


Revision tags: uebayasi-xip-base
# 1.53 08-Jan-2010 dyoung

branches: 1.53.2;
Expand PMF_FN_* macros.


Revision tags: matt-premerge-20091211
# 1.52 26-Nov-2009 njoly

Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase jym-xensuspend-base
# 1.51 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base wrstuden-revivesa-base mjf-devfs2-base
# 1.50 10-Jun-2008 dyoung

branches: 1.50.8; 1.50.10;
Fix a couple of mistakes in the device_t/softc split that cause
machines such as my HP Pavilion N3270 to freeze at boot. This
should fix PR kern/38815, too.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2
# 1.49 13-May-2008 jmcneill

branches: 1.49.2;
Hook hardware volume buttons into pmf.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.48 27-Mar-2008 jmcneill

branches: 1.48.2; 1.48.4; 1.48.6;
Split device_t and softc


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.47 21-Mar-2008 dyoung

Use aprint_*_dev() instead of accessing struct device member dv_xname
directly.


# 1.46 21-Mar-2008 dyoung

pci_activate() expects for its void * argument to be a device_t,
so change the type of the argument to device_t. Update each use
of pci_activate().

Use device_t and accessors. Use aprint_*_dev().


Revision tags: hpcarm-cleanup-base
# 1.45 22-Feb-2008 dyoung

Add methods for detaching self and for detaching children.

Use device_t and accessors. Use aprint_*_dev().


Revision tags: nick-net80211-sync-base mjf-devfs-base
# 1.44 27-Jan-2008 jmcneill

branches: 1.44.2; 1.44.6;
On resume, ensure that esa is powered up, and ensure we power the
AC97 codec once the host controller is up and running.


Revision tags: bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base matt-armv6-base
# 1.43 09-Dec-2007 jmcneill

Merge jmcneill-pm branch.


Revision tags: yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base reinoud-bufcleanup-base
# 1.42 19-Oct-2007 ad

branches: 1.42.2; 1.42.4; 1.42.6;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.41 04-Mar-2007 christos

branches: 1.41.2; 1.41.14; 1.41.16; 1.41.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.40 16-Nov-2006 christos

branches: 1.40.4; 1.40.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.39 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


# 1.38 25-Sep-2006 jmcneill

No need to call pci_set_powerstate from our powerhook, the bus handles this
for us now.


# 1.37 24-Sep-2006 jmcneill

PR# 23620: channels are swapped


# 1.36 24-Sep-2006 jmcneill

Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@


# 1.35 24-Sep-2006 jmcneill

Formatting fixups, remove commented out code that should not have been here,
and remove a few unnecessary XXX comments.


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.34 30-Aug-2006 christos

branches: 1.34.2; 1.34.4;
missing comma


# 1.33 30-Aug-2006 christos

fix incomplete initializers


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase chap-midi-base
# 1.32 17-Jun-2006 christos

re-factor the pci powestate api. reviewed by gimpy


Revision tags: gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.8; 1.31.14; 1.31.16;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 ktrace-lwp-base
# 1.30 29-Oct-2005 jmcneill

Wow, this is clearly wrong (found in esa_set_params):
if (p->channels < 1 && p->channels > 2)
return EINVAL;
Change the 'and' to an 'or' so the check actually does something.


Revision tags: yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.29 28-Jun-2005 thorpej

branches: 1.29.2; 1.29.4;
Use ANSI function decls and static.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base
# 1.28 15-Jan-2005 kent

ansify and KNF


# 1.27 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


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.26 29-Oct-2004 yamt

branches: 1.26.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.25 22-Sep-2004 kent

ac97_host_if::reset() returns non-zero value if codec reset fails, and
ac97 is not attached in that case.

PR: kern/26973


# 1.24 21-Jul-2004 scw

- Don't hardcode buffer size and block size in esa_round_buffersize() and
esa_round_blocksize().
- Fix esa_trigger_output() and esa_trigger_input() to initialise the
channel's buffer/block size using the supplied parameters.
- While here, simplify esa_intr().

This gets kphone working on my esa(4)-equipped laptop.


# 1.23 23-Apr-2004 itojun

pass string length (= boundary info) to pci_devinfo so that we do not run over
the end of memory region


Revision tags: netbsd-2-0-base
# 1.22 25-Oct-2003 christos

branches: 1.22.2;
Fix uninitialized variable warnings


# 1.21 14-Jul-2003 lukem

add missing __KERNEL_RCSID()


# 1.20 01-Feb-2003 thorpej

branches: 1.20.2;
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.19 31-Jan-2003 thorpej

Use aprint_*().


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.18 23-Dec-2002 tsutsui

Replace magic numbers for power management control with PCI_PMCSR* macros.

XXX Should we use pci_get_powerstate() and pci_set_powerstate() in pci.c?


Revision tags: gmcgarry_ctxsw_base gmcgarry_ucred_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.17 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.16 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.15 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: gehenna-devsw-base
# 1.14 08-Aug-2002 itojun

audit bitmask test mistake (s/&&/&/). from openbsd


# 1.13 02-Jun-2002 jmcneill

Fix the mixer controls to work a bit better.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.12 24-Mar-2002 jmcneill

branches: 1.12.2;
Fix suspend/resume. Previously, suspending/resuming while playback was active
would either:

1. Cause the machine to stop responding, or
2. Cause the currently playing voices to stop output.

With this change, voices are stopped on suspend, and continue from where they
left off on resume.


Revision tags: eeh-devprop-base
# 1.11 16-Mar-2002 jmcneill

Add multiple voice support to the ESS Allegro-1 / Maestro-3 family of
audio accelerators.

Mixing is done in hardware by the ASSP, but is limited to 4 simultaneous
channels due to the restricted "minisrc" image that we are currently
working with.

Due to limitations in the audio subsystem, I'm currently attaching multiple
'audio' devices to 'esa', one for each voice. Because of this hack, the
default ESA_NUM_VOICES is 1.


# 1.10 10-Mar-2002 jmcneill

Correctly enable/disable the low-pass filter, depending on the sample rate.
This fixes timing issues when playing back at 48kHz (noticable using
pkgsrc/graphics/mplayer and DivX ;-) streams).


Revision tags: newlock-base ifpoll-base
# 1.9 26-Feb-2002 joda

in esa_resume, call esa_codec_reset; makes it much more happy after a
suspend on my O500 (snatched from FreeBSD)


# 1.8 23-Jan-2002 pooka

branches: 1.8.2;
free memory allocated for suspend save area in detach


# 1.7 14-Jan-2002 pooka

Use standard PCI power management definitions from pcireg.h instead
of homegrown ones.

suggested by Soren


# 1.6 13-Jan-2002 jmcneill

Every card I've seen has had their channels swapped with respect
to the mixer. Ie:
$ mixerctl -w outputs.master=0,191
Would result in the _right_ speaker being turned off.

So, we will swap the left and right mixer channels to compensate
for this.


# 1.5 13-Jan-2002 jmcneill

Use malloc's M_ZERO flag instead of malloc/memset.


# 1.4 13-Jan-2002 pooka

Add support for the driver to work after suspend/resume. Does nothing
fancy, works for the basic output case, but does not support programs
which use playback while going into suspend.

Sketched after code found in FreeBSD and Linux drivers.


# 1.3 07-Jan-2002 jmcneill

branches: 1.3.2; 1.3.4;
Integrate recording support into the driver. Not very heavily tested yet.


# 1.2 06-Jan-2002 augustss

Note that Don Kim wrote the original Linux driver.


# 1.1 06-Jan-2002 jmcneill

Import driver for the ESS Allegro-1 / Maestro-3 based PCI Audio Accelerators.


Revision tags: isaki-audio2-base
# 1.63 16-Mar-2019 isaki

branches: 1.63.2;
Use C99 style struct initializer to audio_hw_if.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.62 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base
# 1.61 01-Jun-2017 chs

branches: 1.61.8;
remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.60 29-Mar-2014 christos

branches: 1.60.6;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.59 16-Oct-2013 christos

- use proper types (uint16_t instead of uint32_t)
- don't index past the end of arrays
- use __arraycount() consistently instead of manual cruft.
- remove useless cast


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.58 30-Jan-2012 drochner

branches: 1.58.6; 1.58.10;
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base
# 1.57 03-Dec-2011 ryo

branches: 1.57.2;
the argument of esa_get_locks() is struct esa_voice *, not struct esa_softc *.

ok by mrg@ jmcneill@


# 1.56 24-Nov-2011 mrg

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.55 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.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9
# 1.54 24-Feb-2010 dyoung

branches: 1.54.10; 1.54.12;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.


Revision tags: uebayasi-xip-base
# 1.53 08-Jan-2010 dyoung

branches: 1.53.2;
Expand PMF_FN_* macros.


Revision tags: matt-premerge-20091211
# 1.52 26-Nov-2009 njoly

Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase jym-xensuspend-base
# 1.51 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base wrstuden-revivesa-base mjf-devfs2-base
# 1.50 10-Jun-2008 dyoung

branches: 1.50.8; 1.50.10;
Fix a couple of mistakes in the device_t/softc split that cause
machines such as my HP Pavilion N3270 to freeze at boot. This
should fix PR kern/38815, too.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2
# 1.49 13-May-2008 jmcneill

branches: 1.49.2;
Hook hardware volume buttons into pmf.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.48 27-Mar-2008 jmcneill

branches: 1.48.2; 1.48.4; 1.48.6;
Split device_t and softc


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.47 21-Mar-2008 dyoung

Use aprint_*_dev() instead of accessing struct device member dv_xname
directly.


# 1.46 21-Mar-2008 dyoung

pci_activate() expects for its void * argument to be a device_t,
so change the type of the argument to device_t. Update each use
of pci_activate().

Use device_t and accessors. Use aprint_*_dev().


Revision tags: hpcarm-cleanup-base
# 1.45 22-Feb-2008 dyoung

Add methods for detaching self and for detaching children.

Use device_t and accessors. Use aprint_*_dev().


Revision tags: nick-net80211-sync-base mjf-devfs-base
# 1.44 27-Jan-2008 jmcneill

branches: 1.44.2; 1.44.6;
On resume, ensure that esa is powered up, and ensure we power the
AC97 codec once the host controller is up and running.


Revision tags: bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base matt-armv6-base
# 1.43 09-Dec-2007 jmcneill

Merge jmcneill-pm branch.


Revision tags: yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base reinoud-bufcleanup-base
# 1.42 19-Oct-2007 ad

branches: 1.42.2; 1.42.4; 1.42.6;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.41 04-Mar-2007 christos

branches: 1.41.2; 1.41.14; 1.41.16; 1.41.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.40 16-Nov-2006 christos

branches: 1.40.4; 1.40.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.39 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


# 1.38 25-Sep-2006 jmcneill

No need to call pci_set_powerstate from our powerhook, the bus handles this
for us now.


# 1.37 24-Sep-2006 jmcneill

PR# 23620: channels are swapped


# 1.36 24-Sep-2006 jmcneill

Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@


# 1.35 24-Sep-2006 jmcneill

Formatting fixups, remove commented out code that should not have been here,
and remove a few unnecessary XXX comments.


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.34 30-Aug-2006 christos

branches: 1.34.2; 1.34.4;
missing comma


# 1.33 30-Aug-2006 christos

fix incomplete initializers


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase chap-midi-base
# 1.32 17-Jun-2006 christos

re-factor the pci powestate api. reviewed by gimpy


Revision tags: gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.8; 1.31.14; 1.31.16;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 ktrace-lwp-base
# 1.30 29-Oct-2005 jmcneill

Wow, this is clearly wrong (found in esa_set_params):
if (p->channels < 1 && p->channels > 2)
return EINVAL;
Change the 'and' to an 'or' so the check actually does something.


Revision tags: yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.29 28-Jun-2005 thorpej

branches: 1.29.2; 1.29.4;
Use ANSI function decls and static.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base
# 1.28 15-Jan-2005 kent

ansify and KNF


# 1.27 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


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.26 29-Oct-2004 yamt

branches: 1.26.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.25 22-Sep-2004 kent

ac97_host_if::reset() returns non-zero value if codec reset fails, and
ac97 is not attached in that case.

PR: kern/26973


# 1.24 21-Jul-2004 scw

- Don't hardcode buffer size and block size in esa_round_buffersize() and
esa_round_blocksize().
- Fix esa_trigger_output() and esa_trigger_input() to initialise the
channel's buffer/block size using the supplied parameters.
- While here, simplify esa_intr().

This gets kphone working on my esa(4)-equipped laptop.


# 1.23 23-Apr-2004 itojun

pass string length (= boundary info) to pci_devinfo so that we do not run over
the end of memory region


Revision tags: netbsd-2-0-base
# 1.22 25-Oct-2003 christos

branches: 1.22.2;
Fix uninitialized variable warnings


# 1.21 14-Jul-2003 lukem

add missing __KERNEL_RCSID()


# 1.20 01-Feb-2003 thorpej

branches: 1.20.2;
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.19 31-Jan-2003 thorpej

Use aprint_*().


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.18 23-Dec-2002 tsutsui

Replace magic numbers for power management control with PCI_PMCSR* macros.

XXX Should we use pci_get_powerstate() and pci_set_powerstate() in pci.c?


Revision tags: gmcgarry_ctxsw_base gmcgarry_ucred_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.17 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.16 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.15 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: gehenna-devsw-base
# 1.14 08-Aug-2002 itojun

audit bitmask test mistake (s/&&/&/). from openbsd


# 1.13 02-Jun-2002 jmcneill

Fix the mixer controls to work a bit better.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.12 24-Mar-2002 jmcneill

branches: 1.12.2;
Fix suspend/resume. Previously, suspending/resuming while playback was active
would either:

1. Cause the machine to stop responding, or
2. Cause the currently playing voices to stop output.

With this change, voices are stopped on suspend, and continue from where they
left off on resume.


Revision tags: eeh-devprop-base
# 1.11 16-Mar-2002 jmcneill

Add multiple voice support to the ESS Allegro-1 / Maestro-3 family of
audio accelerators.

Mixing is done in hardware by the ASSP, but is limited to 4 simultaneous
channels due to the restricted "minisrc" image that we are currently
working with.

Due to limitations in the audio subsystem, I'm currently attaching multiple
'audio' devices to 'esa', one for each voice. Because of this hack, the
default ESA_NUM_VOICES is 1.


# 1.10 10-Mar-2002 jmcneill

Correctly enable/disable the low-pass filter, depending on the sample rate.
This fixes timing issues when playing back at 48kHz (noticable using
pkgsrc/graphics/mplayer and DivX ;-) streams).


Revision tags: newlock-base ifpoll-base
# 1.9 26-Feb-2002 joda

in esa_resume, call esa_codec_reset; makes it much more happy after a
suspend on my O500 (snatched from FreeBSD)


# 1.8 23-Jan-2002 pooka

branches: 1.8.2;
free memory allocated for suspend save area in detach


# 1.7 14-Jan-2002 pooka

Use standard PCI power management definitions from pcireg.h instead
of homegrown ones.

suggested by Soren


# 1.6 13-Jan-2002 jmcneill

Every card I've seen has had their channels swapped with respect
to the mixer. Ie:
$ mixerctl -w outputs.master=0,191
Would result in the _right_ speaker being turned off.

So, we will swap the left and right mixer channels to compensate
for this.


# 1.5 13-Jan-2002 jmcneill

Use malloc's M_ZERO flag instead of malloc/memset.


# 1.4 13-Jan-2002 pooka

Add support for the driver to work after suspend/resume. Does nothing
fancy, works for the basic output case, but does not support programs
which use playback while going into suspend.

Sketched after code found in FreeBSD and Linux drivers.


# 1.3 07-Jan-2002 jmcneill

branches: 1.3.2; 1.3.4;
Integrate recording support into the driver. Not very heavily tested yet.


# 1.2 06-Jan-2002 augustss

Note that Don Kim wrote the original Linux driver.


# 1.1 06-Jan-2002 jmcneill

Import driver for the ESS Allegro-1 / Maestro-3 based PCI Audio Accelerators.


# 1.61 01-Jun-2017 chs

remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.


Revision tags: prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 nick-nhusb-base-20170204 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 nick-nhusb-base-20161204 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE nick-nhusb-base-20161004 localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 netbsd-7-0-1-RELEASE nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 netbsd-7-0-RELEASE nick-nhusb-base-20150921 netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base tls-maxphys-base
# 1.60 29-Mar-2014 christos

make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.59 16-Oct-2013 christos

- use proper types (uint16_t instead of uint32_t)
- don't index past the end of arrays
- use __arraycount() consistently instead of manual cruft.
- remove useless cast


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.58 30-Jan-2012 drochner

branches: 1.58.6; 1.58.10;
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base
# 1.57 03-Dec-2011 ryo

branches: 1.57.2;
the argument of esa_get_locks() is struct esa_voice *, not struct esa_softc *.

ok by mrg@ jmcneill@


# 1.56 24-Nov-2011 mrg

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.55 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.


Revision tags: jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231 uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 rmind-uvmplock-base yamt-nfs-mp-base9
# 1.54 24-Feb-2010 dyoung

branches: 1.54.10; 1.54.12;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.


Revision tags: uebayasi-xip-base
# 1.53 08-Jan-2010 dyoung

branches: 1.53.2;
Expand PMF_FN_* macros.


Revision tags: matt-premerge-20091211
# 1.52 26-Nov-2009 njoly

Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.


Revision tags: yamt-nfs-mp-base8 yamt-nfs-mp-base7 jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-nbase jym-xensuspend-base
# 1.51 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base wrstuden-revivesa-base mjf-devfs2-base
# 1.50 10-Jun-2008 dyoung

branches: 1.50.8; 1.50.10;
Fix a couple of mistakes in the device_t/softc split that cause
machines such as my HP Pavilion N3270 to freeze at boot. This
should fix PR kern/38815, too.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2
# 1.49 13-May-2008 jmcneill

branches: 1.49.2;
Hook hardware volume buttons into pmf.


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.48 27-Mar-2008 jmcneill

branches: 1.48.2; 1.48.4; 1.48.6;
Split device_t and softc


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.47 21-Mar-2008 dyoung

Use aprint_*_dev() instead of accessing struct device member dv_xname
directly.


# 1.46 21-Mar-2008 dyoung

pci_activate() expects for its void * argument to be a device_t,
so change the type of the argument to device_t. Update each use
of pci_activate().

Use device_t and accessors. Use aprint_*_dev().


Revision tags: hpcarm-cleanup-base
# 1.45 22-Feb-2008 dyoung

Add methods for detaching self and for detaching children.

Use device_t and accessors. Use aprint_*_dev().


Revision tags: nick-net80211-sync-base mjf-devfs-base
# 1.44 27-Jan-2008 jmcneill

branches: 1.44.2; 1.44.6;
On resume, ensure that esa is powered up, and ensure we power the
AC97 codec once the host controller is up and running.


Revision tags: bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base matt-armv6-base
# 1.43 09-Dec-2007 jmcneill

Merge jmcneill-pm branch.


Revision tags: yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 jmcneill-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base reinoud-bufcleanup-base
# 1.42 19-Oct-2007 ad

branches: 1.42.2; 1.42.4; 1.42.6;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.41 04-Mar-2007 christos

branches: 1.41.2; 1.41.14; 1.41.16; 1.41.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.40 16-Nov-2006 christos

branches: 1.40.4; 1.40.6;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.39 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


# 1.38 25-Sep-2006 jmcneill

No need to call pci_set_powerstate from our powerhook, the bus handles this
for us now.


# 1.37 24-Sep-2006 jmcneill

PR# 23620: channels are swapped


# 1.36 24-Sep-2006 jmcneill

Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@


# 1.35 24-Sep-2006 jmcneill

Formatting fixups, remove commented out code that should not have been here,
and remove a few unnecessary XXX comments.


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 yamt-pdpolicy-base8 rpaulo-netinet-merge-pcb-base
# 1.34 30-Aug-2006 christos

branches: 1.34.2; 1.34.4;
missing comma


# 1.33 30-Aug-2006 christos

fix incomplete initializers


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7 yamt-pdpolicy-base6 chap-midi-nbase chap-midi-base
# 1.32 17-Jun-2006 christos

re-factor the pci powestate api. reviewed by gimpy


Revision tags: gdamore-uart-base simonb-timcounters-final yamt-pdpolicy-base5 yamt-pdpolicy-base4 yamt-pdpolicy-base3 peter-altq-base yamt-pdpolicy-base2 elad-kernelauth-base yamt-pdpolicy-base yamt-uio_vmspace-base5 simonb-timecounters-base
# 1.31 11-Dec-2005 christos

branches: 1.31.4; 1.31.8; 1.31.14; 1.31.16;
merge ktrace-lwp.


Revision tags: yamt-readahead-base3 yamt-readahead-base2 yamt-readahead-pervnode yamt-readahead-perfile yamt-readahead-base yamt-vop-base3 ktrace-lwp-base
# 1.30 29-Oct-2005 jmcneill

Wow, this is clearly wrong (found in esa_set_params):
if (p->channels < 1 && p->channels > 2)
return EINVAL;
Change the 'and' to an 'or' so the check actually does something.


Revision tags: yamt-vop-base2 thorpej-vnode-attr-base yamt-vop-base
# 1.29 28-Jun-2005 thorpej

branches: 1.29.2; 1.29.4;
Use ANSI function decls and static.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 yamt-km-base4 yamt-km-base3 netbsd-3-base yamt-km-base2 yamt-km-base kent-audio2-base
# 1.28 15-Jan-2005 kent

ansify and KNF


# 1.27 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


Revision tags: kent-audio1-beforemerge kent-audio1-base
# 1.26 29-Oct-2004 yamt

branches: 1.26.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.


# 1.25 22-Sep-2004 kent

ac97_host_if::reset() returns non-zero value if codec reset fails, and
ac97 is not attached in that case.

PR: kern/26973


# 1.24 21-Jul-2004 scw

- Don't hardcode buffer size and block size in esa_round_buffersize() and
esa_round_blocksize().
- Fix esa_trigger_output() and esa_trigger_input() to initialise the
channel's buffer/block size using the supplied parameters.
- While here, simplify esa_intr().

This gets kphone working on my esa(4)-equipped laptop.


# 1.23 23-Apr-2004 itojun

pass string length (= boundary info) to pci_devinfo so that we do not run over
the end of memory region


Revision tags: netbsd-2-0-base
# 1.22 25-Oct-2003 christos

branches: 1.22.2;
Fix uninitialized variable warnings


# 1.21 14-Jul-2003 lukem

add missing __KERNEL_RCSID()


# 1.20 01-Feb-2003 thorpej

branches: 1.20.2;
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.19 31-Jan-2003 thorpej

Use aprint_*().


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.18 23-Dec-2002 tsutsui

Replace magic numbers for power management control with PCI_PMCSR* macros.

XXX Should we use pci_get_powerstate() and pci_set_powerstate() in pci.c?


Revision tags: gmcgarry_ctxsw_base gmcgarry_ucred_base kqueue-aftermerge kqueue-beforemerge kqueue-base
# 1.17 02-Oct-2002 thorpej

Add trailing ; to CFATTACH_DECL.


# 1.16 30-Sep-2002 thorpej

Use CFATTACH_DECL().


# 1.15 27-Sep-2002 thorpej

Declare all cfattach structures const.


Revision tags: gehenna-devsw-base
# 1.14 08-Aug-2002 itojun

audit bitmask test mistake (s/&&/&/). from openbsd


# 1.13 02-Jun-2002 jmcneill

Fix the mixer controls to work a bit better.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.12 24-Mar-2002 jmcneill

branches: 1.12.2;
Fix suspend/resume. Previously, suspending/resuming while playback was active
would either:

1. Cause the machine to stop responding, or
2. Cause the currently playing voices to stop output.

With this change, voices are stopped on suspend, and continue from where they
left off on resume.


Revision tags: eeh-devprop-base
# 1.11 16-Mar-2002 jmcneill

Add multiple voice support to the ESS Allegro-1 / Maestro-3 family of
audio accelerators.

Mixing is done in hardware by the ASSP, but is limited to 4 simultaneous
channels due to the restricted "minisrc" image that we are currently
working with.

Due to limitations in the audio subsystem, I'm currently attaching multiple
'audio' devices to 'esa', one for each voice. Because of this hack, the
default ESA_NUM_VOICES is 1.


# 1.10 10-Mar-2002 jmcneill

Correctly enable/disable the low-pass filter, depending on the sample rate.
This fixes timing issues when playing back at 48kHz (noticable using
pkgsrc/graphics/mplayer and DivX ;-) streams).


Revision tags: newlock-base ifpoll-base
# 1.9 26-Feb-2002 joda

in esa_resume, call esa_codec_reset; makes it much more happy after a
suspend on my O500 (snatched from FreeBSD)


# 1.8 23-Jan-2002 pooka

branches: 1.8.2;
free memory allocated for suspend save area in detach


# 1.7 14-Jan-2002 pooka

Use standard PCI power management definitions from pcireg.h instead
of homegrown ones.

suggested by Soren


# 1.6 13-Jan-2002 jmcneill

Every card I've seen has had their channels swapped with respect
to the mixer. Ie:
$ mixerctl -w outputs.master=0,191
Would result in the _right_ speaker being turned off.

So, we will swap the left and right mixer channels to compensate
for this.


# 1.5 13-Jan-2002 jmcneill

Use malloc's M_ZERO flag instead of malloc/memset.


# 1.4 13-Jan-2002 pooka

Add support for the driver to work after suspend/resume. Does nothing
fancy, works for the basic output case, but does not support programs
which use playback while going into suspend.

Sketched after code found in FreeBSD and Linux drivers.


# 1.3 07-Jan-2002 jmcneill

branches: 1.3.2; 1.3.4;
Integrate recording support into the driver. Not very heavily tested yet.


# 1.2 06-Jan-2002 augustss

Note that Don Kim wrote the original Linux driver.


# 1.1 06-Jan-2002 jmcneill

Import driver for the ESS Allegro-1 / Maestro-3 based PCI Audio Accelerators.