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$ 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); 3778673Scg int inv_eapd; 3877504Scg}; 3953553Stanimura 4053553Stanimura/* Resources. */ 4153553Stanimurastruct csa_res { 4253553Stanimura int io_rid; /* io rid */ 4353553Stanimura struct resource *io; /* io */ 4453553Stanimura int mem_rid; /* memory rid */ 4553553Stanimura struct resource *mem; /* memory */ 4653553Stanimura int irq_rid; /* irq rid */ 4753553Stanimura struct resource *irq; /* irq */ 4853553Stanimura}; 4953553Stanimuratypedef struct csa_res csa_res; 5053553Stanimura 5155320Stanimura/* State of the bridge. */ 5255320Stanimurastruct csa_bridgeinfo { 5355320Stanimura u_int32_t hisr; /* The value of HISR on this interrupt. */ 5477504Scg struct csa_card *card; 5555320Stanimura}; 5655320Stanimura 5755320Stanimuravoid csa_clearserialfifos(csa_res *resp); 5855320Stanimura 5953553Stanimura/* Common functions for csa. */ 6077504Scgstruct csa_card *csa_findsubcard(device_t dev); 6153553Stanimuraint csa_readcodec(csa_res *resp, u_long offset, u_int32_t *data); 6253553Stanimuraint csa_writecodec(csa_res *resp, u_long offset, u_int32_t data); 6353553Stanimura 6453553Stanimurau_int32_t csa_readio(csa_res *resp, u_long offset); 6553553Stanimuravoid csa_writeio(csa_res *resp, u_long offset, u_int32_t data); 6653553Stanimurau_int32_t csa_readmem(csa_res *resp, u_long offset); 6753553Stanimuravoid csa_writemem(csa_res *resp, u_long offset, u_int32_t data); 6853553Stanimura 69147626Sglebiusvoid csa_resetdsp(csa_res *resp); 7053553Stanimura#endif /* _CSA_VAR_H */ 71