4 * Copyright (c) 2007 Embedtronics Oy. All rights reserved.
6 * Based on arch/arm/ep93xx/epgiovar.h
7 * Copyright (c) 2005 HAMAJIMA Katsuomi. All rights reserved.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 #ifndef _AT91PIOVAR_H_
32 #define _AT91PIOVAR_H_
44 AT91_PIO_INVALID
= AT91_PIO_COUNT
49 struct at91pio_softc
*at91pio_sc(at91pio_port
);
51 int at91pio_read(struct at91pio_softc
*, int bit
);
52 void at91pio_set(struct at91pio_softc
*, int bit
);
53 void at91pio_clear(struct at91pio_softc
*, int bit
);
54 void at91pio_in(struct at91pio_softc
*, int bit
);
55 void at91pio_out(struct at91pio_softc
*, int bit
);
56 void at91pio_per(struct at91pio_softc
*, int bit
, int perab
);
58 void *at91pio_intr_establish(struct at91pio_softc
*,int bit
,
59 int ipl
, int (*)(void *), void *);
60 void at91pio_intr_disestablish(struct at91pio_softc
*,int bit
,
63 struct at91pio_attach_args
{
64 struct at91pio_softc
*paa_sc
;
65 bus_space_tag_t paa_iot
; /* Bus tag */
66 bus_addr_t paa_addr
; /* i/o address */
67 int paa_pid
; /* peripheral id */
68 int paa_bit
; /* pin number */
71 #endif /* _AT91PIOVAR_H_ */