z8530var.h revision 1.1
11.1Ssoren/*	$NetBSD: z8530var.h,v 1.1 2000/06/14 15:40:02 soren Exp $	*/
21.1Ssoren
31.1Ssoren/*
41.1Ssoren * Copyright (c) 1994 Gordon W. Ross
51.1Ssoren * Copyright (c) 1992, 1993
61.1Ssoren *	The Regents of the University of California.  All rights reserved.
71.1Ssoren *
81.1Ssoren * This software was developed by the Computer Systems Engineering group
91.1Ssoren * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
101.1Ssoren * contributed to Berkeley.
111.1Ssoren *
121.1Ssoren * All advertising materials mentioning features or use of this software
131.1Ssoren * must display the following acknowledgement:
141.1Ssoren *	This product includes software developed by the University of
151.1Ssoren *	California, Lawrence Berkeley Laboratory.
161.1Ssoren *
171.1Ssoren * Redistribution and use in source and binary forms, with or without
181.1Ssoren * modification, are permitted provided that the following conditions
191.1Ssoren * are met:
201.1Ssoren * 1. Redistributions of source code must retain the above copyright
211.1Ssoren *    notice, this list of conditions and the following disclaimer.
221.1Ssoren * 2. Redistributions in binary form must reproduce the above copyright
231.1Ssoren *    notice, this list of conditions and the following disclaimer in the
241.1Ssoren *    documentation and/or other materials provided with the distribution.
251.1Ssoren * 3. All advertising materials mentioning features or use of this software
261.1Ssoren *    must display the following acknowledgement:
271.1Ssoren *	This product includes software developed by the University of
281.1Ssoren *	California, Berkeley and its contributors.
291.1Ssoren * 4. Neither the name of the University nor the names of its contributors
301.1Ssoren *    may be used to endorse or promote products derived from this software
311.1Ssoren *    without specific prior written permission.
321.1Ssoren *
331.1Ssoren * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
341.1Ssoren * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
351.1Ssoren * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
361.1Ssoren * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
371.1Ssoren * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
381.1Ssoren * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
391.1Ssoren * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
401.1Ssoren * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
411.1Ssoren * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
421.1Ssoren * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
431.1Ssoren * SUCH DAMAGE.
441.1Ssoren */
451.1Ssoren
461.1Ssoren#include <machine/bus.h>
471.1Ssoren#include <dev/ic/z8530sc.h>
481.1Ssoren
491.1Ssorenstruct zsc_softc {
501.1Ssoren	struct device zsc_dev;
511.1Ssoren	bus_space_tag_t zsc_st;
521.1Ssoren	bus_space_handle_t zsc_sh;
531.1Ssoren	struct zs_chanstate *zsc_cs[2];	/* channel A and B soft state */
541.1Ssoren	/* Machine-dependent part follows... */
551.1Ssoren	struct zs_chanstate zsc_cs_store[2];
561.1Ssoren};
571.1Ssoren
581.1Ssoren/*
591.1Ssoren * Functions to read and write individual registers in a channel.
601.1Ssoren * The ZS chip requires a 1.6 uSec. recovery time between accesses.
611.1Ssoren * The delay is now handled inside the chip access functions.
621.1Ssoren * These could be inlines, but with the delay, speed is moot.
631.1Ssoren */
641.1Ssoren
651.1Ssorenu_int8_t zs_read_reg(struct zs_chanstate *cs, bus_size_t reg);
661.1Ssorenu_int8_t zs_read_csr(struct zs_chanstate *cs);
671.1Ssorenu_int8_t zs_read_data(struct zs_chanstate *cs);
681.1Ssoren
691.1Ssorenvoid zs_write_reg(struct zs_chanstate *cs, bus_size_t reg, u_int8_t val);
701.1Ssorenvoid zs_write_csr(struct zs_chanstate *cs, u_int8_t val);
711.1Ssorenvoid zs_write_data(struct zs_chanstate *cs, u_int8_t val);
72