Xenomai  3.1
gpio.h
1 
18 #ifndef _COBALT_RTDM_GPIO_H
19 #define _COBALT_RTDM_GPIO_H
20 
21 #include <linux/list.h>
22 #include <rtdm/driver.h>
23 #include <rtdm/uapi/gpio.h>
24 
25 struct class;
26 struct device_node;
27 struct gpio_desc;
28 
29 struct rtdm_gpio_pin {
30  struct rtdm_device dev;
31  struct list_head next;
32  rtdm_irq_t irqh;
33  rtdm_event_t event;
34  char *name;
35  struct gpio_desc *desc;
36  nanosecs_abs_t timestamp;
37 };
38 
39 struct rtdm_gpio_chip {
40  struct gpio_chip *gc;
41  struct rtdm_driver driver;
42  struct class *devclass;
43  struct list_head next;
44  rtdm_lock_t lock;
45  struct rtdm_gpio_pin pins[0];
46 };
47 
48 int rtdm_gpiochip_add(struct rtdm_gpio_chip *rgc,
49  struct gpio_chip *gc,
50  int gpio_subclass);
51 
52 struct rtdm_gpio_chip *
53 rtdm_gpiochip_alloc(struct gpio_chip *gc,
54  int gpio_subclass);
55 
56 void rtdm_gpiochip_remove(struct rtdm_gpio_chip *rgc);
57 
58 int rtdm_gpiochip_add_by_name(struct rtdm_gpio_chip *rgc,
59  const char *label, int gpio_subclass);
60 
61 int rtdm_gpiochip_post_event(struct rtdm_gpio_chip *rgc,
62  unsigned int offset);
63 
64 #ifdef CONFIG_OF
65 
66 int rtdm_gpiochip_scan_of(struct device_node *from,
67  const char *compat, int type);
68 
69 int rtdm_gpiochip_scan_array_of(struct device_node *from,
70  const char *compat[],
71  int nentries, int type);
72 
73 void rtdm_gpiochip_remove_of(int type);
74 
75 #endif
76 
77 #endif /* !_COBALT_RTDM_GPIO_H */
ipipe_spinlock_t rtdm_lock_t
Lock variable.
Definition: driver.h:551
Real-Time Driver Model for Xenomai, driver API header.
uint64_t nanosecs_abs_t
RTDM type for representing absolute dates.
Definition: rtdm.h:43
RTDM device.
Definition: driver.h:338
RTDM driver.
Definition: driver.h:249