Commit Graph

95 Commits

Author SHA1 Message Date
chs cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
dsl e21a34c25e Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
  the item itself.
In the places where the caller specifies a function and a structure
  address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
  sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
  AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
  fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
2012-06-02 21:36:41 +00:00
mbalmer b246c3a822 Add the Avance Logic ALC203 code, found on e.g. alix3d3 boards. 2011-11-27 15:08:04 +00:00
jmcneill 8a962f23f2 Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
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-11-23 23:07:28 +00:00
kiyohara e2c231dbe4 Support UCB1400.
It tested on GUMSTIX with audiostix.  However GUMSTIX needs more ad-hoc patch.
2009-07-13 12:54:11 +00:00
cegger 529e91fca1 struct device * -> device_t, no functional changes intended. 2009-05-12 14:16:35 +00:00
christos 9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
gmcgarry 7085b9f922 Array range designated initializers are a gcc extension. Replace with
explicit initialization with zeros, although it probably isn't necessary.
2008-06-24 10:57:45 +00:00
cegger 7088512994 use aprint_*_dev and device_xname 2008-04-08 12:07:25 +00:00
thorpej 712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
alc 0369238ed8 Update documentation URL. Previous one was leading to a "Page not found". 2007-02-16 21:05:40 +00:00
christos 5ec7f32544 add missing initializers 2006-09-02 17:02:57 +00:00
kent dab6bf2001 implement auto-detection of volume resolutions 2006-08-23 11:24:07 +00:00
kent 117c4cc6d5 add capability to support for S/PDIF.
If a codec supports for AC'97 S/PDIF, it will have an mixer "spdif.enable."
However, we can't change the value of the mixer without AC'97 host
driver's support.
2006-07-26 14:44:33 +00:00
uebayasi 4a02e59152 Update URLs to ASAHI KASEI CODECs. 2006-05-10 09:07:57 +00:00
jmcneill f08bb8f847 * Add a flag AC97_HOST_INVERTED_EAMP. (kern/18880, kern/24488).
* Make reset callback optional; not all devices need it. (port-i386/14260, kern/12603, kern/12723, kern/24957).
2006-04-15 21:18:34 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
rpaulo e15c104622 Add "Conexant CXT48". This should have a more meaningful name, but I
couldn't find it. So, I added this because it's better than printing
"unknown codec". When we find a more decent name later, we can change this.
2005-11-06 10:08:24 +00:00
simonb e13e6f0180 Add SigmaTel STAC9752/53 codec ID. 2005-09-27 05:24:40 +00:00
atatat df13e3579e Change the rest of the sysctl subsystem to use const consistently.
The __UNCONST macro is now used only where necessary and the RW macros
are gone.  Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
2005-06-20 02:49:18 +00:00
christos f381db6045 - add missing const
- fix variable shadowing
- remove unneeded casts
2005-05-30 04:43:46 +00:00
scw 32bd2f7d95 Add a heuristic to test if an audio CODEC's AC97_REG_POWER register supports
the AC97_POWER_ANL bit.

The heuristic simply checks if AC97_REG_POWER's AC97_POWER_MIXER  bit can
be set, implying the CODEC can control power to its mixer. If the bit
reads back as zero after we set it, assume ANL is reserved.

Without this patch, some CODECs (e.g. Philips UCB1400) will experience long
delays during attach and resume while the driver waits for a bit which will
never set.

Thanks to jmcneill@ for reviewing this WRT AC97 modem power control.
2005-05-11 13:13:11 +00:00
jmcneill 212a4fdeb4 * Reduce timeout for codec powerup
* Return ENXIO from ac97_attach_type if the modem codec fails to power-on.
  This will prevent broken AC97 modems *cough*Conexant*cough* from giving
  the impression that they will actually work.
