summaryrefslogtreecommitdiff
path: root/sys/dev/speaker
Commit message (Collapse)AuthorAgeFilesLines
* Do not define bool/true/false if the symbols already exist.Matthew D Fleming2011-12-121-0/+2
| | | | | | | | MFC after: 2 weeks Sponsored by: Isilon Systems, LLC Notes: svn path=/head/; revision=228443
* Change the type of uio_resid member of struct uio from int to ssize_t.Konstantin Belousov2009-06-251-1/+1
| | | | | | | | | | | Note that this does not actually enable full-range i/o requests for 64 architectures, and is done now to update KBI only. Tested by: pho Reviewed by: jhb, bde (as part of the review of the bigger patch) Notes: svn path=/head/; revision=194990
* Remove unneeded checks of device unit number from speaker(4).Ed Schouten2009-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(). Notes: svn path=/head/; revision=187683
* Replace all calls to minor() with dev2unit().Ed Schouten2008-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 Notes: svn path=/head/; revision=183397
* Move speaker a lot closer to style(9)Poul-Henning Kamp2008-05-151-343/+317
| | | | | | | Submitted by: Martin Voros <martin_voros@yahoo.com> Notes: svn path=/head/; revision=179004
* Make speaker a pseudo device driver instead of attaching to a PnP id.Poul-Henning Kamp2008-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. Notes: svn path=/head/; revision=177648
* The "free-lance" timer in the i8254 is only used for the speakerPoul-Henning Kamp2008-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]. Notes: svn path=/head/; revision=177642
* Rename timer0_max_count to i8254_max_count.Poul-Henning Kamp2008-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. Notes: svn path=/head/; revision=177631
* Now that tone & delay times are correct (independent of hz), adjustBrian Somers2007-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 Notes: svn path=/head/; revision=170280
* Speaker durations are specified in 1/100ths of a second according toBrian Somers2007-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 Notes: svn path=/head/; revision=170278
* Add /dev/speaker support to amd64.Ruslan Ermilov2005-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 Notes: svn path=/head/; revision=152306
* - Move timerreg.h to <arch>/include and split i8253 specific defines intoYoshihiro Takahashi2005-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 Notes: svn path=/head/; revision=146211
* Change a directory layout for pc98.Yoshihiro Takahashi2005-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 Notes: svn path=/head/; revision=146049
* /* -> /*- for copyright notices, minor format tweaks as necessaryWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139790
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-5/+5
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Device megapatch 4/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126080
* Device megapatch 1/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126076
* Use __FBSDID().David E. O'Brien2003-06-021-2/+3
| | | | Notes: svn path=/head/; revision=115703
* Retire sys/pc98/pc98/spkr.cMatthew N. Dodd2003-03-241-2/+4
| | | | Notes: svn path=/head/; revision=112561
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-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) Notes: svn path=/head/; revision=111815
* More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).Dag-Erling Smørgrav2003-03-021-4/+4
| | | | Notes: svn path=/head/; revision=111748
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-1/+1
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-1/+1
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* - Add inline functions for {ll,l,}abs() to libkern.Matthew N. Dodd2003-01-151-11/+0
| | | | | | | - Remove hand rolled abs() functions. Notes: svn path=/head/; revision=109268
* Merge PC98 changes.Matthew N. Dodd2002-11-021-30/+60
| | | | Notes: svn path=/head/; revision=106323
* Handle hints for the atspeaker device.Matthew N. Dodd2002-10-281-1/+25
| | | | | | | Document same. Notes: svn path=/head/; revision=106070
* Very minor whitespace/style nit.Mark Murray2002-10-231-2/+1
| | | | Notes: svn path=/head/; revision=105777
* Be consistent about funtions being static.Poul-Henning Kamp2002-10-161-4/+4
| | | | | | | Spotte by: FlexeLint. Notes: svn path=/head/; revision=105224
* Remove __P.Alfred Perlstein2002-03-201-6/+6
| | | | Notes: svn path=/head/; revision=92765
* Add missing destroy_dev().Wes Peters2002-01-231-10/+13
| | | | | | | | | Submitted by: Maxime Henrion <mux@sneakerz.org> Reviewed by: msmith@ MFC after: 3 weeks Notes: svn path=/head/; revision=89679
* KSE Milestone 2Julian Elischer2001-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 Notes: svn path=/head/; revision=83366
* Add ACPI attachments.Mike Smith2001-08-301-0/+1
| | | | Notes: svn path=/head/; revision=82555
* Send the remains (such as I have located) of "block major numbers" toPoul-Henning Kamp2001-03-261-1/+0
| | | | | | | the bit-bucket. Notes: svn path=/head/; revision=74810
* Staticize some malloc M_ instances.Poul-Henning Kamp2000-12-081-1/+1
| | | | Notes: svn path=/head/; revision=69774
* Add PnP probe methods to some common AT hardware drivers. In each case,Mike Smith2000-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. Notes: svn path=/head/; revision=61994
* Don't use struct buf for random small temporary buffers.Poul-Henning Kamp2000-05-051-5/+7
| | | | Notes: svn path=/head/; revision=60038
* Remove #if NFOO > 0 (it's not required in most cases) and also where itPeter Wemm2000-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. Notes: svn path=/head/; revision=56843
* Move isfoo() and friends to the newly created sys/ctype.h.Poul-Henning Kamp1999-11-031-0/+1
| | | | | | | Urged by: bde Notes: svn path=/head/; revision=52843
* Consolidate some of the various ctype(3) macros in one location.Archie Cobbs1999-11-021-2/+0
| | | | Notes: svn path=/head/; revision=52815
* Remove five now unused fields from struct cdevsw. They should neverPoul-Henning Kamp1999-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 Notes: svn path=/head/; revision=51658
* $Id$ -> $FreeBSD$Peter Wemm1999-08-282-2/+2
| | | | Notes: svn path=/head/; revision=50477
* Convert DEVFS hooks in (most) drivers to make_dev().Poul-Henning Kamp1999-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(). Notes: svn path=/head/; revision=50254
* Use devtoname() to print dev_t's instead of casting them to long or u_longBruce Evans1999-08-231-3/+3
| | | | | | | for misprinting in %lx format. Notes: svn path=/head/; revision=50253
* Welcome devtoname(), to most likely be used when printing informationBill Fumerola1999-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 Notes: svn path=/head/; revision=49982
* Simplify cdevsw registration.Poul-Henning Kamp1999-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. Notes: svn path=/head/; revision=47640
* This commit should be a extensive NO-OP:Poul-Henning Kamp1999-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. Notes: svn path=/head/; revision=47625
* Fixed printf format errors. Only one left in LINT on i386's.Bruce Evans1998-08-241-3/+4
| | | | Notes: svn path=/head/; revision=38505
* This commit fixes various 64bit portability problems required forDoug Rabson1998-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. Notes: svn path=/head/; revision=36735
* Don't depend on "implicit int" or bloat the data section in theBruce Evans1998-02-201-2/+2
| | | | | | | declaration of xxx_devsw_installed. Notes: svn path=/head/; revision=33679
* Staticize.Eivind Eklund1998-02-091-2/+2
| | | | Notes: svn path=/head/; revision=33181