aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dss.c
diff options
context:
space:
mode:
authorarchit taneja <archit@ti.com>2011-02-23 03:41:03 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-03-11 08:46:24 -0500
commitaffe360d13e54b415cde2f11cee02369b4ed54bd (patch)
tree5c3b0382ac358351c86e73bb16004cc90aa930ab /drivers/video/omap2/dss/dss.c
parent371e2081447ce2bc6a25c20b513b9ba33cf5769e (diff)
OMAP: DSS2: Have separate irq handlers for DISPC and DSI
Currently, the core DSS platform device requests for an irq line for OMAP2 and OMAP3. Make DISPC and DSI platform devices request for a shared IRQ line. On OMAP3, the logical OR of DSI and DISPC interrupt lines goes to the MPU. There is a register DSS_IRQSTATUS which tells if the interrupt came from DISPC or DSI. On OMAP2, there is no DSI, only DISPC interrupts goto the MPU. There is no DSS_IRQSTATUS register. Hence, it makes more sense to have separate irq handlers corresponding to the DSS sub modules instead of having a common handler. Since on OMAP3 the logical OR of the lines goes to MPU, the irq line is shared among the IRQ handlers. The hwmod irq info has been removed for DSS to DISPC and DSI for OMAP2 and OMAP3 hwmod databases. The Probes of DISPC and DSI now request for irq handlers. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dss.c')
-rw-r--r--drivers/video/omap2/dss/dss.c51
1 files changed, 1 insertions, 50 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index ab82f7937675..dc57100cc43d 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -26,7 +26,6 @@
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/err.h> 27#include <linux/err.h>
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/interrupt.h>
30#include <linux/seq_file.h> 29#include <linux/seq_file.h>
31#include <linux/clk.h> 30#include <linux/clk.h>
32 31
@@ -79,7 +78,6 @@ static struct {
79 enum dss_clk_source dispc_clk_source; 78 enum dss_clk_source dispc_clk_source;
80 79
81 u32 ctx[DSS_SZ_REGS / sizeof(u32)]; 80 u32 ctx[DSS_SZ_REGS / sizeof(u32)];
82 int dss_irq;
83} dss; 81} dss;
84 82
85static void dss_clk_enable_all_no_ctx(void); 83static void dss_clk_enable_all_no_ctx(void);
@@ -495,31 +493,6 @@ found:
495 return 0; 493 return 0;
496} 494}
497 495
498
499
500static irqreturn_t dss_irq_handler_omap2(int irq, void *arg)
501{
502 dispc_irq_handler();
503
504 return IRQ_HANDLED;
505}
506
507static irqreturn_t dss_irq_handler_omap3(int irq, void *arg)
508{
509 u32 irqstatus;
510
511 irqstatus = dss_read_reg(DSS_IRQSTATUS);
512
513 if (irqstatus & (1<<0)) /* DISPC_IRQ */
514 dispc_irq_handler();
515#ifdef CONFIG_OMAP2_DSS_DSI
516 if (irqstatus & (1<<1)) /* DSI_IRQ */
517 dsi_irq_handler();
518#endif
519
520 return IRQ_HANDLED;
521}
522
523static int _omap_dss_wait_reset(void) 496static int _omap_dss_wait_reset(void)
524{ 497{
525 int t = 0; 498 int t = 0;
@@ -610,30 +583,12 @@ static int dss_init(bool skip_init)
610 REG_FLD_MOD(DSS_CONTROL, 0, 2, 2); /* venc clock mode = normal */ 583 REG_FLD_MOD(DSS_CONTROL, 0, 2, 2); /* venc clock mode = normal */
611#endif 584#endif
612 585
613 dss.dss_irq = platform_get_irq(dss.pdev, 0);
614 if (dss.dss_irq < 0) {
615 DSSERR("omap2 dss: platform_get_irq failed\n");
616 r = -ENODEV;
617 goto fail1;
618 }
619
620 r = request_irq(dss.dss_irq,
621 cpu_is_omap24xx()
622 ? dss_irq_handler_omap2
623 : dss_irq_handler_omap3,
624 0, "OMAP DSS", NULL);
625
626 if (r < 0) {
627 DSSERR("omap2 dss: request_irq failed\n");
628 goto fail1;
629 }
630
631 if (cpu_is_omap34xx()) { 586 if (cpu_is_omap34xx()) {
632 dss.dpll4_m4_ck = clk_get(NULL, "dpll4_m4_ck"); 587 dss.dpll4_m4_ck = clk_get(NULL, "dpll4_m4_ck");
633 if (IS_ERR(dss.dpll4_m4_ck)) { 588 if (IS_ERR(dss.dpll4_m4_ck)) {
634 DSSERR("Failed to get dpll4_m4_ck\n"); 589 DSSERR("Failed to get dpll4_m4_ck\n");
635 r = PTR_ERR(dss.dpll4_m4_ck); 590 r = PTR_ERR(dss.dpll4_m4_ck);
636 goto fail2; 591 goto fail1;
637 } 592 }
638 } 593 }
639 594
@@ -648,8 +603,6 @@ static int dss_init(bool skip_init)
648 603
649 return 0; 604 return 0;
650 605
651fail2:
652 free_irq(dss.dss_irq, NULL);
653fail1: 606fail1:
654 iounmap(dss.base); 607 iounmap(dss.base);
655fail0: 608fail0:
@@ -661,8 +614,6 @@ static void dss_exit(void)
661 if (cpu_is_omap34xx()) 614 if (cpu_is_omap34xx())
662 clk_put(dss.dpll4_m4_ck); 615 clk_put(dss.dpll4_m4_ck);
663 616
664 free_irq(dss.dss_irq, NULL);
665
666 iounmap(dss.base); 617 iounmap(dss.base);
667} 618}
668 619