|
6 | 6 | * Copyright (c) 2010-2013, NVIDIA Corporation. |
7 | 7 | */ |
8 | 8 |
|
9 | | -#include <linux/interrupt.h> |
10 | | -#include <linux/irq.h> |
11 | 9 | #include <linux/io.h> |
12 | 10 |
|
13 | 11 | #include "../intr.h" |
14 | 12 | #include "../dev.h" |
15 | 13 |
|
16 | | -struct host1x_intr_irq_data { |
17 | | - struct host1x *host; |
18 | | - u32 offset; |
19 | | -}; |
20 | | - |
21 | 14 | static irqreturn_t syncpt_thresh_isr(int irq, void *dev_id) |
22 | 15 | { |
23 | 16 | struct host1x_intr_irq_data *irq_data = dev_id; |
@@ -54,7 +47,8 @@ static void host1x_intr_disable_all_syncpt_intrs(struct host1x *host) |
54 | 47 | } |
55 | 48 | } |
56 | 49 |
|
57 | | -static void intr_hw_init(struct host1x *host, u32 cpm) |
| 50 | +static int |
| 51 | +host1x_intr_init_host_sync(struct host1x *host, u32 cpm) |
58 | 52 | { |
59 | 53 | #if HOST1X_HW < 6 |
60 | 54 | /* disable the ip_busy_timeout. this prevents write drops */ |
@@ -85,32 +79,6 @@ static void intr_hw_init(struct host1x *host, u32 cpm) |
85 | 79 | host1x_sync_writel(host, irq_index, HOST1X_SYNC_SYNCPT_INTR_DEST(id)); |
86 | 80 | } |
87 | 81 | #endif |
88 | | -} |
89 | | - |
90 | | -static int |
91 | | -host1x_intr_init_host_sync(struct host1x *host, u32 cpm) |
92 | | -{ |
93 | | - int err, i; |
94 | | - struct host1x_intr_irq_data *irq_data; |
95 | | - |
96 | | - irq_data = devm_kcalloc(host->dev, host->num_syncpt_irqs, sizeof(irq_data[0]), GFP_KERNEL); |
97 | | - if (!irq_data) |
98 | | - return -ENOMEM; |
99 | | - |
100 | | - host1x_hw_intr_disable_all_syncpt_intrs(host); |
101 | | - |
102 | | - for (i = 0; i < host->num_syncpt_irqs; i++) { |
103 | | - irq_data[i].host = host; |
104 | | - irq_data[i].offset = i; |
105 | | - |
106 | | - err = devm_request_irq(host->dev, host->syncpt_irqs[i], |
107 | | - syncpt_thresh_isr, IRQF_SHARED, |
108 | | - "host1x_syncpt", &irq_data[i]); |
109 | | - if (err < 0) |
110 | | - return err; |
111 | | - } |
112 | | - |
113 | | - intr_hw_init(host, cpm); |
114 | 82 |
|
115 | 83 | return 0; |
116 | 84 | } |
@@ -144,4 +112,5 @@ static const struct host1x_intr_ops host1x_intr_ops = { |
144 | 112 | .enable_syncpt_intr = host1x_intr_enable_syncpt_intr, |
145 | 113 | .disable_syncpt_intr = host1x_intr_disable_syncpt_intr, |
146 | 114 | .disable_all_syncpt_intrs = host1x_intr_disable_all_syncpt_intrs, |
| 115 | + .isr = syncpt_thresh_isr, |
147 | 116 | }; |
0 commit comments