Commit Graph

86 Commits

Author SHA1 Message Date
Cameron Grant
3f22597838 update my email address. 2003-09-07 16:28:03 +00:00
Scott Long
f6b1c44d1f Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma.  At the moment, this is used for the
asynchronous busdma_swi and callback mechanism.  Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg.  dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create().  The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms.  The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by:	tmm, gibbs
2003-07-01 15:52:06 +00:00
Yoshihiro Takahashi
3febcc57ec - Clean up ISA DMA supports.
- Rename all sndbuf_isadma* functions to sndbuf_dma* and move them into
  sys/dev/sound/isa/sndbuf_dma.c.

No response from:	sound
2003-02-07 14:05:34 +00:00
Matthew N. Dodd
6dc61b5ae5 - GC a few more hand-rolled 'abs' macros.
- GC a few hand-rolled min()/max() macros while I'm here.
2003-01-15 02:15:57 +00:00
Matthew N. Dodd
dd815daba5 - Add acpi module binding.
- Restore speed and format settings on resume for CS423x and
  CS423x-PCI devices.
2003-01-08 06:24:25 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Semen Ustimenko
83190e29d3 Do not return(foo()) in void function.
Submitted by:	marius@alchemy.franken.de
MFC after:	3 days
2002-12-18 22:53:24 +00:00
Cameron Grant
00acb1337e (hopefully) fix build breakage some people are seeing
Approved by:	re
2002-11-26 18:16:27 +00:00
John Baldwin
489c22ebb8 Add lock type arguments to callers of snd_mtxcreate(). 2002-04-04 20:56:47 +00:00
Thomas Gellekum
cc9f4eb939 Add support for the Aztech 2320 chip.
Reviewed by:	cg
Obtained from:	NetBSD (partly)
2002-02-05 12:09:23 +00:00
Pierre Beyssac
5a8c4e90b9 Fixes apparent hang at probe time due to an extremely long timeout
(experienced with an Opti931/ISA PnP card).

Approved by:	cg
2001-12-21 23:26:55 +00:00
Cameron Grant
11149a9ac8 release isa dma channels on unload. 2001-09-29 08:01:42 +00:00
Cameron Grant
374e1c5baa allow the hardware buffer size to be controlled with hints
release isa dma channels on unload (ad1816, ess, sb8)
2001-09-29 07:57:07 +00:00
Cameron Grant
a6295c60ae when setting blocksize, fix blockcount to 2 to reduce latency with smaller
block sizes.
2001-09-18 15:19:44 +00:00
Cameron Grant
c2995ba2d4 make buffer size adjustable. 2001-09-18 15:12:35 +00:00
Cameron Grant
67b1dce3bc many changes:
* add new channels to the end of the list so channels used in order of
addition

* de-globalise definition of struct snddev_info and provide accessor
functions where necessary.

* move the $FreeBSD$ tag in each .c file into a macro and allow the
/dev/sndstat handler to display these when set to maximum verbosity to aid
debugging.

* allow each device to register its own sndstat handler to reduce the amount
of groping sndstat must do in foreign structs.
2001-08-23 11:30:52 +00:00
George C A Reid
733a4ea771 Use the M_ZERO flag to malloc(9)
Reviewed by:	cg
MFC after:	1 week
2001-06-21 19:45:59 +00:00
Cameron Grant
d95502a838 use a global devclass for all drivers - i'm not entirely sure why this
worked before.

mixer, dsp and sndstat are seperate devices - give them their own cdevsws
instead of demuxing requests sent to a single cdevsw.

use the si_drv1/si_drv2 fields in dev_t structures for holding information
specific to an open instance of mixer/dsp.

nuke /dev/{dsp,dspW,audio}[0-9]* links - this functionality is now provided
using cloning.

various locking fixes.
2001-06-16 21:25:10 +00:00
George C A Reid
94d79d6dea Remove a bogus comment which I forgot to get rid of after testing 2001-05-15 20:05:19 +00:00
Cameron Grant
35910bd13e release resources if one of the speculative probes in opti_detect() fails,
otherwise resource_list_alloc panics when opti_detect tries its next probe.
2001-03-25 19:09:06 +00:00
Cameron Grant
4e5f69d4dd the softc is not a mutex, don't try to lock it.
Submitted by:		George Reid <greid@ukug.uk.freebsd.org>
2001-03-25 18:56:48 +00:00
Cameron Grant
66ef8af5b0 mega-commit.
this introduces a new buffering mechanism which results in dramatic
simplification of the channel manager.