2005-04-12 21:11:43 +00:00
jmcneill 4f351ce9a0 Don't touch AC97_REG_RESET if we're dealing with a modem (modems use
AC97_REG_EXT_MODEM_ID instead). Also set the default audio rate to 8000;
12000 was a stupid choice since we don't actually support it in the driver
yet.
2005-04-12 17:28:02 +00:00
jmcneill c674ab7b1d Add ac97_attach_type(), to allow the hw driver to skip probes for audio or
modem devices. ac97_attach now calls ac97_attach_type() with
AC97_CODEC_TYPE_AUDIO, for backwords compatibility.
2005-04-11 18:26:48 +00:00
jmcneill 702c19a270 Add identifiers for Intel ICH3 AC'97 modems and CXT33 modem codecs, from
Nicolas Joly <njoly _at_ pasteur _dot_ fr>.
2005-04-08 12:50:00 +00:00
jmcneill 0f32e1f4a6 AC'97 modems don't have the same mixer controls as audio devices. Treat
them differently. Mixers are built depending on the features returned
in the ext_mid -- any combination of LINE1, LINE2, and HANDSET.
2005-04-07 23:24:05 +00:00
jmcneill f1db07fc36 * Add more AC97 modem registers (from AC'97 revision 2.2)
* Add sysctls to control the modem's off-hook status (work in progress)
2005-04-04 18:52:30 +00:00
jmcneill c74eb31f21 * Add support for skipping either the modem or audio AC'97 probes
via host_flags: AC97_HOST_SKIP_AUDIO, AC97_HOST_SKIP_MODEM
* If we're dealing with a modem codec, print the extended modem
  capabilities.
* Add basic AC'97 modem initialization support.
* Add some (but not all) AC'97 modem registers. More will be added later.
2005-04-04 02:08:58 +00:00
kent 23b5d91433 merge kent-audio1 branch, which introduces audio filter pipeline to the MI
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
2005-01-10 22:01:36 +00:00
kent 80620cc14f - nuke __P()
- add ac97_codec_if_vtbl::detach()
2004-11-08 14:24:17 +00:00
kent 8e74ad23a5 make sure of readiness of an AC'97 codec by writing a value and
reading it.  There is a codec which is not operational just
after power states become ready.

PR#26457
2004-10-17 08:20:15 +00:00
kent 44f6147e9d split outputs.tone to outputs.bass and outputs.treble
from OpenBSD
2004-10-12 14:34:41 +00:00
kent 54cf6460d6 ac97_host_if::reset() returns non-zero value if codec reset fails, and
ac97 is not attached in that case.

PR: kern/26973
2004-09-22 12:20:24 +00:00
kent 4f9d67091a add debug code for ac97_write().
It is enabled by defining AC97_IO_DEBUG.
2004-08-28 07:02:11 +00:00
thorpej 8b2ffcedfc Use ANSI function decls and more use of static. 2004-08-24 00:53:28 +00:00
kent 2edd85fb18 Check power states after codec reset. This change fixes a
resume problem on some boards.
Patch provided by Joachim Thiemann in PR kern/26457
2004-08-20 14:36:13 +00:00
kent c525acb34a VT1616i support 2004-08-08 10:41:57 +00:00
kent 824fd59f6d correct the mask value for CMI9739 2004-08-08 03:52:19 +00:00
kent 6f7bcb397d recognize CMI9739 codec. 2004-08-08 03:50:56 +00:00
kent 9e25bf4c82 AD1888 support.
PR kern/25949
2004-08-07 17:37:31 +00:00
kent 1c7464b5ca recognize ALC655/658/850 2004-08-07 16:59:54 +00:00
mrg a596504c46 - update URLs for sigmatel.
- add entry for "SigmaTel STAC9758/59" (seen on a new emuxki card)
2004-06-01 13:35:59 +00:00
kent f2680f731e An ICH board needs reading AC97_REG_RESET before reading AC97_VENDOR_ID.
(why?)
http://mail-index.netbsd.org/current-users/2003/11/22/0007.html
2003-11-24 16:05:10 +00:00
kent c51ed264ee AD1985 codec needs the same quirk as AD1980.
The patch was provided by Lars Heidieker.
2003-11-22 06:15:29 +00:00
kent c6585e1d6d Cosmetic changes
- ANSIfy
 - no argument names in prototypes
 - variable declaration with initialization
2003-11-22 05:40:48 +00:00
cube e57b040603 Change the way of setting a port value so that a change too small to
fit in the number of bits used for the port still does something.

This fixes PR pkg/18741 for ac97-based hardware. Other audio drivers
might need a similar fix.
2003-09-28 22:24:09 +00:00
kent 1bea39944d codec id for AD1985 2003-09-28 15:39:09 +00:00
jmmv 16091f0f1c After initialization of the AD1980 codec, swap master and surround volume
controls.  As it was before, the master volume control in all mixer programs
did nothing.  It seems that this codec is not correctly wired in (almost?)
all motherboards.

Patch by Quentin Garnier.  Fixes first part of PR kern/22548.
2003-09-11 09:21:29 +00:00
kent 941d061f07 Correct flag names of AD1980 2003-09-08 13:58:21 +00:00