Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev/pci Pull up revisions 1.1-1.3 (new, requested b...



details:   https://anonhg.NetBSD.org/src/rev/17871fe9b2da
branches:  netbsd-1-5
changeset: 492608:17871fe9b2da
user:      he <he%NetBSD.org@localhost>
date:      Thu Jan 24 22:36:13 2002 +0000

description:
Pull up revisions 1.1-1.3 (new, requested by he):
  Add driver for the ESS Allegro-1 / Maestro-3 audio hardware.

diffstat:

 sys/dev/pci/esavar.h |  95 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 95 insertions(+), 0 deletions(-)

diffs (99 lines):

diff -r abb07a63f1cb -r 17871fe9b2da sys/dev/pci/esavar.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/pci/esavar.h      Thu Jan 24 22:36:13 2002 +0000
@@ -0,0 +1,95 @@
+/* $NetBSD: esavar.h,v 1.3.2.2 2002/01/24 22:36:13 he Exp $ */
+
+/*
+ * Copyright (c) 2001, 2002 Jared D. McNeill <jmcneill%invisible.yi.org@localhost>
+ * All rights reserved.
+ *
+ * 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. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ */
+
+/*
+ * ESS Allegro-1 / Maestro3 Audio Driver
+ * 
+ * Based on the FreeBSD maestro3 driver
+ *
+ */
+
+#define KERNADDR(p)    ((void *)((p)->addr))
+#define        DMAADDR(p)      ((p)->map->dm_segs[0].ds_addr)
+
+#define ESA_MINRATE    8000
+#define ESA_MAXRATE    48000
+
+struct esa_dma {
+       bus_dmamap_t            map;
+       caddr_t                 addr;
+       bus_dma_segment_t       segs[1];
+       int                     nsegs;
+       size_t                  size;
+       struct esa_dma          *next;
+};
+
+struct esa_channel {
+       int                     active;
+       int                     data_offset;
+       size_t                  bufsize;
+       int                     blksize;
+       int                     pos;
+       void                    *buf;
+       u_int32_t               start;
+       u_int32_t               count;
+       struct esa_dma          *dma;
+       
+       void                    (*intr)(void *);
+       void                    *arg;
+};
+
+struct esa_softc
+{
+       struct device           sc_dev;
+       bus_space_tag_t         sc_iot;
+       bus_space_handle_t      sc_ioh;
+       bus_addr_t              sc_iob;
+       bus_size_t              sc_ios;
+
+       pcitag_t                sc_tag;
+       pci_chipset_tag_t       sc_pct;
+       bus_dma_tag_t           sc_dmat;
+       pcireg_t                sc_pcireg;
+
+       void                    *sc_ih;
+
+       struct ac97_codec_if    *codec_if;
+       struct ac97_host_if     host_if;
+       enum ac97_host_flags    codec_flags;
+
+       struct device           *sc_audiodev;
+
+       struct esa_channel      play;
+       struct esa_channel      rec;
+       struct esa_dma          *sc_dmas;
+
+       int                     type;           /* Allegro-1 or Maestro 3? */
+       int                     delay1, delay2;
+
+       void                    *powerhook;
+       u_int16_t               *savemem;
+};



Home | Main Index | Thread Index | Old Index