csavar.h revision 77504
153553Stanimura/*- 253553Stanimura * Copyright (c) 1999 Seigo Tanimura 353553Stanimura * All rights reserved. 453553Stanimura * 553553Stanimura * Redistribution and use in source and binary forms, with or without 653553Stanimura * modification, are permitted provided that the following conditions 753553Stanimura * are met: 853553Stanimura * 1. Redistributions of source code must retain the above copyright 953553Stanimura * notice, this list of conditions and the following disclaimer. 1053553Stanimura * 2. Redistributions in binary form must reproduce the above copyright 1153553Stanimura * notice, this list of conditions and the following disclaimer in the 1253553Stanimura * documentation and/or other materials provided with the distribution. 1353553Stanimura * 1453553Stanimura * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1553553Stanimura * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1653553Stanimura * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1753553Stanimura * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1853553Stanimura * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1953553Stanimura * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2053553Stanimura * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2153553Stanimura * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2253553Stanimura * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2353553Stanimura * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2453553Stanimura * SUCH DAMAGE. 2553553Stanimura * 2653553Stanimura * $FreeBSD: head/sys/dev/sound/pci/csavar.h 77504 2001-05-30 22:38:31Z cg $ 2753553Stanimura */ 2853553Stanimura 2953553Stanimura#ifndef _CSA_VAR_H 3053553Stanimura#define _CSA_VAR_H 3177504Scgstruct csa_card { 3277504Scg u_int16_t subvendor, subdevice; 3377504Scg char *name; 3477504Scg void *amp; 3577504Scg void *amp_init; 3677504Scg int (*active)(int); 3777504Scg}; 3853553Stanimura 3953553Stanimura/* Resources. */ 4053553Stanimurastruct csa_res { 4153553Stanimura int io_rid; /* io rid */ 4253553Stanimura struct resource *io; /* io */ 4353553Stanimura int mem_rid; /* memory rid */ 4453553Stanimura struct resource *mem; /* memory */ 4553553Stanimura int irq_rid; /* irq rid */ 4653553Stanimura struct resource *irq; /* irq */ 4753553Stanimura}; 4853553Stanimuratypedef struct csa_res csa_res; 4953553Stanimura 5055320Stanimura/* State of the bridge. */ 5155320Stanimurastruct csa_bridgeinfo { 5255320Stanimura u_int32_t hisr; /* The value of HISR on this interrupt. */ 5377504Scg struct csa_card *card; 5455320Stanimura}; 5555320Stanimura 5655320Stanimuravoid csa_clearserialfifos(csa_res *resp); 5755320Stanimura 5853553Stanimura/* Common functions for csa. */ 5977504Scgstruct csa_card *csa_findsubcard(device_t dev); 6053553Stanimuraint csa_readcodec(csa_res *resp, u_long offset, u_int32_t *data); 6153553Stanimuraint csa_writecodec(csa_res *resp, u_long offset, u_int32_t data); 6253553Stanimura 6353553Stanimurau_int32_t csa_readio(csa_res *resp, u_long offset); 6453553Stanimuravoid csa_writeio(csa_res *resp, u_long offset, u_int32_t data); 6553553Stanimurau_int32_t csa_readmem(csa_res *resp, u_long offset); 6653553Stanimuravoid csa_writemem(csa_res *resp, u_long offset, u_int32_t data); 6753553Stanimura 6853553Stanimura#endif /* _CSA_VAR_H */ 69