Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/auich.c
RevisionDateAuthorComments
 1.161  10-May-2023  riastradh auich(4): Use config_detach_children.
 1.160  06-Feb-2021  isaki Hold sc_intr_lock in open()/close().
vtbl->{lock,unlock} (in fact ac97_{lock,unlock}) don't seem to need
releasing an interrupt lock.
Confirmed on auich.
 1.159  29-Feb-2020  isaki branches: 1.159.6;
round_blocksize must return a multiple of the framesize
even if 6 channels mode.
I believe that keeping "good alignment" is just a wish, not constraint.
 1.158  06-Dec-2019  maxv branches: 1.158.2;
Minor changes, reported by the LGTM bot.
 1.157  08-Jun-2019  isaki branches: 1.157.2;
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.156  11-May-2019  christos Don't return the raw audio formats; return the ones after we disabled some
of them because the device does not support them. Fixes panic in virtualbox.
 1.155  08-May-2019  isaki Merge isaki-audio2 branch, the overhaul of audio subsystem.
- Interrupt-oriented system rather than thread-oriented.
- Improve stability, quality and performance.
- Split playback and record cleanly. Improve halfduplex support.
- Many bugs are fixed including deadlocks, resource leaks, abuses, etc.
- Simplify audio filter mechanism. The encoding/channels/frequency
conversions are completely handled in the upper layer. So the hard-
ware driver only converts its hardware encoding (if necessary).
- audio_hw_if changes:
- Obsoletes query_encoding and add query_format instead.
- Obsoletes set_params and add set_format instead.
- Remove drain, setfd, mappage.
- The call sequences are changed.
- ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted.
- ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced.
- cleanup config attributes: au*conv and mulaw.
- All hardware drivers should follow it (I've done as much as possible).

Some file paths are changed:
- dev/audio.c -> dev/audio/audio.c (rewritten)
- dev/audiovar.h -> dev/audio/audiovar.h
- dev/audio_dai.h -> dev/audio/audio_dai.h
- dev/audio_if.h -> dev/audio/audio_if.h
- dev/audiobell.c -> dev/audio/audiobell.c
- dev/audiobellvar.h -> dev/audio/audiobellvar.h
- dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
 1.154  18-Apr-2019  isaki branches: 1.154.2;
White space and indent fix.
 1.153  16-Mar-2019  isaki Use C99 style struct initializer to audio_hw_if.
 1.152  24-Mar-2018  jdolecek branches: 1.152.2;
use pci_intr_establish_xname()
 1.151  01-Jun-2017  chs branches: 1.151.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.
 1.150  25-Jan-2017  martin auich_round_blocksize: never return 0 as blocksize
 1.149  07-Jul-2016  msaitoh branches: 1.149.2; 1.149.4;
KNF. Remove extra spaces. No functional change.
 1.148  24-May-2015  christos PR/49926: Robert Millan: Avoid deadlock condition in auich_read_codec()
and auich_write_codec() when running in userspase.
 1.147  24-May-2015  christos PR/49927: Robert Millan: Avoid zerodivide on emulated hardware.
 1.146  24-May-2015  christos use aprint consistently; note that we use aprint_normal_dev in debugging
statements instead of aprint_debug_dev because those are controlled by
the driver debugging, not the centralized one.
 1.145  13-Apr-2015  riastradh Convert sys/dev to use <sys/rndsource.h>.
 1.144  10-Aug-2014  tls branches: 1.144.4;
Merge tls-earlyentropy branch into HEAD.
 1.143  29-Mar-2014  christos branches: 1.143.2;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.142  25-Feb-2014  pooka Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
 1.141  02-Jun-2012  dsl branches: 1.141.2; 1.141.4;
Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
the item itself.
In the places where the caller specifies a function and a structure
address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
 1.140  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.139  23-Nov-2011  jmcneill Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

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

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

Welcome to 5.99.57.
 1.138  13-Nov-2010  uebayasi branches: 1.138.8; 1.138.10;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.137  24-Feb-2010  dyoung branches: 1.137.2;
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.
 1.136  01-Feb-2010  njoly branches: 1.136.2;
Do not print ac97 link rate message unless verbose boot is requested.
 1.135  13-Jan-2010  jakllsch Revert code I added in 1.133 that touches the PCI_COMMAND_IO_ENABLE and
PCI_COMMAND_MEM_ENABLE bits in PCI_COMMAND_STATUS_REG. This causes
problems where the BAR is 0. 'options PCI_ADDR_FIXUP' is more
appropriate when these bits are not set correctly by the BIOS.
 1.134  08-Jan-2010  dyoung Expand PMF_FN_* macros.
 1.133  30-Dec-2009  jakllsch Ensure that the memory or i/o space we need is accessible at attach
and resume.

Rework register mapping code path, using 'goto', so duplicate code
is reduced.

I've tested this on nvidia and sis auich(4)-compatible controllers.
In addition this change is reported to fix PR/39652.
 1.132  26-Nov-2009  njoly Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.
 1.131  12-Nov-2009  dyoung Remove superfluous activation hook.
 1.130  03-Sep-2009  sborrill SiS 7012 uses different multichannel control bits compared to other codecs
(data from linux via OpenBSD).
 1.129  17-Mar-2009  dyoung Handle child-detachment by NULL'ing the child pointer so that
auich_detach() does not subsequently dereference a dangling pointer.
 1.128  08-Nov-2008  dyoung branches: 1.128.2; 1.128.4;
To finish the device_t/softc split, convert some casts to struct
auich_softc * to device_private() calls.
 1.127  04-May-2008  xtraeme branches: 1.127.6; 1.127.8; 1.127.10; 1.127.14;
device_t/softc split and other related cosmetic changes.
 1.126  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.125  10-Apr-2008  cegger branches: 1.125.2; 1.125.4;
use aprint_*_dev and device_xname
 1.124  29-Feb-2008  dyoung Use PMF_FN_ARGS, PMF_FN_PROTO.
 1.123  06-Jan-2008  kent branches: 1.123.2; 1.123.6;
fix a bug of S/PDIF audio format selection

PR/36493 by Arcady Antipin
 1.122  13-Dec-2007  jmcneill Make this compile again.
 1.121  13-Dec-2007  jmcneill Restore the native mode PCI conf register on select chipsets on resume,
in case it was lost when power was removed.
 1.120  09-Dec-2007  jmcneill branches: 1.120.2;
Merge jmcneill-pm branch.
 1.119  19-Oct-2007  ad branches: 1.119.2; 1.119.4; 1.119.6;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.118  02-Sep-2007  xtraeme branches: 1.118.4;
Attach to the ICH6 AC-97 Modem function.
 1.117  04-Mar-2007  christos branches: 1.117.2; 1.117.10; 1.117.14; 1.117.16;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.116  21-Feb-2007  thorpej branches: 1.116.2;
Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
 1.115  16-Nov-2006  christos branches: 1.115.4;
__unused removal on arguments; approved by core.
 1.114  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.113  25-Sep-2006  jmcneill No need to call pci_set_powerstate from our powerhook, the bus handles this
for us now.
 1.112  24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.111  03-Aug-2006  bsh branches: 1.111.4; 1.111.6;
Device 10de:026c is not AC-97 controller but nForce430 HD Audio controller.

Pointed out by Brad. Thanks.
 1.110  01-Aug-2006  bsh Support nForce430's audio.

(I have tested this only with nFroce410, not with nFroce430)
 1.109  28-Jul-2006  kent add support for S/PDIF.
 1.108  17-Jun-2006  christos re-factor the pci powestate api. reviewed by gimpy
 1.107  27-Apr-2006  jmcneill branches: 1.107.2; 1.107.4;
Disable my aggressive power saving changes; they're causing too many
problems.
 1.106  16-Apr-2006  jmcneill Use AC97_HOST_INVERTED_EAMP on the Sony VAIO VGN-B1XP. From PR#33272 by
Dieter Roelants.
 1.105  16-Apr-2006  christos Deal with machines that have inverted eamp power. Data from the FreeBSD
driver. Finally sound works on my vaio vgn-t250p.
 1.104  14-Apr-2006  rpaulo s/#ifdef DEBUG/#ifdef AUICH_DEBUG/
 1.103  07-Mar-2006  jmcneill branches: 1.103.2;
Don't try to suspend while already suspended.
 1.102  07-Mar-2006  jmcneill branches: 1.102.2;
Put the device in D3 state when it's not in use to save power.
 1.101  04-Dec-2005  xtraeme branches: 1.101.4; 1.101.6; 1.101.8;
Add support for Intel 6300ESB.
 1.100  02-Dec-2005  xtraeme Add support for ICH7. Tested by gendalia@.
 1.99  22-Aug-2005  rpaulo Use #ifdef AUICH_DEBUG instead of #if 0/#if 1. Suggested by perry@.
 1.98  21-Aug-2005  rpaulo PR#31030: debug printf in auich_halt_pipe. From lmneto@gmail.com.
It was under #if 1, so I just replaced the if by 0.
 1.97  28-Jun-2005  thorpej branches: 1.97.2;
Use ANSI function decls and static.
 1.96  20-Jun-2005  atatat Change the rest of the sysctl subsystem to use const consistently.
The __UNCONST macro is now used only where necessary and the RW macros
are gone. Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
 1.95  12-Apr-2005  jmcneill Some broken codecs don't release the CAS on reads to AC97_REG_GPIO_STATUS.
In auich_read_codec, do a dummy read to the RESET register if we're
reading GPIO_STATUS to be safe.
 1.94  11-Apr-2005  jmcneill i82801CA is an ICH3, not ICH2. Fix typo in auich_modem_devices. Pointed out
by Nicolas Joly.
 1.93  08-Apr-2005  jmcneill Add identifiers for Intel ICH3 AC'97 modems and CXT33 modem codecs, from
Nicolas Joly <njoly _at_ pasteur _dot_ fr>.
 1.92  07-Apr-2005  jmcneill More modem fixes:
* Ignore ICH_PCM246_MASK for modem devices
* Set LINE1 rate and level in set_params
* Enable mmap for modem devices. This was previously disallowed due to
the ext_id field not advertising that the device supported variable
rates. Since modems don't use ext_id (they use ext_mid instead), enable
mmap. Multiple rates are supported on AC'97 modems.
 1.91  04-Apr-2005  jmcneill Work-in-progress of AC'97 modem support. Currently disabled by default
(can be enabled by options AUICH_ATTACH_MODEM), and untested. Shouldn't
have any impact on auich audio capabilities.
 1.90  11-Mar-2005  mycroft branches: 1.90.2;
Three changes:
1) After setting an input or output channel to pause, watch for DCH (DMA
halted) to be set before resetting the registers. The manual says this is
required. This *may* fix random auich lockups.
2) Add auich_{trigger,intr,halt}_pipe(), which can operate on any of the
input and output channels. This reduces code duplication quite a bit.
While I'm at it, fill in the mic interrupt handling.
3) The mic in interrupt is MINT, not MIINT. (The latter is modem input.)
 1.89  27-Feb-2005  perry nuke trailing whitespace
 1.88  27-Jan-2005  jdolecek match nForce2 Ultra 400 audio
 1.87  27-Jan-2005  kent support nForce 4
 1.86  26-Jan-2005  jmcneill Add pci_conf_{capture,restore} to auich(4) powerhook
 1.85  15-Jan-2005  kent branches: 1.85.2; 1.85.4;
