aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x/hw/intr_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/host1x/hw/intr_hw.c')
-rw-r--r--drivers/gpu/host1x/hw/intr_hw.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/gpu/host1x/hw/intr_hw.c b/drivers/gpu/host1x/hw/intr_hw.c
index e1e31e9e67cd..dacb8009a605 100644
--- a/drivers/gpu/host1x/hw/intr_hw.c
+++ b/drivers/gpu/host1x/hw/intr_hw.c
@@ -38,14 +38,14 @@ static void host1x_intr_syncpt_handle(struct host1x_syncpt *syncpt)
38 host1x_sync_writel(host, BIT_MASK(id), 38 host1x_sync_writel(host, BIT_MASK(id),
39 HOST1X_SYNC_SYNCPT_THRESH_CPU0_INT_STATUS(BIT_WORD(id))); 39 HOST1X_SYNC_SYNCPT_THRESH_CPU0_INT_STATUS(BIT_WORD(id)));
40 40
41 queue_work(host->intr_wq, &syncpt->intr.work); 41 schedule_work(&syncpt->intr.work);
42} 42}
43 43
44static irqreturn_t syncpt_thresh_isr(int irq, void *dev_id) 44static irqreturn_t syncpt_thresh_isr(int irq, void *dev_id)
45{ 45{
46 struct host1x *host = dev_id; 46 struct host1x *host = dev_id;
47 unsigned long reg; 47 unsigned long reg;
48 int i, id; 48 unsigned int i, id;
49 49
50 for (i = 0; i < DIV_ROUND_UP(host->info->nb_pts, 32); i++) { 50 for (i = 0; i < DIV_ROUND_UP(host->info->nb_pts, 32); i++) {
51 reg = host1x_sync_readl(host, 51 reg = host1x_sync_readl(host,
@@ -62,7 +62,7 @@ static irqreturn_t syncpt_thresh_isr(int irq, void *dev_id)
62 62
63static void _host1x_intr_disable_all_syncpt_intrs(struct host1x *host) 63static void _host1x_intr_disable_all_syncpt_intrs(struct host1x *host)
64{ 64{
65 u32 i; 65 unsigned int i;
66 66
67 for (i = 0; i < DIV_ROUND_UP(host->info->nb_pts, 32); ++i) { 67 for (i = 0; i < DIV_ROUND_UP(host->info->nb_pts, 32); ++i) {
68 host1x_sync_writel(host, 0xffffffffu, 68 host1x_sync_writel(host, 0xffffffffu,
@@ -72,10 +72,12 @@ static void _host1x_intr_disable_all_syncpt_intrs(struct host1x *host)
72 } 72 }
73} 73}
74 74
75static int _host1x_intr_init_host_sync(struct host1x *host, u32 cpm, 75static int
76 void (*syncpt_thresh_work)(struct work_struct *)) 76_host1x_intr_init_host_sync(struct host1x *host, u32 cpm,
77 void (*syncpt_thresh_work)(struct work_struct *))
77{ 78{
78 int i, err; 79 unsigned int i;
80 int err;
79 81
80 host1x_hw_intr_disable_all_syncpt_intrs(host); 82 host1x_hw_intr_disable_all_syncpt_intrs(host);
81 83
@@ -106,18 +108,21 @@ static int _host1x_intr_init_host_sync(struct host1x *host, u32 cpm,
106} 108}
107 109
108static void _host1x_intr_set_syncpt_threshold(struct host1x *host, 110static void _host1x_intr_set_syncpt_threshold(struct host1x *host,
109 u32 id, u32 thresh) 111 unsigned int id,
112 u32 thresh)
110{ 113{
111 host1x_sync_writel(host, thresh, HOST1X_SYNC_SYNCPT_INT_THRESH(id)); 114 host1x_sync_writel(host, thresh, HOST1X_SYNC_SYNCPT_INT_THRESH(id));
112} 115}
113 116
114static void _host1x_intr_enable_syncpt_intr(struct host1x *host, u32 id) 117static void _host1x_intr_enable_syncpt_intr(struct host1x *host,
118 unsigned int id)
115{ 119{
116 host1x_sync_writel(host, BIT_MASK(id), 120 host1x_sync_writel(host, BIT_MASK(id),
117 HOST1X_SYNC_SYNCPT_THRESH_INT_ENABLE_CPU0(BIT_WORD(id))); 121 HOST1X_SYNC_SYNCPT_THRESH_INT_ENABLE_CPU0(BIT_WORD(id)));
118} 122}
119 123
120static void _host1x_intr_disable_syncpt_intr(struct host1x *host, u32 id) 124static void _host1x_intr_disable_syncpt_intr(struct host1x *host,
125 unsigned int id)
121{ 126{
122 host1x_sync_writel(host, BIT_MASK(id), 127 host1x_sync_writel(host, BIT_MASK(id),
123 HOST1X_SYNC_SYNCPT_THRESH_INT_DISABLE(BIT_WORD(id))); 128 HOST1X_SYNC_SYNCPT_THRESH_INT_DISABLE(BIT_WORD(id)));
@@ -127,8 +132,13 @@ static void _host1x_intr_disable_syncpt_intr(struct host1x *host, u32 id)
127 132
128static int _host1x_free_syncpt_irq(struct host1x *host) 133static int _host1x_free_syncpt_irq(struct host1x *host)
129{ 134{
135 unsigned int i;
136
130 devm_free_irq(host->dev, host->intr_syncpt_irq, host); 137 devm_free_irq(host->dev, host->intr_syncpt_irq, host);
131 flush_workqueue(host->intr_wq); 138
139 for (i = 0; i < host->info->nb_pts; i++)
140 cancel_work_sync(&host->syncpt[i].intr.work);
141
132 return 0; 142 return 0;
133} 143}
134 144