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
14struct host1x_syncpt;
15struct host1x;
16
17enum 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
39struct 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
46struct 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
68int 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
79void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref,
80 bool flush);
81
82
83int host1x_intr_init(struct host1x *host, unsigned int irq_sync);
84
85
86void host1x_intr_deinit(struct host1x *host);
87
88
89void host1x_intr_start(struct host1x *host);
90
91
92void host1x_intr_stop(struct host1x *host);
93
94irqreturn_t host1x_syncpt_thresh_fn(void *dev_id);
95#endif
96