ansify and KNF
 1.84  10-Jan-2005  kent merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes
 1.83  11-Dec-2004  cube Some SiS 7012 chips come muted by default, so un-mute all SiS 7012 chips at
attach time the way Linux does it. Reported and tested by Jonathan
Schleifer, I checked it didn't break my own 7012 device which doesn't need
that manipulation.
 1.82  17-Nov-2004  kent branches: 1.82.2;
implement auich_activate() and auich_detach()
 1.81  17-Nov-2004  kent make functions static as possible
 1.80  13-Nov-2004  kent adopt auconv_set_converter()
 1.79  11-Nov-2004  kent device matching by pcireg_t, not a pair of vendor ID and product ID.
This change reduces 170 Byte of i386 kernel size.
 1.78  10-Nov-2004  cube Add support for the ICH6 AC97 controller.
 1.77  10-Nov-2004  cube Return an error when a read operation fails, instead of pretending it
succeeded and transmitting a bogus value.
 1.76  10-Nov-2004  cube In auich_calibrate, set sc_ac97_clock to a default value of 48000 first.
That way, if the calibration fails or times out, sc_ac97_clock won't be 0
and there won't be a division by zero later in ac97_set_rate.
 1.75  10-Nov-2004  kent move IS_FIXED_RATE(), SUPPORTS_4CH(), and SUPPORTS_6CH to ac97var.h
 1.74  06-Nov-2004  xtraeme Add support for "nForce3 250 MCP-T AC-97 Audio", from Kouichirou Hiratsuka
