Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src hdaudio(4) is a standards-compliant driver for Intel High De...



details:   https://anonhg.NetBSD.org/src/rev/3ae7c744fdb0
branches:  trunk
changeset: 747224:3ae7c744fdb0
user:      sborrill <sborrill%NetBSD.org@localhost>
date:      Sun Sep 06 17:25:55 2009 +0000

description:
hdaudio(4) is a standards-compliant driver for Intel High Definition Audio.
It will replace azalia(4) after testing.

To use, comment out azalia in your kernel configuration and uncomment the
hdaudio and hdafg lines so it reads:

# Intel High Definition Audio
hdaudio*        at pci? dev ? function ?
hdafg*          at hdaudiobus?

You should also:
cd /dev
sh MAKEDEV audio

diffstat:

 distrib/sets/lists/man/mi           |    11 +-
 doc/CHANGES                         |     4 +-
 etc/MAKEDEV.tmpl                    |     9 +-
 share/man/man4/Makefile             |     6 +-
 share/man/man4/hdaudio.4            |   124 +
 share/man/man8/MAKEDEV.8            |     5 +-
 sys/arch/amd64/conf/GENERIC         |     8 +-
 sys/arch/amd64/conf/XEN3_DOM0       |     6 +-
 sys/arch/i386/conf/ALL              |    10 +-
 sys/arch/i386/conf/GENERIC          |     8 +-
 sys/arch/i386/conf/XEN3_DOM0        |     6 +-
 sys/conf/majors                     |     3 +-
 sys/dev/pci/files.pci               |     5 +-
 sys/dev/pci/hdaudio/files.hdaudio   |    16 +
 sys/dev/pci/hdaudio/hdaudio.c       |  1336 ++++++++++++
 sys/dev/pci/hdaudio/hdaudio_afg.c   |  3618 +++++++++++++++++++++++++++++++++++
 sys/dev/pci/hdaudio/hdaudio_mixer.h |    75 +
 sys/dev/pci/hdaudio/hdaudio_pci.c   |   213 ++
 sys/dev/pci/hdaudio/hdaudioio.h     |    45 +
 sys/dev/pci/hdaudio/hdaudioreg.h    |   357 +++
 sys/dev/pci/hdaudio/hdaudiovar.h    |   180 +
 21 files changed, 6029 insertions(+), 16 deletions(-)

diffs (truncated from 6307 to 300 lines):

diff -r 641148244598 -r 3ae7c744fdb0 distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Sun Sep 06 17:02:36 2009 +0000
+++ b/distrib/sets/lists/man/mi Sun Sep 06 17:25:55 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1154 2009/09/03 01:17:30 joerg Exp $
+# $NetBSD: mi,v 1.1155 2009/09/06 17:25:55 sborrill Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -948,6 +948,9 @@
 ./usr/share/man/cat4/gus.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/guspnp.0                  man-sys-catman          .cat
 ./usr/share/man/cat4/hcide.0                   man-sys-catman          .cat
+./usr/share/man/cat4/hdafg.0                   man-sys-catman          .cat
+./usr/share/man/cat4/hdaudio.0                 man-sys-catman          .cat
+./usr/share/man/cat4/hdaudiobus.0              man-sys-catman          .cat
 ./usr/share/man/cat4/hifn.0                    man-sys-catman          .cat
 ./usr/share/man/cat4/hme.0                     man-sys-catman          .cat
 ./usr/share/man/cat4/hp300/apci.0              man-obsolete            obsolete
@@ -3559,6 +3562,9 @@
 ./usr/share/man/html4/gus.html                 man-sys-htmlman         html
 ./usr/share/man/html4/guspnp.html              man-sys-htmlman         html
 ./usr/share/man/html4/hcide.html               man-sys-htmlman         html
