audio810.h revision f9ead4a57883f3ef04ef20d83cc47987d98c0687
/*
* 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.
*/
#ifndef _AUDIO810_H_
#define _AUDIO810_H_
/*
* Header file for the audio810 device driver
*/
/*
* Driver supported configuration information
*/
#define I810_NAME "audio810"
#define I810_MOD_NAME "audio810 audio driver"
/*
* Misc. defines
*/
#define I810_BD_NUMS (32)
#define I810_NUM_PORTS (2)
#define I810_MOD_SIZE (16)
/* The size of each entry of "reg" property is 5 integers */
#define I810_INTS_PER_REG_PROP 5
/* offset from the base of specified DMA engine */
#define I810_OFFSET_BD_BASE (0x00)
#define I810_OFFSET_CIV (0x04)
#define I810_OFFSET_LVI (0x05)
#define I810_OFFSET_SR (0x06)
#define I810_OFFSET_PICB (0x08)
#define I810_OFFSET_PIV (0x0A)
#define I810_OFFSET_CR (0x0B)
/* DMA engine offset from base */
#define I810_BASE_PCM_IN (0x00)
#define I810_BASE_PCM_OUT (0x10)
#define I810_BASE_MIC (0x20)
#define I810_REG_GCR 0x2C
#define I810_REG_GSR 0x30
#define I810_REG_CASR 0x34
/* bits of bus master status register */
#define I810_BM_SR_DCH 0x01
#define I810_BM_SR_CELV 0x02
#define I810_BM_SR_LVBCI 0x04
#define I810_BM_SR_BCIS 0x08
#define I810_BM_SR_FIFOE 0x10
/* bits of bus master control register */
#define I810_BM_CR_RUN 0x01
#define I810_BM_CR_RST 0x02
#define I810_BM_CR_LVBIE 0x04
#define I810_BM_CR_FEIE 0x08
#define I810_BM_CR_IOCE 0x10
#define I810_BM_CR_PAUSE 0x00
/*
* Global Control Register
*/
#define I810_GCR_GPIE 0x00000001
#define I810_GCR_COLD_RST 0x00000002
#define I810_GCR_WARM_RST 0x00000004
#define I810_GCR_ACLINK_OFF 0x00000008
#define I810_GCR_PRI_INTR_ENABLE 0x00000010
#define I810_GCR_SEC_INTR_ENABLE 0x00000020
/* For ICH2 or more, bit21:20 is the PCM 4/6-channel enable bits */
#define I810_GCR_2_CHANNELS (0 << 20)
/* SiS 7012 has its own flags here */
#define I810_GCR_SIS_2_CHANNELS (0 << 6)
/*
* Global Status Register
*/
#define I810_GSR_CAP8CH 0x00400000
#define I810_GSR_CAP6CH 0x00200000
#define I810_GSR_CAP4CH 0x00100000
#define I810_GSR_READ_COMPL 0x00008000
#define I810_GSR_INTR_SEC_RESUME 0x00000800
#define I810_GSR_INTR_PRI_RESUME 0x00000400
#define I810_GSR_SEC_READY 0x00000200
#define I810_GSR_PRI_READY 0x00000100
#define I810_GSR_INTR_MIC 0x00000080
#define I810_GSR_INTR_POUT 0x00000040
#define I810_GSR_INTR_PIN 0x00000020
#define I810_GSR_INTR_MO 0x00000004
#define I810_GSR_INTR_MI 0x00000002
#define I810_GSR_INTR_GSI 0x00000001
/*
* SiS Control Register
*/
#define I810_SISCTL_UNMUTE 0x01
/*
* Macro for AD1980 codec
*/
#define AD1980_VID1 0x4144
#define AD1980_VID2 0x5370
#define AD1985_VID2 0x5375
#define I810_PCM_IN 0
#define I810_PCM_OUT 1
struct audio810_port {
struct audio810_state *statep;
int num;
unsigned intrs;
unsigned fragfr;
unsigned fragsz;
unsigned sync_dir;
};
typedef struct audio810_port audio810_port_t;
/*
* buffer descripter list entry, sees datasheet
*/
struct i810_bd_entry {
};
typedef struct i810_bd_entry i810_bd_entry_t;
#define BUF_CMD_BUP 0x4000
#define BUF_CMD_IOC 0x8000
typedef enum i810_quirk {
QUIRK_NONE = 0,
QUIRK_SIS7012, /* weird registers and such */
} i810_quirk_t;
/*
* audio810_state_t -per instance state and operation data
*/
struct audio810_state {
};
typedef struct audio810_state audio810_state_t;
/*
* Useful bit twiddlers
*/
#define I810_BM_GET8(reg) \
#define I810_BM_GET16(reg) \
#define I810_BM_GET32(reg) \
#define I810_AM_GET16(reg) \
#endif /* _AUDIO810_H_ */