in PR 27843.

Ok'ed christos@
 1.73  01-Nov-2004  mycroft Some miscellaneous cleanup:
* Encapsulate all the ring-specific variables into a substructure. (This will
help with some potential code sharing.)
* Don't bother with "last buffer complete" interrupts -- we should be taking an
interrupt anyway because we set IOC on every buffer.
* Likewise, ignore CELV; it's meaningless to us.
* Get rid of the FIFO error counters, since this doesn't actually happen any
more.
 1.72  31-Oct-2004  mycroft Copyright maintenance.
 1.71  31-Oct-2004  mycroft More code reduction.
Also, allow any sample rate between 8000 and 48000Hz. (This range should
probably be larger, but this is what's known to work.)

Another 180 bytes shaved.
 1.70  31-Oct-2004  mycroft Shave another 112 bytes by reducing some divisions to shifts.
 1.69  31-Oct-2004  mycroft Fix a regression -- my previous changes made the kernel slightly larger.
 1.68  31-Oct-2004  mycroft In the trigger routines, start *all* the blocks, not just the first one. This
was causing some "fifo under/overrun" errors during the initial trigger.

Also fixes a ring synchronization problem introduced in the earlier changes.

This should completely fix the FIFO errors with auich.
 1.67  31-Oct-2004  mycroft Reorder some register writes just to be safe.
 1.66  31-Oct-2004  mycroft Attempt to mitigate "fifo underrun" errors in two ways:
1) Update the queue pointers any time we get a block completion interrupt,
not just when we hit the last block.
2) Set the "back-to-back enable" bit.
In addition:
3) Make sure we ack every block we transfer; there was a bug that could cause
the audio layer to get out of sync.
 1.65  29-Oct-2004  yamt constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.64  27-Oct-2004  kent add "hw.auichN.ac97rate" sysctl MIB to specify AC'97 link rate.
