1
2
3
4
5
6
7
8 #ifndef __HOST1X_INTR_H
9 #define __HOST1X_INTR_H
10
11 #include <linux/interrupt.h>
12 #include <linux/workqueue.h>
13
14 struct host1x_syncpt;
15 struct host1x;
16
17 enum host1x_intr_action {
18
19
20
21
22 HOST1X_INTR_ACTION_SUBMIT_COMPLETE = 0,
23
24
25
26
27
28 HOST1X_INTR_ACTION_WAKEUP,
29
30
31
32
33
34 HOST1X_INTR_ACTION_WAKEUP_INTERRUPTIBLE,
35
36 HOST1X_INTR_ACTION_COUNT
37 };
38
39 struct host1x_syncpt_intr {
40 spinlock_t lock;
41 struct list_head wait_head;
42 char thresh_irq_name[12];
43 struct work_struct work;
44 };
45
46 struct host1x_waitlist {
47 struct list_head list;
48 struct kref refcount;
49 u32 thresh;
50 enum host1x_intr_action action;
51 atomic_t state;
52 void *data;
53 int count;
54 };
55
56
57
58
59
60
61
62
63
64
65
66
67
68 int host1x_intr_add_action(struct host1x *host, struct host1x_syncpt *syncpt,
69 u32 thresh, enum host1x_intr_action action,
70 void *data, struct host1x_waitlist *waiter,
71 void **ref);
72
73
74
75
76
77
78 void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref);
79
80
81 int host1x_intr_init(struct host1x *host, unsigned int irq_sync);
82
83
84 void host1x_intr_deinit(struct host1x *host);
85
86
87 void host1x_intr_start(struct host1x *host);
88
89
90 void host1x_intr_stop(struct host1x *host);
91
92 irqreturn_t host1x_syncpt_thresh_fn(void *dev_id);
93 #endif