as several structures have changed, we take the opportunity to move their
definitions into the source files where they are used, make them private and
de-typedef them.

the sound drivers are updated to use snd_setup_intr instead of
bus_setup_intr, and to comply with the de-typedefed structures.

the ac97, mixer and channel layers have been updated with finegrained
locking, as have some drivers- not all though.  the rest will follow soon.
2001-03-24 23:10:29 +00:00
Cameron Grant
64738af72b add support for opti924 and opti930 chips
both should work in non-pnp mode, the 924 should also work in its rather
braindead pnp mode- it will adopt port 0x530 unless given hints due to it
starting up in soundblaster mode and thus not requesting a valid mss port
address.

Submitted by:	George Reid <greid@ukug.uk.freebsd.org>
2001-03-24 00:22:01 +00:00
Cameron Grant
86c1b69bbb increase timeouts for ad_wait_init() 2001-03-05 17:59:36 +00:00
Cameron Grant
350a5fafb1 update code dealing with snd_dbuf objects to do so using a functional interface
modify chn_setblocksize() to pick a default soft-blocksize appropriate to the
sample rate and format in use.  it will aim for a power of two size small
enough to generate block sizes of at most 20ms.  it will also set the
hard-blocksize taking into account rate/format conversions in use.

update drivers to implement setblocksize  correctly:
updated, tested: 	sb16, emu10k1, maestro, solo
updated, untested: 	ad1816, ess, mss, sb8, csa
not updated: 		ds1, es137x, fm801, neomagic, t4dwave, via82c686

i lack hardware to test: ad1816, csa, fm801, neomagic
others will be updated/tested in the next few days.
2000-12-23 03:16:13 +00:00
Cameron Grant
0f55ac6c1a kobjify.
this gives us several benefits, including:

* easier extensibility- new optional methods can be added to
  ac97/mixer/channel classes without having to fixup every driver.

* forward compatibility for drivers, provided no new mandatory methods are
  added.
2000-12-18 01:36:41 +00:00
Cameron Grant
9ec437a334 add reinit functions to mixers
unstaticize chn_start()
add reset/resetdone functions to channels
2000-10-26 20:46:58 +00:00
Maxim Sobolev
6e3c38712b Reduce buffer size from 64K to 4K.
Approved by:	cg
2000-10-09 14:54:32 +00:00
Cameron Grant
306f91b60b detach support
remove un-needed setdir functions
add bus_teardown_intr calls where necessary
destroy our dma tags where necessary
destroy ac97 before releasing resources
2000-09-09 19:21:04 +00:00
Cameron Grant
33dbf14a17 change mixer api slightly
change channel interface - kobj implementation coming soonish
make pcm_makelinks not panic if modular
add pcm_unregister()

these changes support newpcm kld unloading, but this is only implemented
by ds1.c
2000-09-01 20:09:24 +00:00
Cameron Grant
513693be6c rework feeder sytem to allow feeders in klds
modify driver capability reporting format to list every audio format
seperately- required for above and because we could not previously indicate
that mono was unsupported.

there should be no functional impact.
2000-08-20 22:18:56 +00:00
Cameron Grant
5151584d21 add suspend/resume for yamaha chips
Submitted by:	Ira L Cooper <ira@MIT.EDU>
2000-07-30 21:15:35 +00:00
Seigo Tanimura
fb0ef52838 Finally merge newmidi.
(I had been busy for my own research activity until the last weekend)

Supported devices:

SB Midi Port			(sbc + midi)
SB OPL3				(sbc + midi)
16550 UART			(midi, needs a trick in your hint)
CS461x Midi Port		(csa + midi)

OSS-compatible sequencer	(seq)

Supported playing software:

playmidi			(We definitely need more)

Notes:

/dev/midistat now reports installed midi drivers. /dev/sndstat reports
only pcm drivers. We need the new name(pcmstat?).