It is needed because automatic calibration by auich_calibrate() is not
so precise.

- Why not ioctl?
It is not good idea to add a new ioctl operation to MI audio for
a specific audio device.
- Why not mixerctl item?
AC'97 linke rate is not related to audio mixing.
 1.63  17-Oct-2004  kent no need to restore AC97_REG_EXT_AUDIO_CTRL value on resuming
because ac97_codec_if_vtbl::restore_ports() does it.
 1.62  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.61  07-Aug-2004  soren - Don't attempt to clear the CELV bit by setting it high like the
FIFOE/BCIS/LVBCI bits; it's is cleared automatically by the hardware.
- Separate AUICH_DEBUG out from AUDIO_DEBUG and make it possible to debug
interrupt handling separately.
- A little KNF.
 1.60  09-Jul-2004  mycroft Clean up. Attempt to make these safer against stray interrupts.
 1.59  09-Jul-2004  mycroft There's no need to halt the input and output pipes in the close routine --
audio_close() takes care of this.
 1.58  13-Jan-2004  kent branches: 1.58.2;
remove/modify confusing error messsges.
 1.57  03-Jan-2004  soren Only report codec readiness if DEBUG to avoid printing it on every resume.
 1.56  28-Dec-2003  kent ICH4/ICH5:
When native i/o mapping fails, try compatible i/o mapping.
 1.55  22-Nov-2003  kent For ICH4/ICH5, use native BARs instead of compatible BARs.
The patch was provided by Lars Heidieker.
 1.54  06-Nov-2003  mycroft Force the codec into a known state before trying to determine its speed.
 1.53  31-Oct-2003  kent auich_calibrate():
- make the buffer longer to improve the precision of measurement
- round off the result to the nearest multiple of 1000.
 1.52  30-Oct-2003  kent For ICH4/ICH5, set IOSE flag to make them compatible to old ICHs.
 1.51  28-Oct-2003  mycroft Eliminate bogus initializer (the code was technically wrong).
 1.50  25-Oct-2003  christos Fix uninitialized variable warnings
 1.49  24-Oct-2003  kent auich_reset_codec:
wait for readiness of one of all codecs.
 1.48  23-Oct-2003  kent Change the short names of nForce:
nForce-MCP -> nForce
nForce-MCP-T -> nForce2
nForce-MCP-T -> nForce3

Use snprintf() and strlcpy() instead of sprintf() and strcpy().
 1.47  23-Oct-2003  kent - remove unused code
- print diagnostic messages if the primary codec does not get ready in
auich_reset_codec().
 1.46  23-Oct-2003  kent No need to check the codec ready flag in read_codec() and write_codec().
According to the ICH datasheets, the flag is unchanged unless resetting
the codec.

The flag is useless after enabling bus mastering. This behavior is common
to all ICH chips. The quirk handling code is removed.
 1.45  22-Oct-2003  manu Patch from http://mail-index.netbsd.org/current-users/2003/09/04/0018.html
to fix problems with a sound card
 1.44  22-Oct-2003  fvdl Match the nForce3 AC-97 chip.
 1.43  21-Oct-2003  fvdl Add missing field initializer.
 1.42  02-Oct-2003  mycroft Cleanup:
* auich_calibrate() assumes that the AC97 part is in its reset state. To
ensure this, call audio_attach_mi() after auich_calibrate().
* Explicitly support 12000Hz and 24000Hz. (Why is there a discrete list at
all?)
* Fix an obvious recording bug -- we were acking the wrong interrupt.
* Ensure that we don't get an interrupt during the AC97 speed probe by clearing
the "interrupt on completion" bit in the DMA setup.
 1.41  28-Sep-2003  kent Support for 4ch/6ch audio playback.
 1.40  19-Aug-2003  erh Add entry for Intel 82801EB AC-97 audio. Audio sounds fine with this,
although the mixer settings are a bit odd: outputs.master doesn't do anything,
but outputs.surround does.
 1.39  13-Jun-2003  kent branches: 1.39.2;
Fix a regression of the last commit.
ICH4 needs IGNORE_CODEC_READY_MAYBE.
 1.38  13-Jun-2003  kent Not only ICH4 but also ICH0 and ICH2 might set no ICH_PCR.
The patch was provided by lha.

PR: kern/21031
 1.37  03-May-2003  wiz DMA, not dma nor Dma.
 1.36  01-Feb-2003  thorpej Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
 1.35  31-Jan-2003  thorpej Use aprint_*().
 1.34  28-Jan-2003  kent Apply BUS_DMA_NOCACHE for the buffers in the case of 440MX. The
