audiovia823x.h revision 88447a05f537aabe9a1bc3d5313f22581ec992a7
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Purpose: Definitions for the via8233 driver
*/
/*
* This file is part of Open Sound System
*
* Copyright (C) 4Front Technologies 1996-2008.
*
* This software is released under CDDL 1.0 source license.
* See the COPYING file included in the main directory of this source
* distribution for the license terms and conditions.
*/
#ifndef AUDIOVIA823X_H
#define AUDIOVIA823X_H
#define AUVIA_NAME "audiovia823x"
#define VIA_VENDOR_ID 0x1106
#define VIA_8233_ID 0x3059
#define VIA_8233A_ID 0x7059
/* pci configuration registers */
#define AUVIA_PLAY_SGD_NUM 1
#define AUVIA_REC_SGD_NUM 0
#define AUVIA_NUM_PORTC 2
#define AUVIA_MAX_INTRS 256
#define AUVIA_MIN_INTRS 24
#define AUVIA_INTRS 175
#define AUVIA_SGD_EOL 0x80000000
#define AUVIA_SGD_FLAG 0x40000000
#define CODEC_TIMEOUT_COUNT 500
#define REG_RECBASE 0x60
/* REG_CODEC */
/* registers that are offsets relative to a port */
#define OFF_STATUS 0x00
#define OFF_CTRL 0x01
#define OFF_PLAYFMT 0x02
#define OFF_RECFIFO 0x02
#define OFF_DMA 0x04
#define OFF_CHANNELS 0x08
#define OFF_RECFMT 0x08
#define OFF_COUNT 0x0C
/* bits for above offsets */
#define STATUS_INTR 0x3
#define CTRL_START 0x80
#define CTRL_TERMINATE 0x40
#define CTRL_AUTOSTART 0x20
#define CTRL_FLAG 0x01
#define PLAYFMT_16BIT 0x80
#define PLAYFMT_6CH 0x60
#define PLAYFMT_4CH 0x40
#define RECFIFO_ENABLE 0x40
#define RECFMT_48K 0x00ffffff
#define RECFMT_STEREO 0x00100000
#define RECFMT_16BIT 0x00200000
typedef struct {
unsigned int phaddr;
unsigned int flags;
} SGD_entry;
typedef struct auvia_portc auvia_portc_t;
typedef struct auvia_devc auvia_devc_t;
struct auvia_portc {
int nchan;
int syncdir;
unsigned intrs;
unsigned fragfr;
unsigned fragsz;
unsigned cur_frag;
unsigned resid;
/* helper functions */
void (*reset)(auvia_portc_t *);
};
struct auvia_devc {
char *chip_name;
int chip_type;
#define CHIP_8233 0
#define CHIP_8233A 1
/* registers */
};
#endif /* AUDIOVIA823X_H */