The NetBSD Project

CVS log for src/sys/dev/spkr.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.24 / (download) - annotate - [select for diffs], Sat Sep 24 23:16:37 2022 UTC (4 months, 1 week ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.23: +5 -5 lines
Diff to previous 1.23 (colored)

malloc(9) -> kmem(9)

Revision 1.23 / (download) - annotate - [select for diffs], Thu Mar 31 19:30:15 2022 UTC (10 months ago) by pgoyette
Branch: MAIN
Changes since 1.22: +4 -6 lines
Diff to previous 1.22 (colored)

For device modules that provide both auto-config and /dev/xxx
interfaces, make sure that initialization and destruction
follow the proper sequence.  This is triggered by the recent
changes to the devsw stuff; per riastradh@ the required call
sequence is:

	devsw_attach()
	config_init_component() or config_cf*_attach()
	...
	config_fini_component() or config_cf*_detach()
	devsw_detach()

While here, add a few missing calls to some of the detach
routines.

Testing of these changes has been limited to:
	1. compile without build break
	2. no related test failures from atf
	3. modload/modunload work as well as
	   before.

No functional device testing done, since I don't have any
of these devices.  Let me know of any damage I might cause
here!

XXX Some of the modules affected by this commit are already
XXX broken;  see kern/56772.  This commit does not break
any additional modules (as far as I know).

Revision 1.22 / (download) - annotate - [select for diffs], Sat Feb 12 03:24:36 2022 UTC (11 months, 2 weeks ago) by riastradh
Branch: MAIN
Changes since 1.21: +6 -4 lines
Diff to previous 1.21 (colored)

sys: Fix various abuse of struct device internals.

Will help to make struct device opaque later.

Revision 1.21 / (download) - annotate - [select for diffs], Sat Aug 7 16:19:08 2021 UTC (17 months, 3 weeks ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

Merge thorpej-cfargs2.

Revision 1.20.8.1 / (download) - annotate - [select for diffs], Wed Aug 4 23:24:57 2021 UTC (17 months, 4 weeks ago) by thorpej
Branch: thorpej-cfargs2
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored) next main 1.21 (colored)

Adapt to CFARGS().

Revision 1.20 / (download) - annotate - [select for diffs], Sat Apr 24 23:36:52 2021 UTC (21 months, 1 week ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-cfargs2
Changes since 1.19: +5 -4 lines
Diff to previous 1.19 (colored)

Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
  actually needed.
- Don't be explicit about what interface attribute is attaching if
  the device only has one.  (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
  situations, making is visibly easier to see when indirect config is
  in play, and allowing for future change in semantics.  (As of now,
  this is just a wrapper around config_match(), but that is an
  implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance.  This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).

Revision 1.17.12.1 / (download) - annotate - [select for diffs], Sat Apr 3 22:28:43 2021 UTC (22 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.17: +108 -53 lines
Diff to previous 1.17 (colored) next main 1.18 (colored)

Sync with HEAD.

Revision 1.17.14.3 / (download) - annotate - [select for diffs], Sat Apr 3 21:44:50 2021 UTC (22 months ago) by thorpej
Branch: thorpej-cfargs
Changes since 1.17.14.2: +108 -53 lines
Diff to previous 1.17.14.2 (colored) to branchpoint 1.17 (colored) next main 1.18 (colored)

Sync with HEAD.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Apr 3 04:10:30 2021 UTC (22 months ago) by isaki
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-cfargs-base
Changes since 1.18: +88 -36 lines
Diff to previous 1.18 (colored)

Rework about the rest note in speaker(4).
- Obsolete the sc_rest callback.  The rest note operation can be done by
  the common spkr layer.  This also fixes PR kern/56060.
  This work-in-progress patch was left in my local tree for years. :(
- Improve calculations of tone and rest length.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Apr 3 03:21:53 2021 UTC (22 months ago) by isaki
Branch: MAIN
Changes since 1.17: +22 -19 lines
Diff to previous 1.17 (colored)

Improve SPKRDEBUG code.
- Replace wrong aprint_debug_dev() with device_printf().
  By this, it no longer need to print dev_t.
- Improve some messages.

Revision 1.17.14.2 / (download) - annotate - [select for diffs], Sun Mar 28 19:50:05 2021 UTC (22 months ago) by thorpej
Branch: thorpej-cfargs
Changes since 1.17.14.1: +3 -3 lines
Diff to previous 1.17.14.1 (colored) to branchpoint 1.17 (colored)

"" is not a valid interface attribute, so don't pass it to spkr_rescan()
(luckily it wasn't used anyway).

Revision 1.17.14.1 / (download) - annotate - [select for diffs], Sun Mar 21 21:09:09 2021 UTC (22 months, 1 week ago) by thorpej
Branch: thorpej-cfargs
Changes since 1.17: +4 -3 lines
Diff to previous 1.17 (colored)

Give config_found() the same variadic arguments treatment as
config_search().  This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls.  Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.

Revision 1.15.6.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:07:04 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.15: +7 -7 lines
Diff to previous 1.15 (colored) next main 1.16 (colored)

Sync with HEAD

Revision 1.17 / (download) - annotate - [select for diffs], Thu Apr 18 13:01:38 2019 UTC (3 years, 9 months ago) by isaki
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Branch point for: thorpej-futex, thorpej-cfargs
Changes since 1.16: +6 -6 lines
Diff to previous 1.16 (colored)

White space and indent fix.

Revision 1.15.4.1 / (download) - annotate - [select for diffs], Thu Sep 6 06:55:48 2018 UTC (4 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored) next main 1.16 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.16 / (download) - annotate - [select for diffs], Mon Sep 3 16:29:30 2018 UTC (4 years, 5 months ago) by riastradh
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

Rename min/max -> uimin/uimax for better honesty.

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!)

Revision 1.15.2.2 / (download) - annotate - [select for diffs], Sun Dec 3 11:36:58 2017 UTC (5 years, 2 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.15.2.1: +593 -0 lines
Diff to previous 1.15.2.1 (colored) to branchpoint 1.15 (colored) next main 1.16 (colored)

update from HEAD

Revision 1.15.2.1, Sat Oct 28 03:47:24 2017 UTC (5 years, 3 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.15: +0 -593 lines
FILE REMOVED

file spkr.c was added on branch tls-maxphys on 2017-12-03 11:36:58 +0000

Revision 1.15 / (download) - annotate - [select for diffs], Sat Oct 28 03:47:24 2017 UTC (5 years, 3 months ago) by riastradh
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, phil-wifi-base, pgoyette-compat-base, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, jdolecek-ncqfixes-base, jdolecek-ncqfixes
Branch point for: tls-maxphys, phil-wifi, pgoyette-compat
Changes since 1.14: +4 -4 lines
Diff to previous 1.14 (colored)

Kill some more extern cfdriver xyz_cd in favour of #include "ioconf.h".

Revision 1.6.6.3 / (download) - annotate - [select for diffs], Mon Aug 28 17:52:00 2017 UTC (5 years, 5 months ago) by skrll
Branch: nick-nhusb
Changes since 1.6.6.2: +60 -7 lines
Diff to previous 1.6.6.2 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored)

Sync with HEAD

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jul 1 23:27:17 2017 UTC (5 years, 7 months ago) by nat
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825
Changes since 1.13: +6 -2 lines
Diff to previous 1.13 (colored)

On a forcefull detach wait for spkr to close as the detach has to
succeed.

Ok christos@.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Jun 14 06:55:37 2017 UTC (5 years, 7 months ago) by nat
Branch: MAIN
Changes since 1.12: +6 -3 lines
Diff to previous 1.12 (colored)

Ensure to detach children.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jun 11 21:54:22 2017 UTC (5 years, 7 months ago) by pgoyette
Branch: MAIN
Changes since 1.11: +31 -8 lines
Diff to previous 1.11 (colored)

Implement xxx_rescan() and xxx_childdet() functions; these will be
needed when child device wsbell(4) becomes a separately-loadable
module.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jun 11 09:41:40 2017 UTC (5 years, 7 months ago) by pgoyette
Branch: MAIN
Changes since 1.10: +8 -6 lines
Diff to previous 1.10 (colored)

Clean up the spkr_modcmd() routine so it returns ENOTTY for all commands
other than MODULE_CMD_{INIT,FINI}

Revision 1.10 / (download) - annotate - [select for diffs], Sun Jun 11 05:26:52 2017 UTC (5 years, 7 months ago) by pgoyette
Branch: MAIN
Changes since 1.9: +4 -2 lines
Diff to previous 1.9 (colored)

The wsmux.h file is only created for kernel builds.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jun 11 03:55:56 2017 UTC (5 years, 7 months ago) by nat
Branch: MAIN
Changes since 1.8: +12 -0 lines
Diff to previous 1.8 (colored)

New device wsbell - allows for a console beep for non pckbds (usb etc).
Works for platforms without pcppi - can work with spkr at audio and spkr
at pcppi.

To use add the following to your kernel config:
wsbell* at spkr? console?

Ok pgoyette@.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jun 11 03:33:48 2017 UTC (5 years, 7 months ago) by nat
Branch: MAIN
Changes since 1.7: +10 -2 lines
Diff to previous 1.7 (colored)

Add ioctls for setting and getting the beep volume.  Currently only
supported on spkr devices attached to audio.

Ok pgoyette@.

Revision 1.7 / (download) - annotate - [select for diffs], Thu Jun 1 09:44:30 2017 UTC (5 years, 8 months ago) by pgoyette
Branch: MAIN
CVS Tags: netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored)

Add infrastructure for modularization of audio, midi, and sequencer

Revision 1.6.10.2 / (download) - annotate - [select for diffs], Sat Apr 29 11:12:14 2017 UTC (5 years, 9 months ago) by pgoyette
Branch: prg-localcount2
Changes since 1.6.10.1: +2 -3 lines
Diff to previous 1.6.10.1 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored)

Remove more unnecessary #include for sys/localcount.h

Revision 1.6.10.1 / (download) - annotate - [select for diffs], Sat Apr 29 09:17:58 2017 UTC (5 years, 9 months ago) by pgoyette
Branch: prg-localcount2
Changes since 1.6: +4 -2 lines
Diff to previous 1.6 (colored)

Add DEVSW_MODULE_INIT to existing device-driver modules, so that they
willl have a localcount defined and thus be permitted to load.  Without
a localcount, loading the module will return EINVAL.

XXX the dtrace and drm stuff might need to be fed back upstream?

Revision 1.6.6.2 / (download) - annotate - [select for diffs], Sun Feb 5 13:40:26 2017 UTC (5 years, 11 months ago) by skrll
Branch: nick-nhusb
Changes since 1.6.6.1: +539 -0 lines
Diff to previous 1.6.6.1 (colored) to branchpoint 1.6 (colored)

Sync with HEAD

Revision 1.6.2.2 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:31 2017 UTC (6 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.6.2.1: +539 -0 lines
Diff to previous 1.6.2.1 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.6.6.1, Fri Jan 6 09:32:08 2017 UTC (6 years ago) by skrll
Branch: nick-nhusb
Changes since 1.6: +0 -539 lines
FILE REMOVED

file spkr.c was added on branch nick-nhusb on 2017-02-05 13:40:26 +0000

Revision 1.6.2.1, Fri Jan 6 09:32:08 2017 UTC (6 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.6: +0 -539 lines
FILE REMOVED

file spkr.c was added on branch pgoyette-localcount on 2017-01-07 08:56:31 +0000

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jan 6 09:32:08 2017 UTC (6 years ago) by pgoyette
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, nick-nhusb-base-20170204, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: prg-localcount2, pgoyette-localcount, nick-nhusb
Changes since 1.5: +32 -12 lines
Diff to previous 1.5 (colored)

Implement a common spkr_detach() function and call it from the
attachment-specific detach functions.  Returns EBUSY if the
device instance is busy, based on whether or not a sc->sc_inbuf
is allocated.  The buffer is malloc()d at spkropen time, and is
free()d in spkrclose().

Now we can actually implement the MODULE_CMD_FINI command and
unload the driver at will.

Addresses my PR kern/51785

Revision 1.5 / (download) - annotate - [select for diffs], Thu Dec 15 06:55:55 2016 UTC (6 years, 1 month ago) by pgoyette
Branch: MAIN
Changes since 1.4: +5 -3 lines
Diff to previous 1.4 (colored)

Add the module glue to the common spkr code.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Dec 13 20:20:34 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.3: +271 -278 lines
Diff to previous 1.3 (colored)

Restructure speaker devices so that there can be multiple of them, and have
proper softc's.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Dec 9 05:17:03 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.2: +10 -5 lines
Diff to previous 1.2 (colored)

fix module build
XXX: spkr module is the pcppi version.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Dec 9 04:46:39 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.1: +3 -2 lines
Diff to previous 1.1 (colored)

move spkrio.h out of isa

Revision 1.1 / (download) - annotate - [select for diffs], Fri Dec 9 04:32:39 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN

more spkr rework.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>