code was provided by DHOYASHIKI Shinichi in kern/19919, and
address kern/19435.
 1.33  21-Jan-2003  kent Add DIAGNOSTIC code provided in PR kern/19919 by DHOYASHIKI Shinichi.
 1.32  16-Jan-2003  gendalia add support for nForce2 MCP-T
 1.31  15-Jan-2003  kent Fixed a problem that /dev/sound can not be opened in some cases.

auich_set_rate() modified audio_params::sample_rate to actual
sample rate though auich_set_params() rejected sample rates
other than some specific rates. For example, setting 8000Hz
with auich_set_params() modified sample_rate to 7998Hz in the
case of overclocked AC97 codec, and calling auich_set_params()
again returned with EINVAL because sample_rate was 7998Hz and
auich_set_params() rejected 7998Hz.

For now, auich_set_params() never modify audio_params::sample_rate.
 1.30  12-Oct-2002  wiz Fix typo in comment.
 1.29  11-Oct-2002  kent Kick auich_calibrate() by config_interrupts().

auichi_calibrate(): If the measured rate is less than 48k, use
48k.
 1.28  08-Oct-2002  kent auich_set_params(): Don't return in the for loop.
 1.27  08-Oct-2002  kent auich_softc:
Remove sc_fixed_rate and sc_ac97rate. ac97_softc has such
information.

auich_attach():
Remove VRA/VRM enabling code. ac97_attach() does it.

auich_set_rate():
Use ac97_codec_if::set_rate().

auich_get_props():
Return no AUDIO_PROP_MMAP if the codec is fixed-rate.

auichreg.h:
Remove unnecessary ICH_PM_*.
 1.26  06-Oct-2002  kent Add some constant symbols for AC97 registers and values based on OpenBSD.
Rename some symbols to sync with OpenBSD:
AC97_REG_EXTENDED_ID
-> AC97_REG_EXT_AUDIO_ID
AC97_REG_EXTENDED_STATUS
-> AC97_REG_EXT_AUDIO_CTRL
AC97_CODEC_DOES_VRA/AC97_ENAB_VRA
-> AC97_EXT_AUDIO_VRA
AC97_CODEC_DOES_MICVRA/AC97_ENAB_MICVRA
-> AC97_EXT_AUDIO_VRM

ac97feature: "mic channel" -> "dedicated mic channel"
ac97_attach(): print extended capabilities; VRA, DRA, SPDIF, VRM, CDAC,
SDAC, LDAC.
 1.25  04-Oct-2002  kent Improve nForce MCP support.

Submitted by: FUKAUMI Naoki <naoki at fukaumi dot org>
PR: kern/18524
 1.24  02-Oct-2002  kent Remove a line added accidentally(?) at revision 1.21.
 1.23  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.22  30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.21  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.20  28-Aug-2002  dsainty Fix playback at 48kHz sample rate (integer overflow bug introduced in 1.18)
 1.19  16-Aug-2002  kent Fix division-by-zero when auich_set_params() is called before auich_calibrate().
 1.18  07-Aug-2002  kent - Port clock calibration code (auich_calibrate) from ich.c of FreeBSD to solve
kern/16373.
- SiS 7012 support from kern/17716 submitted by Quentin Garnier.
- ICH4 support
- Experimental support for nForce MCP, AMD768 and AMD8111.
- Rename the short name for ICH3: "i830M" -> "ICH3"
 1.17  11-Apr-2002  augustss branches: 1.17.2; 1.17.4;
When the DAC claims to support variable rate it doesn't seem to
always do this, so do some extra chechs and fall back on fixed rate.
 1.16  23-Mar-2002  kent whitespace and folding fix.
 1.15  21-Mar-2002  kent Apply a patch by Mark Davies.
http://mail-index.netbsd.org/port-i386/2002/03/18/0000.html

Check codec status in auich_read/write_codec().
 1.14  15-Mar-2002  tacha Use appropriate emulation functions and set ADC rate(not DAC date!) for recording.
Now /dev/audio with auich becomes usable.
 1.13  10-Mar-2002  kent auich_set_params() sets 2 to hw_channels whenever monaural format is requested.
 1.12  07-Mar-2002  kent Sampling rate and mono-stereo conversion described in
http://mail-index.netbsd.org/tech-kern/2002/03/04/0005.html

auconv.c: Add conversion functions

audio.c: Sample alignment, calling conversion functions, etc.

audio_if.h: Add four hw_* members to "struct audio_params"

audiovar.h: Add conversion buffers, etc.

auich and uaudio: Add conversion request code to *_set_params().
 1.11  14-Feb-2002  augustss Oops, I messed up the last commit, try again.
 1.10  14-Feb-2002  augustss Make fixed rate codecs work. From Tsuyoshi Iguchi in kern/15606.
 1.9  02-Feb-2002  augustss Make auich support variable rate codec, and suspend/resume.
