1 | #include <machine/rtems-bsd-kernel-space.h> |
---|
2 | |
---|
3 | /* |
---|
4 | * This file is produced automatically. |
---|
5 | * Do not modify anything in here by hand. |
---|
6 | * |
---|
7 | * Created from source file |
---|
8 | * freebsd-org/sys/dev/gpio/gpio_if.m |
---|
9 | * with |
---|
10 | * makeobjops.awk |
---|
11 | * |
---|
12 | * See the source file for legal information |
---|
13 | */ |
---|
14 | |
---|
15 | #include <sys/param.h> |
---|
16 | #include <sys/queue.h> |
---|
17 | #include <sys/kernel.h> |
---|
18 | #include <sys/kobj.h> |
---|
19 | #include <sys/bus.h> |
---|
20 | #include <sys/gpio.h> |
---|
21 | #include <rtems/bsd/local/gpio_if.h> |
---|
22 | |
---|
23 | |
---|
24 | static device_t |
---|
25 | gpio_default_get_bus(void) |
---|
26 | { |
---|
27 | |
---|
28 | return (NULL); |
---|
29 | } |
---|
30 | |
---|
31 | static int |
---|
32 | gpio_default_map_gpios(device_t bus, phandle_t dev, |
---|
33 | phandle_t gparent, int gcells, pcell_t *gpios, uint32_t *pin, |
---|
34 | uint32_t *flags) |
---|
35 | { |
---|
36 | /* Propagate up the bus hierarchy until someone handles it. */ |
---|
37 | if (device_get_parent(bus) != NULL) |
---|
38 | return (GPIO_MAP_GPIOS(device_get_parent(bus), dev, |
---|
39 | gparent, gcells, gpios, pin, flags)); |
---|
40 | |
---|
41 | /* If that fails, then assume the FreeBSD defaults. */ |
---|
42 | *pin = gpios[0]; |
---|
43 | if (gcells == 2 || gcells == 3) |
---|
44 | *flags = gpios[gcells - 1]; |
---|
45 | |
---|
46 | return (0); |
---|
47 | } |
---|
48 | |
---|
49 | struct kobjop_desc gpio_get_bus_desc = { |
---|
50 | 0, { &gpio_get_bus_desc, (kobjop_t)gpio_default_get_bus } |
---|
51 | }; |
---|
52 | |
---|
53 | struct kobjop_desc gpio_pin_max_desc = { |
---|
54 | 0, { &gpio_pin_max_desc, (kobjop_t)kobj_error_method } |
---|
55 | }; |
---|
56 | |
---|
57 | struct kobjop_desc gpio_pin_set_desc = { |
---|
58 | 0, { &gpio_pin_set_desc, (kobjop_t)kobj_error_method } |
---|
59 | }; |
---|
60 | |
---|
61 | struct kobjop_desc gpio_pin_get_desc = { |
---|
62 | 0, { &gpio_pin_get_desc, (kobjop_t)kobj_error_method } |
---|
63 | }; |
---|
64 | |
---|
65 | struct kobjop_desc gpio_pin_toggle_desc = { |
---|
66 | 0, { &gpio_pin_toggle_desc, (kobjop_t)kobj_error_method } |
---|
67 | }; |
---|
68 | |
---|
69 | struct kobjop_desc gpio_pin_getcaps_desc = { |
---|
70 | 0, { &gpio_pin_getcaps_desc, (kobjop_t)kobj_error_method } |
---|
71 | }; |
---|
72 | |
---|
73 | struct kobjop_desc gpio_pin_getflags_desc = { |
---|
74 | 0, { &gpio_pin_getflags_desc, (kobjop_t)kobj_error_method } |
---|
75 | }; |
---|
76 | |
---|
77 | struct kobjop_desc gpio_pin_getname_desc = { |
---|
78 | 0, { &gpio_pin_getname_desc, (kobjop_t)kobj_error_method } |
---|
79 | }; |
---|
80 | |
---|
81 | struct kobjop_desc gpio_pin_setflags_desc = { |
---|
82 | 0, { &gpio_pin_setflags_desc, (kobjop_t)kobj_error_method } |
---|
83 | }; |
---|
84 | |
---|
85 | struct kobjop_desc gpio_map_gpios_desc = { |
---|
86 | 0, { &gpio_map_gpios_desc, (kobjop_t)gpio_default_map_gpios } |
---|
87 | }; |
---|
88 | |
---|