Home | History | Annotate | Line # | Download | only in isa
essvar.h revision 1.25.8.1
      1  1.25.8.1      yamt /*	$NetBSD: essvar.h,v 1.25.8.1 2012/04/17 00:07:38 yamt Exp $	*/
      2       1.1  augustss /*
      3       1.1  augustss  * Copyright 1997
      4       1.1  augustss  * Digital Equipment Corporation. All rights reserved.
      5       1.1  augustss  *
      6       1.1  augustss  * This software is furnished under license and may be used and
      7       1.1  augustss  * copied only in accordance with the following terms and conditions.
      8       1.1  augustss  * Subject to these conditions, you may download, copy, install,
      9       1.1  augustss  * use, modify and distribute this software in source and/or binary
     10       1.1  augustss  * form. No title or ownership is transferred hereby.
     11       1.1  augustss  *
     12       1.1  augustss  * 1) Any source code used, modified or distributed must reproduce
     13       1.1  augustss  *    and retain this copyright notice and list of conditions as
     14       1.1  augustss  *    they appear in the source file.
     15       1.1  augustss  *
     16       1.1  augustss  * 2) No right is granted to use any trade name, trademark, or logo of
     17       1.1  augustss  *    Digital Equipment Corporation. Neither the "Digital Equipment
     18       1.1  augustss  *    Corporation" name nor any trademark or logo of Digital Equipment
     19       1.1  augustss  *    Corporation may be used to endorse or promote products derived
     20       1.1  augustss  *    from this software without the prior written permission of
     21       1.1  augustss  *    Digital Equipment Corporation.
     22       1.1  augustss  *
     23       1.1  augustss  * 3) This software is provided "AS-IS" and any express or implied
     24       1.1  augustss  *    warranties, including but not limited to, any implied warranties
     25       1.1  augustss  *    of merchantability, fitness for a particular purpose, or
     26       1.1  augustss  *    non-infringement are disclaimed. In no event shall DIGITAL be
     27       1.1  augustss  *    liable for any damages whatsoever, and in particular, DIGITAL
     28       1.1  augustss  *    shall not be liable for special, indirect, consequential, or
     29       1.1  augustss  *    incidental damages or damages for lost profits, loss of
     30       1.1  augustss  *    revenue or loss of use, whether such damages arise in contract,
     31       1.1  augustss  *    negligence, tort, under statute, in equity, at law or otherwise,
     32       1.1  augustss  *    even if advised of the possibility of such damage.
     33       1.1  augustss  */
     34       1.1  augustss 
     35       1.1  augustss /*
     36  1.25.8.1      yamt ** @(#) $RCSfile: essvar.h,v $ $Revision: 1.25.8.1 $ (SHARK) $Date: 2012/04/17 00:07:38 $
     37       1.1  augustss **
     38       1.1  augustss **++
     39       1.1  augustss **
     40       1.1  augustss **  essvar.h
     41       1.1  augustss **
     42       1.1  augustss **  FACILITY:
     43       1.1  augustss **
     44       1.1  augustss **	DIGITAL Network Appliance Reference Design (DNARD)
     45       1.1  augustss **
     46       1.1  augustss **  MODULE DESCRIPTION:
     47       1.1  augustss **
     48       1.1  augustss **      This module contains the structure definitions and function
     49       1.1  augustss **      prototypes for the ESS Technologies 1887/888 sound chip
     50       1.1  augustss **      driver.
     51       1.1  augustss **
     52       1.1  augustss **  AUTHORS:
     53       1.1  augustss **
     54       1.1  augustss **	Blair Fidler	Software Engineering Australia
     55       1.1  augustss **			Gold Coast, Australia.
     56       1.1  augustss **
     57      1.23     perry **  CREATION DATE:
     58       1.1  augustss **
     59       1.1  augustss **	May 12, 1997.
     60       1.1  augustss **
     61       1.1  augustss **  MODIFICATION HISTORY:
     62       1.1  augustss **
     63       1.1  augustss **--
     64       1.1  augustss */
     65      1.17   thorpej 
     66      1.17   thorpej #include <sys/callout.h>
     67      1.17   thorpej 
     68       1.1  augustss #define ESS_DAC_PLAY_VOL	0
     69       1.1  augustss #define ESS_MIC_PLAY_VOL	1
     70       1.1  augustss #define ESS_LINE_PLAY_VOL	2
     71       1.1  augustss #define ESS_SYNTH_PLAY_VOL	3
     72       1.1  augustss #define ESS_CD_PLAY_VOL		4
     73       1.1  augustss #define ESS_AUXB_PLAY_VOL	5
     74       1.1  augustss #define ESS_INPUT_CLASS		6
     75       1.1  augustss 
     76       1.1  augustss #define ESS_MASTER_VOL		7
     77       1.1  augustss #define ESS_PCSPEAKER_VOL	8
     78       1.1  augustss #define ESS_OUTPUT_CLASS	9
     79       1.1  augustss 
     80      1.12   nathanw #define ESS_RECORD_MONITOR	10
     81      1.12   nathanw #define ESS_MONITOR_CLASS	11
     82       1.1  augustss 
     83      1.12   nathanw #define ESS_RECORD_VOL		12
     84      1.12   nathanw #define	ESS_RECORD_SOURCE	13
     85      1.12   nathanw #define ESS_RECORD_CLASS	14
     86      1.12   nathanw 
     87      1.12   nathanw #define ESS_1788_NDEVS		15
     88      1.12   nathanw 
     89      1.12   nathanw #define ESS_DAC_REC_VOL		15
     90      1.12   nathanw #define ESS_MIC_REC_VOL		16
     91      1.12   nathanw #define ESS_LINE_REC_VOL	17
     92      1.12   nathanw #define ESS_SYNTH_REC_VOL	18
     93      1.12   nathanw #define ESS_CD_REC_VOL		19
     94      1.12   nathanw #define ESS_AUXB_REC_VOL	20
     95      1.12   nathanw #define ESS_MIC_PREAMP		21
     96       1.1  augustss 
     97      1.12   nathanw #define ESS_1888_NDEVS		22
     98      1.12   nathanw #define ESS_MAX_NDEVS		22
     99       1.1  augustss 
    100       1.1  augustss struct ess_audio_channel
    101       1.1  augustss {
    102       1.1  augustss 	int	drq;			/* DMA channel */
    103      1.16   thorpej 	bus_size_t maxsize;		/* max size for DMA channel */
    104       1.4  augustss #define IS16BITDRQ(drq) ((drq) >= 4)
    105       1.1  augustss 	int	irq;			/* IRQ line for this DMA channel */
    106       1.2  augustss 	int	ist;
    107       1.1  augustss 	void	*ih;			/* interrupt vectoring */
    108       1.1  augustss 	u_long	nintr;			/* number of interrupts taken */
    109      1.22      kent 	void	(*intr)(void*);		/* ISR for DMA complete */
    110       1.1  augustss 	void	*arg;			/* arg for intr() */
    111       1.1  augustss 
    112       1.1  augustss 	/* Status information */
    113       1.1  augustss 	int	active;			/* boolean: channel in use? */
    114      1.14   mycroft 
    115      1.14   mycroft 	/* Polling state */
    116      1.14   mycroft 	int	polled;			/* 1 if channel is polled */
    117      1.14   mycroft 	int	dmapos;			/* last DMA pointer */
    118      1.14   mycroft 	int	buffersize;		/* size of DMA buffer */
    119      1.14   mycroft 	/* (The following is only needed due to the stupid block interface.) */
    120      1.14   mycroft 	int	dmacount;		/* leftover partial block */
    121      1.14   mycroft 	int	blksize;		/* current block size */
    122       1.1  augustss };
    123       1.1  augustss 
    124       1.1  augustss struct ess_softc
    125       1.1  augustss {
    126      1.25   tsutsui 	device_t sc_dev;		/* base device */
    127       1.1  augustss 	isa_chipset_tag_t sc_ic;
    128       1.1  augustss 	bus_space_tag_t sc_iot;		/* tag */
    129       1.1  augustss 	bus_space_handle_t sc_ioh;	/* handle */
    130  1.25.8.1      yamt 	kmutex_t sc_lock;
    131  1.25.8.1      yamt 	kmutex_t sc_intr_lock;
    132      1.17   thorpej 
    133  1.25.8.1      yamt 	callout_t sc_poll1_ch;		/* audio1 poll */
    134  1.25.8.1      yamt 	callout_t sc_poll2_ch;		/* audio2 poll */
    135       1.1  augustss 
    136       1.1  augustss 	int	sc_iobase;		/* I/O port base address */
    137       1.1  augustss 
    138       1.1  augustss 	u_short	sc_open;		/* reference count of open calls */
    139       1.1  augustss 
    140      1.22      kent 	int ndevs;
    141      1.12   nathanw 	u_char	gain[ESS_MAX_NDEVS][2];	/* kept in input levels */
    142       1.1  augustss #define ESS_LEFT 0
    143       1.1  augustss #define ESS_RIGHT 1
    144      1.22      kent 
    145       1.1  augustss 	u_int	out_port;		/* output port */
    146       1.1  augustss 	u_int	in_mask;		/* input ports */
    147       1.1  augustss 	u_int	in_port;		/* XXX needed for MI interface */
    148       1.1  augustss 
    149       1.1  augustss 	u_int	spkr_state;		/* non-null is on */
    150      1.22      kent 
    151      1.13   mycroft 	struct ess_audio_channel sc_audio1; /* audio channel for record */
    152      1.13   mycroft 	struct ess_audio_channel sc_audio2; /* audio channel for playback */
    153       1.1  augustss 
    154       1.1  augustss 	u_int	sc_model;
    155       1.1  augustss #define ESS_UNSUPPORTED 0
    156      1.21   mycroft #define	ESS_688		1
    157      1.21   mycroft #define	ESS_1688	2
    158      1.21   mycroft #define ESS_1788	3
    159      1.21   mycroft #define ESS_1868	4
    160      1.21   mycroft #define ESS_1869	5
    161      1.21   mycroft #define ESS_1878	6
    162      1.21   mycroft #define ESS_1879	7
    163      1.21   mycroft #define ESS_888		8
    164      1.21   mycroft #define ESS_1887	9
    165      1.21   mycroft #define ESS_1888	10
    166       1.1  augustss 
    167       1.1  augustss 	u_int	sc_version;		/* Legacy ES688/ES1688 ID */
    168      1.19  drochner 
    169      1.19  drochner 	/* game port on es1888 */
    170      1.19  drochner 	bus_space_tag_t sc_joy_iot;
    171      1.19  drochner 	bus_space_handle_t sc_joy_ioh;
    172       1.1  augustss };
    173       1.1  augustss 
    174      1.22      kent int	essmatch(struct ess_softc *);
    175      1.22      kent void	essattach(struct ess_softc *, int);
    176      1.22      kent int	ess_config_addr(struct ess_softc *);
    177       1.1  augustss 
    178