From URA Hiroshi in PR kern/15431 (partly from OpenBSD).
 1.8  14-Jan-2002  augustss Add i830M to the chip list.
 1.7  12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.6  12-Jan-2002  enami Skip not yet emulated 8bit ulinear encoding correctly.
 1.5  13-Nov-2001  lukem add RCSID
 1.4  03-Oct-2001  augustss Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).
 1.3  28-Dec-2000  sommerfeld branches: 1.3.2; 1.3.4; 1.3.6;
Change pci_intr_map to get interrupt source information from a "struct
pci_attach_args *" instead of from four separate parameters which in
all cases were extracted from the same "struct pci_attach_args".

This both simplifies the driver api, and allows for alternate PCI
interrupt mapping schemes, such as one using the tables described in
the Intel Multiprocessor Spec which describe interrupt wirings for
devices behind pci-pci bridges based on the device's location rather
the bridge's location.

Tested on alpha and i386; welcome to 1.5Q
 1.2  28-Nov-2000  thorpej branches: 1.2.2;
Use AC97_REG_* constants rather than defining them ourselves.
 1.1  28-Nov-2000  thorpej Device driver for the built-in audio on Intel ICH, ICH0, ICH2,
and i440MX chipsets. Based on a driver by Michael Shalayeff,
modified somewhat by me to use bus_dma properly, and fix some
audio encoding emulation bugs.

