summaryrefslogtreecommitdiff
path: root/sys/dev/tc/bba.c
AgeCommit message (Collapse)Author
2020-09-12Improve am7930 family drivers to share more code.isaki
audioamd(4) on sparc, vsaudio(4) on vax, and bba(4) are. - Remove complex and useless callbacks: onopen, onclose, and indirect_{read,write}. This makes audioamd and vsaudio almost the same. - Remove (already disabled) assembly fast interrupt path from audioamd(4). cf. http://mail-index.netbsd.org/source-changes/2009/12/19/msg004585.html - Use trigger_* method rather than start_* method. It's more suitable. vsaudio(4) was tested by naru@, bba(4) was tested by tsutsui@.
2020-08-29Fix white space and indent.isaki
2019-06-08Clean get_props().isaki
- 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.
2019-05-08Merge isaki-audio2 branch, the overhaul of audio subsystem.isaki
- 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
2019-03-16Use C99 style struct initializer to audio_hw_if.isaki
2018-09-03Rename min/max -> uimin/uimax for better honesty.riastradh
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a name change -- no functional change intended. HOWEVER! Some subsystems have #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) even though our standard name for that is MIN/MAX. Although these may invite multiple evaluation bugs, these do _not_ cause integer truncation. To avoid `fixing' these cases, I first changed the name in libkern, and then compile-tested every file where min/max occurred in order to confirm that it failed -- and thus confirm that nothing shadowed min/max -- before changing it. I have left a handful of bootloaders that are too annoying to compile-test, and some dead code: cobalt ews4800mips hp300 hppa ia64 luna68k vax acorn32/if_ie.c (not included in any kernels) macppc/if_gm.c (superseded by gem(4)) It should be easy to fix the fallout once identified -- this way of doing things fails safe, and the goal here, after all, is to _avoid_ silent integer truncations, not introduce them. Maybe one day we can reintroduce min/max as type-generic things that never silently truncate. But we should avoid doing that for a while, so that existing code has a chance to be detected by the compiler for conversion to uimin/uimax without changing the semantics until we can properly audit it all. (Who knows, maybe in some cases integer truncation is actually intended!)
2017-06-01remove checks for failure after memory allocation calls that cannot fail:chs
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.
2011-11-23Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. Fromjmcneill
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.
2011-06-04Split device_t/softc of am7930. No crash on TME and GXemul.tsutsui
2009-08-22u_intNN_t -> uintNN_ttsutsui
2009-05-12struct device * -> device_t, no functional changes intended.cegger
2009-05-12struct cfdata * -> cfdata_t, no functional changes intended.cegger
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-05use aprint_*_dev and device_xnamecegger
2007-10-19machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.had
2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos
2006-03-31Correct typo.he
2006-03-30Use device_private() more.thorpej
2006-03-30Liberally apply static.thorpej
2006-03-30Use device_private().thorpej
2005-12-02Fix AUDIO_DEBUG printf formatting of size_t; from Pavel Cahyna inkleink
PR kern/32207.
2005-06-01fix cast-qual falloutdrochner
2005-01-15ansify and KNFkent
2005-01-10merge kent-audio1 branch, which introduces audio filter pipeline to the MIkent
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
2004-10-29constify audio_hw_if, midi_hw_if, and radio_hw_if.yamt
2004-07-09Clean up open/close.mycroft
2003-05-03DMA, not dma nor Dma.wiz
2003-02-04deal with malloc_type fallout.matt
2002-10-02Add trailing ; to CFATTACH_DECL.thorpej
2002-10-01Use CFATTACH_DECL().thorpej
2002-09-27Declare all cfattach structures const.thorpej
2001-11-13add/cleanup RCSIDslukem
2001-10-03Add a new optional method, dev_ioctl, to the audio hardware driver interface.augustss
It is called when an unrecognized ioctl() is performed on a device, thus allowing ioctl()s that frob the hardware driver (like loading microcode).
2001-07-19Use BUS_DMA_READ and BUS_DMA_WRITE in some obvious places.thorpej
2000-07-18PAGE_SIZE -> IOASIC_DMA_BLOCKSIZE in one last place. From Izumi Tsutsui.thorpej
2000-07-18Back out previous. It is no longer needed, as both the Alphathorpej
and DECstation IOASIC drivers clear the appropriate interrupts in the dispatch routine.
2000-07-17Clear the DMA pointer reload interrupt bits in the IOASIC_INTRthorpej
register to prevent interrups from looping on the Alpha. From Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>.
2000-07-17- Write the registers 7930 registers properly on the Alpha (it'sthorpej
different than on the DECstation). - Use IOASIC_DMA_BLOCKSIZE instead of PAGE_SIZE. Should make this work on the Alpha. From discussion with Izumi Tsutsui, Gregory McGarry, and Chris Demetriou, and much reading of EK-D3SYS-PM.
2000-06-28remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>mrg
2000-06-26Change the kernel mmap interface so that the offset to map is ansimonb
"off_t" and the return value is a "paddr_t" to allow mappings at offsets past 2^31 bytes. Somewhat inspired by FreeBSD, which only changed the offset to a "vm_offset_t". Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
2000-06-12- add mmap supportgmcgarry
- correct bug which wouldn't free allocated DMA segments
2000-06-05- remove conditional compilation on NAUDIOgmcgarry
- use preprocessor for constants
2000-06-04Cleanup #if 0 cruft.gmcgarry
2000-06-01Remove wbflush(). These are not necessary with the new IOASIC bus_spacegmcgarry
framework. From Tohru Nishimura.
2000-05-28Merge pmax and alpha ISDN register definitions.gmcgarry
2000-05-02Add am7930 audio driver.augustss