EMU8000(SB AWE) does not sound yet but does get probed so that the OPL3
synth on an AWE card works.

TODO:

MSS/PCI bridge drivers
Midi-tty interface to support general serial devices
Modules
2000-07-11 11:49:33 +00:00
Cameron Grant
f314f3dad2 add module metadata. this is a hack, sound drivers will eventually present a
bus to which pcm, mixer, etc will attach.
2000-07-03 20:52:27 +00:00
Peter Wemm
a99bef94ed Untangle some #include between gusc.c/mss.c - gusc.c could create
an attachment node for something that may not have been compiled in.
2000-06-10 07:20:54 +00:00
Cameron Grant
35f9e4a1db handle emulated dma reads
don't try to get sample size from snd_dbuf
2000-05-26 21:15:47 +00:00
Yoshihiro Takahashi
7c14268dbd Supported the mss on PC-98 and Sound Blaster 98.
Submitted by:	"T.Yamaoka" <taka@windows.squares.net>
2000-05-19 15:41:52 +00:00
Cameron Grant
f23598ec2c maybe make cmi8330 work - no feedback yet
implement bass/treble for yamaha opl-sax chips
2000-04-23 17:57:35 +00:00
Cameron Grant
1a7d73a130 Partial fix: the following patch correctly configures the card for dual
channel DMA. The problem was that the SDC bit (0x04) can only be set in
the MCE state.

PR:		kern/16587
Submitted by:	Matthew Reimer <mreimer@vpop.net>
Approved by:	jkh (in person)
2000-03-05 15:51:09 +00:00
Cameron Grant
a05382d9ae differentiate cmi8330 and als100 pnp cards based on their vendor id. this
is a kludge for 4.0
2000-01-29 00:18:29 +00:00
Peter Wemm
a3a2b1e1b2 Note the PnP id's for the NMX2210 next to the id's where they are used.
The pnpbios doesn't supply a description in the case we've seen so
supply one.
2000-01-23 13:17:03 +00:00
Cameron Grant
724efc44ec attach to non-ac97 neomagic chips and hope that ac97 ones do not have the
same pnpbios id
2000-01-13 06:11:32 +00:00
Cameron Grant
2abc85f0c0 argh, forgot the bus_dma_tag_creates.
also, panic if channel init fails instead of derefing null.
2000-01-05 04:01:34 +00:00
Cameron Grant
9d1671b8c2 allocate isa bounce buffers of the right size for ess/mss cards, fixes
panics reported
2000-01-05 00:39:20 +00:00
Cameron Grant
43607766d6 revert buffer size to 64k 2000-01-01 21:50:20 +00:00
Peter Wemm
32ef0d3eb6 Attach the CS4610 PCI / CS4239 setup in isa compatability mode as CSC0100.
The PCI component is non-AC97 apparently.

PR:		15632
Submitted by:	gibbs
1999-12-30 20:04:11 +00:00
Cameron Grant
a0b57fb738 - latest 2ndbuffer patch
- make chn_setdir work for rec on isa cards
- note: es1371 does not irq in smp

Submitted by:	tanimura
1999-12-29 03:46:54 +00:00
Peter Wemm
2996751a32 Collapse a bunch of unused MD_CS42nn tags into a single one. This saves
going to a lot of trouble to identify it and set the tag and then not use
it.  Convert the pnp id matching to the preferred table based system.
@@@0001 (CMI8330 ldn 0) is a mss, not a SB.
1999-12-21 14:09:19 +00:00
Cameron Grant
9035ec00a0 minor cleanup
Parts Submitted by:	Ville-Pertti Keinonen <will@ztango.com>
1999-12-21 08:43:28 +00:00
Peter Wemm
c2af6f650c Update for pnp adjustments regarding NPNP.
Also, optimize out a mess of #if's that were duplicating work already
done by config(8).  For example, if a file is marked as
"dev/sound/pci/foo.c optional pcm pci" then it's only added if pcm *and*
pci are present, so #if NPCM > 0 and #if NPCI > 0 are totally redundant.
A bit more work is still needed.

Discussed with: cg (a few weeks ago)
1999-12-06 18:26:33 +00:00