summaryrefslogtreecommitdiffstats
path: root/sys/dev/speaker
Commit message (Collapse)AuthorAgeFilesLines
* Remove unneeded checks of device unit number from speaker(4).ed2009-01-251-18/+9
| | | | | Calls on the cdev can only be made on existing devices. This means we don't have to check the value of dev2unit().
* Replace all calls to minor() with dev2unit().ed2008-09-271-4/+4
| | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib
* Move speaker a lot closer to style(9)phk2008-05-151-343/+317
| | | | Submitted by: Martin Voros <martin_voros@yahoo.com>
* Make speaker a pseudo device driver instead of attaching to a PnP id.phk2008-03-261-90/+19
| | | | | If somebody cleaned this code up to proper style(9), it could become a great educational starting point for aspiring kernel hackers.
* The "free-lance" timer in the i8254 is only used for the speakerphk2008-03-261-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | these days, so de-generalize the acquire_timer/release_timer api to just deal with speakers. The new (optional) MD functions are: timer_spkr_acquire() timer_spkr_release() and timer_spkr_setfreq() the last of which configures the timer to generate a tone of a given frequency, in Hz instead of 1/1193182th of seconds. Drop entirely timer2 on pc98, it is not used anywhere at all. Move sysbeep() to kern/tty_cons.c and use the timer_spkr*() if they exist, and do nothing otherwise. Remove prototypes and empty acquire-/release-timer() and sysbeep() functions from the non-beeping archs. This eliminate the need for the speaker driver to know about i8254frequency at all. In theory this makes the speaker driver MI, contingent on the timer_spkr_*() functions existing but the driver does not know this yet and still attaches to the ISA bus. Syscons is more tricky, in one function, sc_tone(), it knows the hz and things are just fine. In the other function, sc_bell() it seems to get the period from the KDMKTONE ioctl in terms if 1/1193182th second, so we hardcode the 1193182 and leave it at that. It's probably not important. Change a few other sysbeep() uses which obviously knew that the argument was in terms of i8254 frequency, and leave alone those that look like people thought sysbeep() took frequency in hertz. This eliminates the knowledge of i8254_freq from all but the actual clock.c code and the prof_machdep.c on amd64 and i386, where I think it would be smart to ask for help from the timecounters anyway [TBD].
* Rename timer0_max_count to i8254_max_count.phk2008-03-261-1/+1
| | | | | Rename timer0_real_max_count to i8254_real_max_count and make it static. Rename timer_freq to i8254_freq and make it a loader tunable.
* Now that tone & delay times are correct (independent of hz), adjustbrian2007-06-041-2/+2
| | | | | | | | | playtone() so that it uses times of 1/100ths of a second. Now 'time echo T60ABC >/dev/speaker' takes ~3 seconds. MFC after: 2 weeks Problem noted by: dwmalone
* Speaker durations are specified in 1/100ths of a second according tobrian2007-06-041-15/+19
| | | | | | | | spkr(4). PR: 70610, 67995 Submitted by: dada at sbox dot tugraz dot at (modulo one fix) MFC after: 2 weeks
* Add /dev/speaker support to amd64.ru2005-11-112-4/+4
| | | | | | | | The following repo-copies were made (by Mark Murray): sys/i386/isa/spkr.c -> sys/dev/speaker/spkr.c sys/i386/include/speaker.h -> sys/dev/speaker/speaker.h share/man/man4/man4.i386/spkr.4 -> share/man/man4/spkr.4
* - Move timerreg.h to <arch>/include and split i8253 specific defines intonyan2005-05-141-35/+7
| | | | | | | | | i8253reg.h, and add some defines to control a speaker. - Move PPI related defines from i386/isa/spkr.c into ppireg.h and use them. - Move IO_{PPI,TIMER} defines into ppireg.h and timerreg.h respectively. - Use isa/isareg.h rather than <arch>/isa/isa.h. Tested on: i386, pc98
* Change a directory layout for pc98.nyan2005-05-101-1/+1
| | | | | | | | | - Move MD files into <arch>/<arch>. - Move bus dependent files into <arch>/<bus>. Rename some files to more suitable names. Repo-copied by: peter Discussed with: imp
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-5/+5
| | | | Bump __FreeBSD_version accordingly.
* Device megapatch 4/6:phk2004-02-211-0/+2
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Device megapatch 1/6:phk2004-02-211-2/+0
| | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
* Use __FBSDID().obrien2003-06-021-2/+3
|
* Retire sys/pc98/pc98/spkr.cmdodd2003-03-241-2/+4
|
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+6
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).des2003-03-021-4/+4
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* - Add inline functions for {ll,l,}abs() to libkern.mdodd2003-01-151-11/+0
| | | | - Remove hand rolled abs() functions.
* Merge PC98 changes.mdodd2002-11-021-30/+60
|
* Handle hints for the atspeaker device.mdodd2002-10-281-1/+25
| | | | Document same.
* Very minor whitespace/style nit.markm2002-10-231-2/+1
|
* Be consistent about funtions being static.phk2002-10-161-4/+4
| | | | Spotte by: FlexeLint.
* Remove __P.alfred2002-03-201-6/+6
|
* Add missing destroy_dev().wes2002-01-231-10/+13
| | | | | | Submitted by: Maxime Henrion <mux@sneakerz.org> Reviewed by: msmith@ MFC after: 3 weeks
* KSE Milestone 2julian2001-09-121-6/+6
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Add ACPI attachments.msmith2001-08-301-0/+1
|
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-1/+0
| | | | the bit-bucket.
* Staticize some malloc M_ instances.phk2000-12-081-1/+1
|
* Add PnP probe methods to some common AT hardware drivers. In each case,msmith2000-06-231-0/+44
| | | | | | | | | the PnP probe is merely a stub as we make assumptions about some of this hardware before we have probed it. Since these devices (with the exception of the speaker) are 'standard', suppress output in the !bootverbose case to clean up the probe messages somewhat.
* Don't use struct buf for random small temporary buffers.phk2000-05-051-5/+7
|
* Remove #if NFOO > 0 (it's not required in most cases) and also where itpeter2000-01-291-5/+0
| | | | | isn't used as a result, remove #include "foo.h". Many of these drivers still use NFOO for softc struct sizing etc however.
* Move isfoo() and friends to the newly created sys/ctype.h.phk1999-11-031-0/+1
| | | | Urged by: bde
* Consolidate some of the various ctype(3) macros in one location.archie1999-11-021-2/+0
|
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-5/+0
| | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags
* $Id$ -> $FreeBSD$peter1999-08-282-2/+2
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-13/+2
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* Use devtoname() to print dev_t's instead of casting them to long or u_longbde1999-08-231-3/+3
| | | | for misprinting in %lx format.
* Welcome devtoname(), to most likely be used when printing informationbillf1999-08-171-5/+5
| | | | | | | | | | about a dev_t. printf("%x", dev) now becomes printf("%s", devtoname(dev)) because printing actual information about the device is much more useful then printing a pointer to an address that would never help the developer debug. Submitted by: phk, bde
* Simplify cdevsw registration.phk1999-05-311-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* This commit should be a extensive NO-OP:phk1999-05-301-5/+22
| | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
* Fixed printf format errors. Only one left in LINT on i386's.bde1998-08-241-3/+4
|
* This commit fixes various 64bit portability problems required fordfr1998-06-071-2/+2
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Don't depend on "implicit int" or bloat the data section in thebde1998-02-201-2/+2
| | | | declaration of xxx_devsw_installed.
* Staticize.eivind1998-02-091-2/+2
|
* Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.eivind1998-01-241-1/+3
| | | | | | | | This introduce an xxxFS_BOOT for each of the rootable filesystems. (Presently not required, but encouraged to allow a smooth move of option *FS to opt_dontuse.h later.) LFS is temporarily disabled, and will be re-enabled tomorrow.
* In all such uses of struct buf: 's/b_un.b_addr/b_data/g'phk1997-12-021-2/+2
|
OpenPOWER on IntegriCloud