0001
0002
0003
0004
0005
0006
0007
0008 #ifndef __HOST1X_INTR_H
0009 #define __HOST1X_INTR_H
0010
0011 #include <linux/interrupt.h>
0012 #include <linux/workqueue.h>
0013
0014 struct host1x_syncpt;
0015 struct host1x;
0016
0017 enum host1x_intr_action {
0018
0019
0020
0021
0022 HOST1X_INTR_ACTION_SUBMIT_COMPLETE = 0,
0023
0024
0025
0026
0027
0028 HOST1X_INTR_ACTION_WAKEUP,
0029
0030
0031
0032
0033
0034 HOST1X_INTR_ACTION_WAKEUP_INTERRUPTIBLE,
0035
0036 HOST1X_INTR_ACTION_SIGNAL_FENCE,
0037
0038 HOST1X_INTR_ACTION_COUNT
0039 };
0040
0041 struct host1x_syncpt_intr {
0042 spinlock_t lock;
0043 struct list_head wait_head;
0044 char thresh_irq_name[12];
0045 struct work_struct work;
0046 };
0047
0048 struct host1x_waitlist {
0049 struct list_head list;
0050 struct kref refcount;
0051 u32 thresh;
0052 enum host1x_intr_action action;
0053 atomic_t state;
0054 void *data;
0055 int count;
0056 };
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070 int host1x_intr_add_action(struct host1x *host, struct host1x_syncpt *syncpt,
0071 u32 thresh, enum host1x_intr_action action,
0072 void *data, struct host1x_waitlist *waiter,
0073 void **ref);
0074
0075
0076
0077
0078
0079
0080
0081 void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref,
0082 bool flush);
0083
0084
0085 int host1x_intr_init(struct host1x *host, unsigned int irq_sync);
0086
0087
0088 void host1x_intr_deinit(struct host1x *host);
0089
0090
0091 void host1x_intr_start(struct host1x *host);
0092
0093
0094 void host1x_intr_stop(struct host1x *host);
0095
0096 irqreturn_t host1x_syncpt_thresh_fn(void *dev_id);
0097 #endif