1 1.2 matt /* $NetBSD: adm5120_mainbusvar.h,v 1.2 2011/02/20 07:48:35 matt Exp $ */ 2 1.1 dyoung 3 1.1 dyoung /*- 4 1.1 dyoung * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko. 5 1.1 dyoung * All rights reserved. 6 1.1 dyoung * 7 1.1 dyoung * Redistribution and use in source and binary forms, with or 8 1.1 dyoung * without modification, are permitted provided that the following 9 1.1 dyoung * conditions are met: 10 1.1 dyoung * 1. Redistributions of source code must retain the above copyright 11 1.1 dyoung * notice, this list of conditions and the following disclaimer. 12 1.1 dyoung * 2. Redistributions in binary form must reproduce the above 13 1.1 dyoung * copyright notice, this list of conditions and the following 14 1.1 dyoung * disclaimer in the documentation and/or other materials provided 15 1.1 dyoung * with the distribution. 16 1.1 dyoung * 3. The names of the authors may not be used to endorse or promote 17 1.1 dyoung * products derived from this software without specific prior 18 1.1 dyoung * written permission. 19 1.1 dyoung * 20 1.1 dyoung * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY 21 1.1 dyoung * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 1.1 dyoung * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 23 1.1 dyoung * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS 24 1.1 dyoung * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 25 1.1 dyoung * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 1.1 dyoung * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 27 1.1 dyoung * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 1.1 dyoung * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 29 1.1 dyoung * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 30 1.1 dyoung * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 1.1 dyoung * OF SUCH DAMAGE. 32 1.1 dyoung */ 33 1.1 dyoung 34 1.1 dyoung #ifndef _ADM5120_MAINBUSVAR_H_ 35 1.1 dyoung #define _ADM5120_MAINBUSVAR_H_ 36 1.1 dyoung 37 1.1 dyoung #include <sys/types.h> 38 1.1 dyoung #include <sys/gpio.h> 39 1.1 dyoung #include <sys/ioctl.h> 40 1.1 dyoung #include <dev/gpio/gpiovar.h> 41 1.1 dyoung 42 1.1 dyoung struct mainbus_attach_args { 43 1.1 dyoung const char *ma_name; /* name of device */ 44 1.1 dyoung bus_dma_tag_t ma_dmat; 45 1.1 dyoung bus_space_tag_t ma_obiot; 46 1.1 dyoung bus_space_handle_t ma_gpioh; 47 1.1 dyoung void *ma_gpio; 48 1.1 dyoung int ma_gpio_offset; 49 1.1 dyoung uint32_t ma_gpio_mask; 50 1.1 dyoung }; 51 1.1 dyoung 52 1.1 dyoung struct mainbus_softc { 53 1.2 matt device_t sc_dev; 54 1.1 dyoung bus_space_tag_t sc_obiot; 55 1.1 dyoung bus_space_handle_t sc_gpioh; 56 1.1 dyoung struct gpio_chipset_tag sc_gp; 57 1.1 dyoung gpio_pin_t sc_pins[8]; 58 1.1 dyoung device_t sc_gpio; 59 1.1 dyoung }; 60 1.1 dyoung 61 1.1 dyoung device_t admgpio_attach(struct mainbus_softc *); 62 1.1 dyoung 63 1.1 dyoung #endif /* _ADM5120_MAINBUSVAR_H_ */ 64