1 | /* |
---|
2 | * This file is produced automatically. |
---|
3 | * Do not modify anything in here by hand. |
---|
4 | * |
---|
5 | * Created from source file |
---|
6 | * freebsd-org/sys/dev/gpio/gpio_if.m |
---|
7 | * with |
---|
8 | * makeobjops.awk |
---|
9 | * |
---|
10 | * See the source file for legal information |
---|
11 | */ |
---|
12 | |
---|
13 | |
---|
14 | #ifndef _gpio_if_h_ |
---|
15 | #define _gpio_if_h_ |
---|
16 | |
---|
17 | |
---|
18 | #include <dev/ofw/openfirm.h> |
---|
19 | |
---|
20 | /** @brief Unique descriptor for the GPIO_GET_BUS() method */ |
---|
21 | extern struct kobjop_desc gpio_get_bus_desc; |
---|
22 | /** @brief A function implementing the GPIO_GET_BUS() method */ |
---|
23 | typedef device_t gpio_get_bus_t(device_t dev); |
---|
24 | |
---|
25 | static __inline device_t GPIO_GET_BUS(device_t dev) |
---|
26 | { |
---|
27 | kobjop_t _m; |
---|
28 | KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_get_bus); |
---|
29 | return ((gpio_get_bus_t *) _m)(dev); |
---|
30 | } |
---|
31 | |
---|
32 | /** @brief Unique descriptor for the GPIO_PIN_MAX() method */ |
---|
33 | extern struct kobjop_desc gpio_pin_max_desc; |
---|
34 | /** @brief A function implementing the GPIO_PIN_MAX() method */ |
---|
35 | typedef int gpio_pin_max_t(device_t dev, int *maxpin); |
---|
36 | |
---|
37 | static __inline int GPIO_PIN_MAX(device_t dev, int *maxpin) |
---|
38 | { |
---|
39 | kobjop_t _m; |
---|
40 | KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_max); |
---|
41 | return ((gpio_pin_max_t *) _m)(dev, maxpin); |
---|
42 | } |
---|
43 | |
---|
44 | /** @brief Unique descriptor for the GPIO_PIN_SET() method */ |
---|
45 | extern struct kobjop_desc gpio_pin_set_desc; |
---|
46 | /** @brief A function implementing the GPIO_PIN_SET() method */ |
---|
47 | typedef int gpio_pin_set_t(device_t dev, uint32_t pin_num, uint32_t pin_value); |
---|
48 | |
---|
49 | static __inline int GPIO_PIN_SET(device_t dev, uint32_t pin_num, |
---|
50 | uint32_t pin_value) |
---|
51 | { |
---|
52 | kobjop_t _m; |
---|
53 | KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_set); |
---|
54 | return ((gpio_pin_set_t *) _m)(dev, pin_num, pin_value); |
---|
55 | } |
---|
56 | |
---|
57 | /** @brief Unique descriptor for the GPIO_PIN_GET() method */ |
---|
58 | extern struct kobjop_desc gpio_pin_get_desc; |
---|
59 | /** @brief A function implementing the GPIO_PIN_GET() method */ |
---|
60 | typedef int gpio_pin_get_t(device_t dev, uint32_t pin_num, uint32_t *pin_value); |
---|
61 | |
---|
62 | static __inline int GPIO_PIN_GET(device_t dev, uint32_t pin_num, |
---|
63 | uint32_t *pin_value) |
---|
64 | { |
---|
65 | kobjop_t _m; |
---|
66 | KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_get); |
---|
67 | return ((gpio_pin_get_t *) _m)(dev, pin_num, pin_value); |
---|
68 | } |
---|
69 | |
---|
70 | /** @brief Unique descriptor for the GPIO_PIN_TOGGLE() method */ |
---|
71 | extern struct kobjop_desc gpio_pin_toggle_desc; |
---|
72 | /** @brief A function implementing the GPIO_PIN_TOGGLE() method */ |
---|
73 | typedef int gpio_pin_toggle_t(device_t dev, uint32_t pin_num); |
---|
74 | |
---|
75 | static __inline int GPIO_PIN_TOGGLE(device_t dev, uint32_t pin_num) |
---|
76 | { |
---|
77 | kobjop_t _m; |
---|
78 | KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_toggle); |
---|
79 | return ((gpio_pin_toggle_t *) _m)(dev, pin_num); |
---|
80 | } |
---|
81 | |
---|
82 | /** @brief Unique descriptor for the GPIO_PIN_GETCAPS() method */ |
---|
83 | extern struct kobjop_desc gpio_pin_getcaps_desc; |
---|
84 | /** @brief A function implementing the GPIO_PIN_GETCAPS() method */ |
---|
85 | typedef int gpio_pin_getcaps_t(device_t dev, uint32_t pin_num, uint32_t *caps); |
---|
86 | |
---|
87 | static __inline int GPIO_PIN_GETCAPS(device_t dev, uint32_t pin_num, |
---|
88 | uint32_t *caps) |
---|
89 | { |
---|
90 | kobjop_t _m; |
---|
91 | KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_getcaps); |
---|
92 | return ((gpio_pin_getcaps_t *) _m)(dev, pin_num, caps); |
---|
93 | } |
---|
94 | |
---|
95 | /** @brief Unique descriptor for the GPIO_PIN_GETFLAGS() method */ |
---|
96 | extern struct kobjop_desc gpio_pin_getflags_desc; |
---|
97 | /** @brief A function implementing the GPIO_PIN_GETFLAGS() method */ |
---|
98 | typedef int gpio_pin_getflags_t(device_t dev, uint32_t pin_num, |
---|
99 | uint32_t *flags); |
---|
100 | |
---|
101 | static __inline int GPIO_PIN_GETFLAGS(device_t dev, uint32_t pin_num, |
---|
102 | uint32_t *flags) |
---|
103 | { |
---|
104 | kobjop_t _m; |
---|
105 | KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_getflags); |
---|
106 | return ((gpio_pin_getflags_t *) _m)(dev, pin_num, flags); |
---|
107 | } |
---|
108 | |
---|
109 | /** @brief Unique descriptor for the GPIO_PIN_GETNAME() method */ |
---|
110 | extern struct kobjop_desc gpio_pin_getname_desc; |
---|
111 | /** @brief A function implementing the GPIO_PIN_GETNAME() method */ |
---|
112 | typedef int gpio_pin_getname_t(device_t dev, uint32_t pin_num, char *name); |
---|
113 | |
---|
114 | static __inline int GPIO_PIN_GETNAME(device_t dev, uint32_t pin_num, char *name) |
---|
115 | { |
---|
116 | kobjop_t _m; |
---|
117 | KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_getname); |
---|
118 | return ((gpio_pin_getname_t *) _m)(dev, pin_num, name); |
---|
119 | } |
---|
120 | |
---|
121 | /** @brief Unique descriptor for the GPIO_PIN_SETFLAGS() method */ |
---|
122 | extern struct kobjop_desc gpio_pin_setflags_desc; |
---|
123 | /** @brief A function implementing the GPIO_PIN_SETFLAGS() method */ |
---|
124 | typedef int gpio_pin_setflags_t(device_t dev, uint32_t pin_num, uint32_t flags); |
---|
125 | |
---|
126 | static __inline int GPIO_PIN_SETFLAGS(device_t dev, uint32_t pin_num, |
---|
127 | uint32_t flags) |
---|
128 | { |
---|
129 | kobjop_t _m; |
---|
130 | KOBJOPLOOKUP(((kobj_t)dev)->ops,gpio_pin_setflags); |
---|
131 | return ((gpio_pin_setflags_t *) _m)(dev, pin_num, flags); |
---|
132 | } |
---|
133 | |
---|
134 | /** @brief Unique descriptor for the GPIO_MAP_GPIOS() method */ |
---|
135 | extern struct kobjop_desc gpio_map_gpios_desc; |
---|
136 | /** @brief A function implementing the GPIO_MAP_GPIOS() method */ |
---|
137 | typedef int gpio_map_gpios_t(device_t bus, phandle_t dev, phandle_t gparent, |
---|
138 | int gcells, pcell_t *gpios, uint32_t *pin, |
---|
139 | uint32_t *flags); |
---|
140 | |
---|
141 | static __inline int GPIO_MAP_GPIOS(device_t bus, phandle_t dev, |
---|
142 | phandle_t gparent, int gcells, |
---|
143 | pcell_t *gpios, uint32_t *pin, |
---|
144 | uint32_t *flags) |
---|
145 | { |
---|
146 | kobjop_t _m; |
---|
147 | KOBJOPLOOKUP(((kobj_t)bus)->ops,gpio_map_gpios); |
---|
148 | return ((gpio_map_gpios_t *) _m)(bus, dev, gparent, gcells, gpios, pin, flags); |
---|
149 | } |
---|
150 | |
---|
151 | #endif /* _gpio_if_h_ */ |
---|