Thanks to Manuel Bouyer for testing and feedback.
 1.2.2.3  05-Jan-2001  bouyer Sync with HEAD
 1.2.2.2  08-Dec-2000  bouyer Sync with HEAD.
 1.2.2.1  28-Nov-2000  bouyer file auich.c was added on branch thorpej_scsipi on 2000-12-08 09:12:30 +0000
 1.3.6.1  11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.3.4.6  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.3.4.5  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.3.4.4  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.4.3  16-Mar-2002  jdolecek Catch up with -current.
 1.3.4.2  11-Feb-2002  jdolecek Sync w/ -current.
 1.3.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.11  17-Jan-2003  thorpej Sync with HEAD.
 1.3.2.10  15-Jan-2003  thorpej Sync with HEAD.
 1.3.2.9  18-Oct-2002  nathanw Catch up to -current.
 1.3.2.8  17-Sep-2002  nathanw Catch up to -current.
 1.3.2.7  27-Aug-2002  nathanw Catch up to -current.
 1.3.2.6  13-Aug-2002  nathanw Catch up to -current.
 1.3.2.5  17-Apr-2002  nathanw Catch up to -current.
 1.3.2.4  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.2.3  28-Feb-2002  nathanw Catch up to -current.
 1.3.2.2  14-Nov-2001  nathanw Catch up to -current.
 1.3.2.1  08-Oct-2001  nathanw Catch up to -current.
 1.17.4.1  15-Mar-2004  jmc Pullup patch (requested by kent in ticket #1612)

Add support for ICH3, ICH4, ICH5, SiS 7012, nForce MCP, nForce2 MCP-T, and
nForce3 MCP-T to auich driver
 1.17.2.1  29-Aug-2002  gehenna catch up with -current.
 1.39.2.16  11-Dec-2005  christos Sync with head.
 1.39.2.15  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.39.2.14  01-Apr-2005  skrll Sync with HEAD.
 1.39.2.13  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.39.2.12  04-Feb-2005  skrll Sync with HEAD.
 1.39.2.11  17-Jan-2005  skrll Sync with HEAD.
 1.39.2.10  18-Dec-2004  skrll Sync with HEAD.
 1.39.2.9  29-Nov-2004  skrll Sync with HEAD.
 1.39.2.8  14-Nov-2004  skrll Sync with HEAD.
 1.39.2.7  02-Nov-2004  skrll Sync with HEAD.
 1.39.2.6  19-Oct-2004  skrll Sync with HEAD
 1.39.2.5  24-Sep-2004  skrll Sync with HEAD.
 1.39.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.39.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.39.2.2  12-Aug-2004  skrll Sync with HEAD.
 1.39.2.1  03-Aug-2004  skrll Sync with HEAD
 1.58.2.1  22-Sep-2004  jmc branches: 1.58.2.1.2;
Pullup rev 1.62 (requested by kent in ticket #867)

ac97_host_if::reset() returns non-zero value if codec reset fails, and
ac97 is not attached in that case. PR#26973
 1.58.2.1.2.2  19-May-2005  tron Pull up revision 1.78 (requested by riz in ticket #1533):
Add support for the ICH6 AC97 controller.
 1.58.2.1.2.1  07-Apr-2005  tron Pull up revision 1.74 (requested by hira in ticket #1103):
Add support for "nForce3 250 MCP-T AC-97 Audio", from Kouichirou Hiratsuka
in PR 27843.
Ok'ed christos@
 1.82.2.2  09-Jan-2005  kent audio_hw_if change
* make open() and close() optional
* add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
 1.82.2.1  02-Jan-2005  kent * adopt the filter pipeline framework
* follow ac97_attach() change
 1.85.4.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.85.4.1  12-Feb-2005  yamt sync with head.
 1.85.2.1  29-Apr-2005  kent sync with -current
 1.90.2.2  06-Dec-2005  riz Apply patch (requested by xtraeme in ticket #1027):
sys/dev/pci/auich.c: patch
sys/dev/pci/auichreg.h: patch
Add support for Intel ICH7 and 6300ESB.
 1.90.2.1  30-Oct-2005  jmc Pullup revs 1.98-1.99 (requested by rpaulo in ticket #920)
Fix debug printf in auich_halt_pipe. PR#31030
 1.97.2.7  17-Mar-2008  yamt sync with head.
 1.97.2.6  21-Jan-2008  yamt sync with head
 1.97.2.5  27-Oct-2007  yamt sync with head.
 1.97.2.4  03-Sep-2007  yamt sync with head.
 1.97.2.3  26-Feb-2007  yamt sync with head.
 1.97.2.2  30-Dec-2006  yamt sync with head.
 1.97.2.1  21-Jun-2006  yamt sync with head.
 1.101.8.4  11-Aug-2006  yamt sync with head
 1.101.8.3  26-Jun-2006  yamt sync with head.
 1.101.8.2  24-May-2006  yamt sync with head.
 1.101.8.1  13-Mar-2006  yamt sync with head.
 1.101.6.2  01-Jun-2006  kardel Sync with head.
 1.101.6.1  22-Apr-2006  simonb Sync with head.
 1.101.4.1  09-Sep-2006  rpaulo sync with head
 1.102.2.3  11-May-2006  elad sync with head
 1.102.2.2  19-Apr-2006  elad sync with head.
 1.102.2.1  07-Mar-2006  elad file auich.c was added on branch elad-kernelauth on 2006-04-19 03:25:33 +0000
 1.103.2.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.107.4.1  13-Jul-2006  gdamore Merge from HEAD.
 1.107.2.1  19-Jun-2006  chap Sync with head.
 1.111.6.2  10-Dec-2006  yamt sync with head.
 1.111.6.1  22-Oct-2006  yamt sync with head
 1.111.4.1  18-Nov-2006  ad Sync with head.
 1.115.4.2  12-Mar-2007  rmind Sync with HEAD.
 1.115.4.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.116.2.1  27-Feb-2007  ad Add MP locking for audio drivers.
 1.117.16.3  23-Mar-2008  matt sync with HEAD
 1.117.16.2  09-Jan-2008  matt sync with HEAD
 1.117.16.1  06-Nov-2007  matt sync with HEAD
 1.117.14.7  08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.117.14.6  11-Nov-2007  joerg In auich_intr, check if device is currently powered down.
 1.117.14.5  06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.117.14.4  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.117.14.3  01-Oct-2007  joerg Extend device API by device_power_private and device_power_set_private.
The latter is a temporary mean until the pnp_register API itself is
overhault. This functions allow a generic power handler to store its
state independent of the driver.

Use this and revamp the PCI power handling. Pretty much all PCI devices
had power handlers that did the same thing, generalize this in
pci_generic_power_register/deregister and the handler. This interface
offers callbacks for the drivers to save and restore state on
transistions. After a long discussion with jmcneill@ it was considered
to be powerful enough until evidence is shown that devices can handle
D1/D2 with less code and higher speed than without the full
save/restore. The generic code is carefully written to handle device
without PCI-PM support and ensure that the correct registers are written
to when D3 loses all state.

Reimplement the generic PCI network device handling on
top of PCI generic power handling.

Introduce pci_disable_retry as used and implemented locally at least by
ath(4) and iwi(4). Use it in this drivers to restore behaviour from
before the introduction of generic PCI network handling.

Convert all PCI drivers that were using pnp_register to the new
framework. The only exception is vga(4) as it is commonly used as
console device. Add a note therein that this should be fixed later.
 1.117.14.2  03-Sep-2007  jmcneill Sync with HEAD.
 1.117.14.1  05-Aug-2007  jmcneill Convert auich powerhook to pnp power handler (untested).
 1.117.10.1  03-Sep-2007  skrll Sync with HEAD.
 1.117.2.2  23-Oct-2007  ad Sync with head.
 1.117.2.1  09-Oct-2007  ad Sync with head.
 1.118.4.1  25-Oct-2007  bouyer Sync with HEAD.
 1.119.6.1  11-Dec-2007  yamt sync with head.
 1.119.4.1  26-Dec-2007  ad Sync with head.
 1.119.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.120.2.2  08-Jan-2008  bouyer Sync with HEAD
 1.120.2.1  13-Dec-2007  bouyer Sync with HEAD
 1.123.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.123.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.123.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.123.2.1  24-Mar-2008  keiichi sync with head.
 1.125.4.4  11-Mar-2010  yamt sync with head
 1.125.4.3  16-Sep-2009  yamt sync with head
 1.125.4.2  04-May-2009  yamt sync with head.
 1.125.4.1  16-May-2008  yamt sync with head.
 1.125.2.1  18-May-2008  yamt sync with head.
 1.127.14.1  21-Apr-2010  matt sync to netbsd-5
 1.127.10.2  15-Jan-2010  snj Revert ticket 1218.
 1.127.10.1  09-Jan-2010  snj Pull up following revision(s) (requested by jakllsch in ticket #1218):
sys/dev/pci/auich.c: revision 1.133
Ensure that the memory or i/o space we need is accessible at attach
and resume.
Rework register mapping code path, using 'goto', so duplicate code
is reduced.
I've tested this on nvidia and sis auich(4)-compatible controllers.
In addition this change is reported to fix PR/39652.
 1.127.8.2  28-Apr-2009  skrll Sync with HEAD.
 1.127.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.127.6.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.128.4.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.128.2.3  13-Dec-2008  ad Fix locking for ac97.
 1.128.2.2  12-Dec-2008  ad Checkpoint work in progress.
 1.128.2.1  08-Dec-2008  ad Convert some more drivers.
 1.136.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.137.2.1  05-Mar-2011  rmind sync with head
 1.138.10.2  22-Nov-2011  jmcneill get rid of unused 'powerstate' callback in audio_hw_if
 1.138.10.1  19-Nov-2011  jmcneill port ad-audiomp2 branch changes to 5.99.56
todo:
- port ad-audiomp2 pcppi changes
- these drivers need to be fixed:
- emuxki
- gcscaudio
- hdafg
- uaudio
- umidi
- MD audio drivers
 1.138.8.3  22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.138.8.2  30-Oct-2012  yamt sync with head
 1.138.8.1  17-Apr-2012  yamt sync with head
 1.141.4.1  18-May-2014  rmind sync with head
 1.141.2.2  03-Dec-2017  jdolecek update from HEAD
 1.141.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.143.2.1  07-Apr-2014  tls Be a little more clear and consistent about harvesting entropy from devices:

1) deprecate RND_FLAG_NO_ESTIMATE

2) define RND_FLAG_COLLECT_TIME, RND_FLAG_COLLECT_VALUE

3) define RND_FLAG_ESTIMATE_TIME, RND_FLAG_ESTIMATE_VALUE

4) define RND_FLAG_DEFAULT: RND_FLAG_COLLECT_TIME|
RND_FLAG_COLLECT_VALUE|RND_FLAG_ESTIMATE_TIME

5) Make entropy harvesting from environmental sensors a little more generic
and remove it from individual sensor drivers.

6) Remove individual open-coded delta-estimators for values from a few
places in the tree (uvm, environmental drivers).

7) 0 -> RND_FLAG_DEFAULT, actually gather entropy from various drivers
that had stubbed out code, other minor cleanups.
 1.144.4.4  28-Aug-2017  skrll Sync with HEAD
 1.144.4.3  05-Feb-2017  skrll Sync with HEAD
 1.144.4.2  09-Jul-2016  skrll Sync with HEAD
 1.144.4.1  06-Jun-2015  skrll Sync with HEAD
 1.149.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.149.2.1  20-Mar-2017  pgoyette Sync with HEAD
 1.151.8.1  30-Mar-2018  pgoyette Resolve conflicts between branch and HEAD
 1.152.2.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.152.2.1  10-Jun-2019  christos Sync with HEAD
 1.154.2.3  04-May-2019  isaki Move dev/audio_if.h -> dev/audio/audio_if.h
 1.154.2.2  27-Apr-2019  isaki Adapt to audio2.
