added a lot of printk output to ease writing of emulator
[linux-2.4.21-pre4.git] / include / linux / ibm_ocp_gpio.h
1 /*
2  * FILE NAME ibm_ocp_gpio.h
3  *
4  * BRIEF MODULE DESCRIPTION
5  *      Generic gpio.
6  *
7  *  Armin Kuster akuster@pacbell.net
8  *  Sept, 2001
9  *
10  *  Orignial driver
11  *  Author: MontaVista Software, Inc.  <source@mvista.com>
12  *          Frank Rowand <frank_rowand@mvista.com>
13  *
14  * Copyright 2000 MontaVista Software Inc.
15  *
16  *  This program is free software; you can redistribute  it and/or modify it
17  *  under  the terms of  the GNU General  Public License as published by the
18  *  Free Software Foundation;  either version 2 of the  License, or (at your
19  *  option) any later version.
20  *
21  *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
22  *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
23  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
24  *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
25  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26  *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
27  *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28  *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
29  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30  *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  *  You should have received a copy of the  GNU General Public License along
33  *  with this program; if not, write  to the Free Software Foundation, Inc.,
34  *  675 Mass Ave, Cambridge, MA 02139, USA.
35  */
36
37 #ifndef __IBM_OCP_GPIO_H
38 #define __IBM_OCP_GPIO_H
39
40 #include <linux/ioctl.h>
41 #include <linux/types.h>
42
43 #define IBMGPIO_IOCTL_BASE      'Z'
44
45 struct ibm_gpio_ioctl_data {
46         __u32 device;
47         __u32 mask;
48         __u32 data;
49 };
50
51 #define GPIO_MINOR             185
52 #define IBMGPIO_IN              _IOWR(IBMGPIO_IOCTL_BASE, 0, struct ibm_gpio_ioctl_data)
53 #define IBMGPIO_OUT             _IOW (IBMGPIO_IOCTL_BASE, 1, struct ibm_gpio_ioctl_data)
54 #define IBMGPIO_OPEN_DRAIN      _IOW (IBMGPIO_IOCTL_BASE, 2, struct ibm_gpio_ioctl_data)
55 #define IBMGPIO_TRISTATE        _IOW (IBMGPIO_IOCTL_BASE, 3, struct ibm_gpio_ioctl_data)
56 #define IBMGPIO_CFG             _IOW (IBMGPIO_IOCTL_BASE, 4, struct ibm_gpio_ioctl_data)
57
58 #endif