summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-omap-pm/dss2/0074-DSS2-DISPC-clear-irqstatus-for-newly-enabled-irqs.patch
blob: fed108627a2bb83a822e09c80f77e989dcede980 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From c6aecc828455ea996ae1804f166581b6d0040e84 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Sat, 23 May 2009 18:00:00 +0300
Subject: [PATCH 074/146] DSS2: DISPC: clear irqstatus for newly enabled irqs

This fixes the problem that when requesting a new irq
we could get the isr called too early in case irqstatus
already had that irq flag on.
---
 drivers/video/omap2/dss/dispc.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index b3685b2..2471cfe 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2515,6 +2515,7 @@ int dispc_get_clock_div(struct dispc_clock_info *cinfo)
 static void _omap_dispc_set_irqs(void)
 {
 	u32 mask;
+	u32 old_mask;
 	int i;
 	struct omap_dispc_isr_data *isr_data;
 
@@ -2530,6 +2531,11 @@ static void _omap_dispc_set_irqs(void)
 	}
 
 	enable_clocks(1);
+
+	old_mask = dispc_read_reg(DISPC_IRQENABLE);
+	/* clear the irqstatus for newly enabled irqs */
+	dispc_write_reg(DISPC_IRQSTATUS, (mask ^ old_mask) & mask);
+
 	dispc_write_reg(DISPC_IRQENABLE, mask);
 
 	enable_clocks(0);
-- 
1.6.2.4