- Correct frequency_type in modem_audio_format.
- {spdif,modem}_audio_format in my previous commit (in this branch)
was also wrong. :(
 1.154.2.1  21-Apr-2019  isaki Use C99 style struct initializer to audio_format.
 1.157.2.1  21-Mar-2020  martin Pull up following revision(s) (requested by isaki in ticket #792):

sys/arch/amiga/dev/aucc.c: revision 1.48
sys/dev/pci/auixp.c: revision 1.49
sys/dev/pci/gcscaudio.c: revision 1.19
sys/dev/pci/auich.c: revision 1.159
sys/dev/sbus/dbri.c: revision 1.42
sys/dev/pci/auvia.c: revision 1.85
sys/dev/pci/auacer.c: revision 1.39

Drop 512 bytes limit on auvia_round_blocksize().

This fixes attach on 6 channels device.
PR kern/55017.

round_blocksize must return a multiple of the framesize.
aucc(4) supports 3 channels mode.

round_blocksize must return a multiple of the framesize
even if passed blocksize is greater than the upper limit.

round_blocksize must return a multiple of the framesize.

It's not divisible when blk=GCSCAUDI_PRD_SIZE_MAX and channels=4.
round_blocksize must return a multiple of the framesize
even if 6 channels mode.

I believe that keeping "good alignment" is just a wish, not constraint.
 1.158.2.1  29-Feb-2020  ad Sync with head.
 1.159.6.1  03-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed