sunxi_gpio.h revision 1.11 1 1.11 skrll /* $NetBSD: sunxi_gpio.h,v 1.11 2024/08/13 07:20:23 skrll Exp $ */
2 1.1 jmcneill
3 1.1 jmcneill /*-
4 1.1 jmcneill * Copyright (c) 2017 Jared McNeill <jmcneill (at) invisible.ca>
5 1.1 jmcneill * Copyright (c) 2016 Emmanuel Vadot <manu (at) bidouilliste.com>
6 1.1 jmcneill * All rights reserved.
7 1.1 jmcneill *
8 1.1 jmcneill * Redistribution and use in source and binary forms, with or without
9 1.1 jmcneill * modification, are permitted provided that the following conditions
10 1.1 jmcneill * are met:
11 1.1 jmcneill * 1. Redistributions of source code must retain the above copyright
12 1.1 jmcneill * notice, this list of conditions and the following disclaimer.
13 1.1 jmcneill * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 jmcneill * notice, this list of conditions and the following disclaimer in the
15 1.1 jmcneill * documentation and/or other materials provided with the distribution.
16 1.1 jmcneill *
17 1.1 jmcneill * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 1.1 jmcneill * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 1.1 jmcneill * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 1.1 jmcneill * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 1.1 jmcneill * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 1.1 jmcneill * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 1.1 jmcneill * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 1.1 jmcneill * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 1.1 jmcneill * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 1.1 jmcneill * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 1.1 jmcneill * SUCH DAMAGE.
28 1.1 jmcneill *
29 1.1 jmcneill * $FreeBSD$
30 1.1 jmcneill */
31 1.1 jmcneill
32 1.1 jmcneill #ifndef _ARM_SUNXI_GPIO_H
33 1.1 jmcneill #define _ARM_SUNXI_GPIO_H
34 1.1 jmcneill
35 1.1 jmcneill #include "opt_soc.h"
36 1.1 jmcneill
37 1.11 skrll #define SUNXI_GPIO_MAXFUNC 15
38 1.1 jmcneill
39 1.1 jmcneill struct sunxi_gpio_pins {
40 1.1 jmcneill const char *name;
41 1.1 jmcneill uint8_t port;
42 1.1 jmcneill uint8_t pin;
43 1.1 jmcneill const char *functions[SUNXI_GPIO_MAXFUNC];
44 1.1 jmcneill uint8_t eint_func;
45 1.1 jmcneill uint8_t eint_num;
46 1.7 jmcneill uint8_t eint_bank;
47 1.1 jmcneill };
48 1.1 jmcneill
49 1.1 jmcneill struct sunxi_gpio_padconf {
50 1.1 jmcneill uint32_t npins;
51 1.1 jmcneill const struct sunxi_gpio_pins *pins;
52 1.9 jmcneill bool has_io_bias_config;
53 1.1 jmcneill };
54 1.1 jmcneill
55 1.6 jmcneill #ifdef SOC_SUN4I_A10
56 1.6 jmcneill extern const struct sunxi_gpio_padconf sun4i_a10_padconf;
57 1.6 jmcneill #endif
58 1.6 jmcneill
59 1.5 jmcneill #ifdef SOC_SUN5I_A13
60 1.5 jmcneill extern const struct sunxi_gpio_padconf sun5i_a13_padconf;
61 1.5 jmcneill #endif
62 1.5 jmcneill
63 1.1 jmcneill #ifdef SOC_SUN6I_A31
64 1.1 jmcneill extern const struct sunxi_gpio_padconf sun6i_a31_padconf;
65 1.2 jmcneill extern const struct sunxi_gpio_padconf sun6i_a31_r_padconf;
66 1.1 jmcneill #endif
67 1.1 jmcneill
68 1.6 jmcneill #ifdef SOC_SUN7I_A20
69 1.6 jmcneill extern const struct sunxi_gpio_padconf sun7i_a20_padconf;
70 1.6 jmcneill #endif
71 1.6 jmcneill
72 1.3 jmcneill #ifdef SOC_SUN8I_A83T
73 1.3 jmcneill extern const struct sunxi_gpio_padconf sun8i_a83t_padconf;
74 1.3 jmcneill extern const struct sunxi_gpio_padconf sun8i_a83t_r_padconf;
75 1.3 jmcneill #endif
76 1.3 jmcneill
77 1.1 jmcneill #ifdef SOC_SUN8I_H3
78 1.1 jmcneill extern const struct sunxi_gpio_padconf sun8i_h3_padconf;
79 1.1 jmcneill extern const struct sunxi_gpio_padconf sun8i_h3_r_padconf;
80 1.1 jmcneill #endif
81 1.1 jmcneill
82 1.10 skrll #ifdef SOC_SUN8I_V3S
83 1.10 skrll extern const struct sunxi_gpio_padconf sun8i_v3s_padconf;
84 1.10 skrll #endif
85 1.10 skrll
86 1.7 jmcneill #ifdef SOC_SUN9I_A80
87 1.7 jmcneill extern const struct sunxi_gpio_padconf sun9i_a80_padconf;
88 1.7 jmcneill extern const struct sunxi_gpio_padconf sun9i_a80_r_padconf;
89 1.7 jmcneill #endif
90 1.7 jmcneill
91 1.11 skrll #ifdef SOC_SUN20I_D1
92 1.11 skrll extern const struct sunxi_gpio_padconf sun20i_d1_padconf;
93 1.11 skrll #endif
94 1.11 skrll
95 1.4 jmcneill #ifdef SOC_SUN50I_A64
96 1.4 jmcneill extern const struct sunxi_gpio_padconf sun50i_a64_padconf;
97 1.4 jmcneill extern const struct sunxi_gpio_padconf sun50i_a64_r_padconf;
98 1.4 jmcneill #endif
99 1.4 jmcneill
100 1.8 jmcneill #ifdef SOC_SUN50I_H6
101 1.8 jmcneill extern const struct sunxi_gpio_padconf sun50i_h6_padconf;
102 1.8 jmcneill extern const struct sunxi_gpio_padconf sun50i_h6_r_padconf;
103 1.8 jmcneill #endif
104 1.8 jmcneill
105 1.1 jmcneill #endif /* _ARM_SUNXI_GPIO_H */
106