csavar.h revision 55320
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 55320 2000-01-03 02:51:16Z tanimura $ 2753553Stanimura */ 2853553Stanimura 2953553Stanimura#ifndef _CSA_VAR_H 3053553Stanimura#define _CSA_VAR_H 3153553Stanimura 3253553Stanimura/* Resources. */ 3353553Stanimurastruct csa_res { 3453553Stanimura int io_rid; /* io rid */ 3553553Stanimura struct resource *io; /* io */ 3653553Stanimura int mem_rid; /* memory rid */ 3753553Stanimura struct resource *mem; /* memory */ 3853553Stanimura int irq_rid; /* irq rid */ 3953553Stanimura struct resource *irq; /* irq */ 4053553Stanimura}; 4153553Stanimuratypedef struct csa_res csa_res; 4253553Stanimura 4355320Stanimura/* State of the bridge. */ 4455320Stanimurastruct csa_bridgeinfo { 4555320Stanimura u_int32_t hisr; /* The value of HISR on this interrupt. */ 4655320Stanimura}; 4755320Stanimura 4855320Stanimuravoid csa_clearserialfifos(csa_res *resp); 4955320Stanimura 5053553Stanimura/* Common functions for csa. */ 5153553Stanimuraint csa_readcodec(csa_res *resp, u_long offset, u_int32_t *data); 5253553Stanimuraint csa_writecodec(csa_res *resp, u_long offset, u_int32_t data); 5353553Stanimura 5453553Stanimurau_int32_t csa_readio(csa_res *resp, u_long offset); 5553553Stanimuravoid csa_writeio(csa_res *resp, u_long offset, u_int32_t data); 5653553Stanimurau_int32_t csa_readmem(csa_res *resp, u_long offset); 5753553Stanimuravoid csa_writemem(csa_res *resp, u_long offset, u_int32_t data); 5853553Stanimura 5953553Stanimura#endif /* _CSA_VAR_H */ 60