Home | History | Annotate | Line # | Download | only in include
      1  1.4     chs /* $NetBSD: adm5120_extiovar.h,v 1.4 2012/10/27 17:18:01 chs Exp $ */
      2  1.1  dyoung 
      3  1.1  dyoung /*-
      4  1.1  dyoung  * Copyright (c) 2007 David Young.  All rights reserved.
      5  1.1  dyoung  *
      6  1.1  dyoung  * Redistribution and use in source and binary forms, with or
      7  1.1  dyoung  * without modification, are permitted provided that the following
      8  1.1  dyoung  * conditions are met:
      9  1.1  dyoung  * 1. Redistributions of source code must retain the above copyright
     10  1.1  dyoung  *    notice, this list of conditions and the following disclaimer.
     11  1.1  dyoung  * 2. Redistributions in binary form must reproduce the above
     12  1.1  dyoung  *    copyright notice, this list of conditions and the following
     13  1.1  dyoung  *    disclaimer in the documentation and/or other materials provided
     14  1.1  dyoung  *    with the distribution.
     15  1.1  dyoung  *
     16  1.1  dyoung  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
     17  1.1  dyoung  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     18  1.1  dyoung  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
     19  1.1  dyoung  * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR
     20  1.1  dyoung  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
     21  1.1  dyoung  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     22  1.1  dyoung  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
     23  1.1  dyoung  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24  1.1  dyoung  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
     25  1.1  dyoung  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
     26  1.1  dyoung  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
     27  1.1  dyoung  * OF SUCH DAMAGE.
     28  1.1  dyoung  */
     29  1.1  dyoung #ifndef _ADM5120_EXTIOVAR_H_
     30  1.1  dyoung #define _ADM5120_EXTIOVAR_H_
     31  1.1  dyoung 
     32  1.2  dyoung #include <sys/device.h>
     33  1.1  dyoung #include <sys/types.h>
     34  1.1  dyoung #include <sys/gpio.h>
     35  1.1  dyoung #include <sys/ioctl.h>
     36  1.1  dyoung #include <dev/gpio/gpiovar.h>
     37  1.1  dyoung 
     38  1.1  dyoung struct extio_attach_args {
     39  1.1  dyoung 	const char	*ea_name;	/* name of device */
     40  1.1  dyoung 	bus_space_tag_t	ea_st;
     41  1.1  dyoung 	bus_addr_t	ea_addr;	/* address of device */
     42  1.1  dyoung 	int		ea_irq;		/* interrupt bit # */
     43  1.1  dyoung 	void		*ea_gpio;
     44  1.1  dyoung 	int		ea_gpio_offset;
     45  1.1  dyoung 	uint32_t	ea_gpio_mask;
     46  1.1  dyoung 	int		ea_cfio;
     47  1.1  dyoung };
     48  1.1  dyoung 
     49  1.1  dyoung struct extio_softc {
     50  1.4     chs 	device_t		sc_dev;
     51  1.1  dyoung 	bus_space_tag_t		sc_obiot;
     52  1.1  dyoung 	bus_space_handle_t	sc_gpioh;
     53  1.1  dyoung 	bus_space_handle_t	sc_mpmch;
     54  1.1  dyoung 	device_t		sc_gpio;
     55  1.1  dyoung 	int			sc_map[5];
     56  1.1  dyoung 	struct gpio_pinmap	sc_pm;
     57  1.1  dyoung 	struct mips_bus_space	sc_cfio;
     58  1.1  dyoung };
     59  1.1  dyoung 
     60  1.1  dyoung void cfio_bus_mem_init(bus_space_tag_t, bus_space_tag_t);
     61  1.1  dyoung void extio_bus_mem_init(bus_space_tag_t, void *);
     62  1.1  dyoung 
     63  1.1  dyoung #endif /* _ADM5120_EXTIOVAR_H_ */
     64