+./usr/share/man/html4/hdafg.html               man-sys-htmlman         html
+./usr/share/man/html4/hdaudiobus.html          man-sys-htmlman         html
+./usr/share/man/html4/hdaudio.html             man-sys-htmlman         html
 ./usr/share/man/html4/hifn.html                        man-sys-htmlman         html
 ./usr/share/man/html4/hme.html                 man-sys-htmlman         html
 ./usr/share/man/html4/hp300/autoconf.html      man-sys-htmlman         html
@@ -5950,6 +5956,9 @@
 ./usr/share/man/man4/gus.4                     man-sys-man             .man
 ./usr/share/man/man4/guspnp.4                  man-sys-man             .man
 ./usr/share/man/man4/hcide.4                   man-sys-man             .man
+./usr/share/man/man4/hdafg.4                   man-sys-man             .man
+./usr/share/man/man4/hdaudio.4                 man-sys-man             .man
+./usr/share/man/man4/hdaudiobus.4              man-sys-man             .man
 ./usr/share/man/man4/hifn.4                    man-sys-man             .man
 ./usr/share/man/man4/hme.4                     man-sys-man             .man
 ./usr/share/man/man4/hp300/apci.4              man-obsolete            obsolete
diff -r 641148244598 -r 3ae7c744fdb0 doc/CHANGES
--- a/doc/CHANGES       Sun Sep 06 17:02:36 2009 +0000
+++ b/doc/CHANGES       Sun Sep 06 17:25:55 2009 +0000
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:                   <$Revision: 1.1284 $>
+# LIST OF CHANGES FROM LAST RELEASE:                   <$Revision: 1.1285 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -381,3 +381,5 @@
                infozip's command line. [joerg 20090903]
        sunleo(4): imported the xf86-video-sunleo 1.2.0 driver from Xorg
                [macallan 20090905]
+       hdaudio(4): New standards-compliant Intel High Definition Audio driver
+               written to replace azalia(4). [sborrill 20090906]
diff -r 641148244598 -r 3ae7c744fdb0 etc/MAKEDEV.tmpl
--- a/etc/MAKEDEV.tmpl  Sun Sep 06 17:02:36 2009 +0000
+++ b/etc/MAKEDEV.tmpl  Sun Sep 06 17:25:55 2009 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#      $NetBSD: MAKEDEV.tmpl,v 1.127 2009/07/05 21:35:16 mrg Exp $
+#      $NetBSD: MAKEDEV.tmpl,v 1.128 2009/09/06 17:25:55 sborrill Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -236,6 +236,7 @@
 #      fb*     PMAX generic framebuffer pseudo-device
 #      fd      file descriptors
 #      grf*    graphics frame buffer device
+#      hdaudio* High Definition audio control device
 #      hil     HP300 HIL input devices
 #      icp     ICP-Vortex/Intel RAID control interface
 #      iic*    IIC bus device
@@ -755,6 +756,7 @@
 %MI_DEVICES_BEGIN%
 audio)
        makedev audio0 audio1 audio2 audio3
+       makedev hdaudio0 hdaudio1 hdaudio2 hdaudio3
        lndev sound0 sound
        lndev audio0 audio
        lndev mixer0 mixer
@@ -1306,6 +1308,11 @@
        mkdev $audioctl c %audio_chr% $(($unit + 192))  666
        ;;
 
