ad1816.h revision 139749
1139749Simp/*-
251766Scg * (C) 1997 Luigi Rizzo (luigi@iet.unipi.it)
351766Scg *
451766Scg * This file contains information and macro definitions for
551766Scg * the ad1816 chip
651766Scg *
751766Scg * $FreeBSD: head/sys/dev/sound/isa/ad1816.h 139749 2005-01-06 01:43:34Z imp $
851766Scg */
951766Scg
1051766Scg/* AD1816 register macros */
1151766Scg
1251766Scg#define AD1816_ALE	0 	/* indirect reg access 		*/
1351766Scg#define AD1816_INT	1 	/* interupt status     		*/
1451766Scg#define AD1816_LOW	2 	/* indirect low byte   		*/
1551766Scg#define AD1816_HIGH	3 	/* indirect high byte  		*/
1651766Scg
1751766Scg#if 0
1851766Scg#define ad1816_pioD(d) ((d)->io_base+4) /* PIO debug		*/
1951766Scg#define ad1816_pios(d) ((d)->io_base+5) /* PIO status		*/
2051766Scg#define ad1816_piod(d) ((d)->io_base+6) /* PIO data 		*/
2151766Scg#endif
2251766Scg
2351766Scg/* values for playback/capture config:
2451766Scg   bits: 0   enable/disable
2551766Scg         1   pio/dma
2651766Scg         2   stereo/mono
2751766Scg         3   companded/linearPCM
2851766Scg         4-5 format : 00 8bit  linear (uncomp)
2951766Scg                      00 8bit  mulaw  (comp)
3051766Scg                      01 16bit le     (uncomp)
3151766Scg                      01 8bit  alaw   (comp)
3251766Scg                      11 16bit be     (uncomp)
3351766Scg*/
3451766Scg
3551766Scg#define AD1816_PLAY	8 	/* playback config     		*/
3651766Scg#define AD1816_CAPT 	9	/* capture config      		*/
3751766Scg
3851766Scg#define	AD1816_BUSY	0x80	/* chip is busy			*/
3951766Scg#define	AD1816_ALEMASK	0x3F	/* mask for indirect adr.	*/
4051766Scg
4151766Scg#if 0
4251766Scg#define	AD1816_INTRSI	0x01	/* sb intr			*/
4351766Scg#define	AD1816_INTRGI	0x02	/* game intr			*/
4451766Scg#define	AD1816_INTRRI	0x04	/* ring intr			*/
4551766Scg#define	AD1816_INTRDI	0x08	/* dsp intr			*/
4651766Scg#define	AD1816_INTRVI	0x10	/* vol intr			*/
4751766Scg#define	AD1816_INTRTI	0x20 	/* timer intr			*/
4851766Scg#endif
4951766Scg
5051766Scg#define	AD1816_INTRCI	0x40	/* capture intr			*/
5151766Scg#define	AD1816_INTRPI	0x80	/* playback intr		*/
5251766Scg/* PIO stuff is not supplied here */
5351766Scg/* playback / capture config      */
5451766Scg#define	AD1816_ENABLE	0x01	/* enable pl/cp			*/
5551766Scg#define	AD1816_PIO	0x02	/* use pio			*/
5651766Scg#define	AD1816_STEREO	0x04
5751766Scg#define	AD1816_COMP	0x08	/* data is companded		*/
5851766Scg#define	AD1816_U8	0x00	/* 8 bit linear pcm		*/
5951766Scg#define	AD1816_MULAW	0x08	/* 8 bit mulaw			*/
6051766Scg#define	AD1816_ALAW	0x18	/* 8 bit alaw			*/
6151766Scg#define	AD1816_S16LE	0x10	/* 16 bit linear little endian	*/
6251766Scg#define	AD1816_S16BE	0x30	/* 16 bit linear big endian	*/
6351766Scg#define	AD1816_FORMASK  0x38	/* format mask			*/
6451766Scg
6551766Scg#define AD1816_REC_DEVICES	\
6651766Scg    (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD)
6751766Scg
6851766Scg#define AD1816_MIXER_DEVICES	\
6951766Scg    (SOUND_MASK_VOLUME | SOUND_MASK_PCM | SOUND_MASK_SYNTH | \
7051766Scg     SOUND_MASK_LINE   | SOUND_MASK_MIC | SOUND_MASK_CD | SOUND_MASK_IGAIN)
7151766Scg
72