+hdaudio*)
+       unit=${i#hdaudio}
+       mkdev hdaudio$unit c %hdaudio_chr% $unit 644
+       ;;
+
 gpio*)
        unit=${i#gpio}
        mkdev gpio$unit c %gpio_chr% $unit 644
diff -r 641148244598 -r 3ae7c744fdb0 share/man/man4/Makefile
--- a/share/man/man4/Makefile   Sun Sep 06 17:02:36 2009 +0000
+++ b/share/man/man4/Makefile   Sun Sep 06 17:25:55 2009 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.497 2009/08/14 21:17:21 mbalmer Exp $
+#      $NetBSD: Makefile,v 1.498 2009/09/06 17:25:55 sborrill Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 
 MAN=   aac.4 ac97.4 acardide.4 aceride.4 acphy.4 acpidalb.4 \
@@ -26,7 +26,7 @@
        fast_ipsec.4 fd.4 finsio.4 fpa.4 fms.4 fss.4 fxp.4 \
        gcscaudio.4 gem.4 genfb.4 gentbi.4 geodeide.4 \
        glxtphy.4 gpib.4 gpio.4 gpiolock.4 gpiosim.4 gre.4 gphyter.4 gsip.4 \
-       hifn.4 hme.4 hpqlb.4 hptide.4 \
+       hdaudio.4 hifn.4 hme.4 hpqlb.4 hptide.4 \
        ichlpcib.4 ichsmb.4 icmp.4 icp.4 icsphy.4 iee.4 ieee80211.4 \
        ifmedia.4 igsfb.4 iha.4 iic.4 inet.4 ikphy.4 inphy.4 intersil7170.4 \
        ioasic.4 ioat.4 iop.4 iophy.4 iopsp.4 ip.4 ipkdb.4 ipmi.4 ipw.4 \
@@ -165,6 +165,8 @@
 MLINKS+=dbcool.4 adt7476.4
 MLINKS+=fd.4 stderr.4 fd.4 stdin.4 fd.4 stdout.4
 MLINKS+=fpa.4 fea.4 fpa.4 fta.4
+MLINKS+=hdaudio.4 hdafg.4
+MLINKS+=hdaudio.4 hdaudiobus.4
 MLINKS+=icp.4 icpsp.4
 MLINKS+=irframe.4 irda.4
 MLINKS+=le.4 bicc.4 le.4 nele.4 le.4 depca.4
diff -r 641148244598 -r 3ae7c744fdb0 share/man/man4/hdaudio.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/hdaudio.4  Sun Sep 06 17:25:55 2009 +0000
@@ -0,0 +1,124 @@
+.\"    $NetBSD: hdaudio.4,v 1.1 2009/09/06 17:25:55 sborrill Exp $
+.\"
+.\" Copyright (c) 2009 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Precedence Technologies Ltd
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd August 25, 2009
+.Dt HDAUDIO 4
+.Os
+.Sh NAME
+.Nm hdaudio
+.Nd Generic High Definition Audio device driver
+.Sh SYNOPSIS
+.Cd "hdaudio* at pci? dev ? function ?"
+.Cd "hdafg* at hdaudiobus?"
+.Cd "audio* at audiobus?"
+.Pp
+.Cd "options HDAUDIO_DEBUG"
+.Cd "options HDAUDIO_CFG_DEBUG"
+.Sh DESCRIPTION
+The
+.Nm
+device driver is expected to support any PCI device which is
+compliant to the High Definition Audio Specification 1.0.
+It is a replacement for
+.Xr azalia 4 .
+It was written from scratch following the Intel HD Audio and Microsoft
+Universal Audio Architecture specifications.
+
+The driver consists of two interlinked components, which reflects the
+hardware design.
+The
+.Nm
+component interfaces with a PCI/PCIe bus and provides an
+.Xr hdaudiobus 4
+onto which different function groups attach.
+Each function group (e.g. audio, vendor-specific modem) is exported as a
+separate child device of the
+.Nm
+controller.
+Audio function groups (a.k.a audio codec) are exported as
+.Xr hdafg 4
+devices.
+
+Audio codecs are available from a number of manufacturers and are made up of a
+number of widgets (e.g. audio mixer, output pin, analog-to-digital converter).
+The way the widgets are interlinked varies significantly between
+implementations.
+The tree of widgets must be parsed and mapped to
+.Xr mixer 4
+controls.
+As part of this process, loops in the inter-codec links must be detected
+and muted, bi-directional pins must be set up appropriately and the locations
+of pins determined.
+Unlike the
+.Xr azalia 4
+driver (which tends to generate a large number of unclearly named
+.Xr mixer 4
+controls), 
+.Nm
+works backwards by starting with a list of desired, consistent and compatible
+.Xr mixer 4
+controls and configuring/discovering appropriate widget link routes to fit.
+
+By following the published mechanisms for common implementations of widget
+parsing, it is expected that nearly all High Definition Audio devices will
+be supported without requiring per-device quirks.
+
+.Sh SEE ALSO
+.Xr audio 4 ,
+.Xr mixer 4 ,
+.Xr pci 4 ,
+.Pa http://www.intel.com/standards/hdaudio/
+.Pa http://www.microsoft.com/whdc/device/audio/
+.Sh AUTHORS
+The
+.Nm
+driver was written by
+.An Jared McNeill Aq jmcneill%NetBSD.org@localhost
+under contract by
+.An Precedence Technologies Ltd Aq http://www.precedence.co.uk/ .
+The UAA-compliant widget parser is derived from the FreeBSD snd_hda(4) driver.
+.Sh BUGS
+The following items are not yet implemented:
+.Bl -tag -width indent
+- Support sample rates in hardware other than 48kHz
+.Bl -tag -width indent
+- Improve power management support when driver is idle
+.Bl -tag -width indent
+- Add support for non-PCM output formats
+.Bl -tag -width indent
+- Handle unsolicited RIRB messages
+.Bl -tag -width indent
+- Headphone jack sensing
+.Bl -tag -width indent
+- Modem function groups
+.Sh HISTORY
+The
+.Nm
+device driver appeared in
+.Nx 6.0 .
diff -r 641148244598 -r 3ae7c744fdb0 share/man/man8/MAKEDEV.8
--- a/share/man/man8/MAKEDEV.8  Sun Sep 06 17:02:36 2009 +0000
+++ b/share/man/man8/MAKEDEV.8  Sun Sep 06 17:25:55 2009 +0000
@@ -6,7 +6,7 @@
 .\" *** DO NOT EDIT - any changes will be lost!!!
 .\" *** ------------------------------------------------------------------
 .\"
-.\" $NetBSD: MAKEDEV.8,v 1.35 2009/09/06 15:31:04 sborrill Exp $
+.\" $NetBSD: MAKEDEV.8,v 1.36 2009/09/06 17:25:55 sborrill Exp $
 .\"
 .\" Copyright (c) 2001, 2003, 2007, 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -721,6 +721,9 @@
 Graphics frame buffer device, see
 .Xr \&amiga/grf 4 ,
 .Xr \&hp300/grf 4
+. It Ar hdaudio#
+High Definition audio control device, see
+.Xr \&hdaudio 4
 . It Ar hil
 HP300 HIL input devices, see
 .Xr \&hp300/hil 4
diff -r 641148244598 -r 3ae7c744fdb0 sys/arch/amd64/conf/GENERIC
--- a/sys/arch/amd64/conf/GENERIC       Sun Sep 06 17:02:36 2009 +0000
+++ b/sys/arch/amd64/conf/GENERIC       Sun Sep 06 17:25:55 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.249 2009/08/09 21:32:16 christos Exp $
+# $NetBSD: GENERIC,v 1.250 2009/09/06 17:25:56 sborrill Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.249 $"
+#ident                 "GENERIC-$Revision: 1.250 $"
 
 maxusers       64              # estimated number of users
 
@@ -954,6 +954,10 @@
 opl*   at fms?
 opl*   at sv?
 
+# Intel High Definition Audio
+#hdaudio*      at pci? dev ? function ?        # Intel High Definition Audio
+#hdafg*                at hdaudiobus?
+
 # Audio support
 audio* at audiobus?
 
diff -r 641148244598 -r 3ae7c744fdb0 sys/arch/amd64/conf/XEN3_DOM0
--- a/sys/arch/amd64/conf/XEN3_DOM0     Sun Sep 06 17:02:36 2009 +0000



Home | Main Index | Thread Index | Old Index