drm/msm/sde: reorganize top level interrupt handling code

Re-organize interrupt handling code to match device hierarchy
such that the top level handler maps to MDSS level, and core
level handler maps to  MDP level.  They are moved to separate
files corresponding to top and core respectively. This improves
maintainability of the interrupt handling abstraction.

Change-Id: Ib76cfa0f157722d9c1926bf21fc789c2be19b495
Signed-off-by: Alan Kwong <akwong@codeaurora.org>
diff --git a/drivers/gpu/drm/msm/sde/sde_kms.h b/drivers/gpu/drm/msm/sde/sde_kms.h
index e8a6988..46e2398 100644
--- a/drivers/gpu/drm/msm/sde/sde_kms.h
+++ b/drivers/gpu/drm/msm/sde/sde_kms.h
@@ -26,6 +26,7 @@
 #include "sde_connector.h"
 #include "sde_rm.h"
 #include "sde_power_handle.h"
+#include "sde_irq.h"
 
 /**
  * SDE_DEBUG - macro for kms/plane/crtc/encoder/connector logs
@@ -131,10 +132,7 @@
 	struct regulator *mmagic;
 	struct regulator *venus;
 
-	struct {
-		unsigned long enabled_mask;
-		struct irq_domain *domain;
-	} irqcontroller;
+	struct sde_irq_controller irq_controller;
 
 	struct sde_hw_intr *hw_intr;
 	struct sde_irq irq_obj;
@@ -404,104 +402,6 @@
 void sde_kms_info_stop(struct sde_kms_info *info);
 
 /**
- * IRQ functions
- */
-int sde_irq_domain_init(struct sde_kms *sde_kms);
-int sde_irq_domain_fini(struct sde_kms *sde_kms);
-void sde_irq_preinstall(struct msm_kms *kms);
-int sde_irq_postinstall(struct msm_kms *kms);
-void sde_irq_uninstall(struct msm_kms *kms);
-irqreturn_t sde_irq(struct msm_kms *kms);
-
-/**
- * sde_set_irqmask - IRQ helper function for writing IRQ mask
- *                   to SDE HW interrupt register.
- * @sde_kms:		SDE handle
- * @reg_off:		SDE HW interrupt register offset
- * @irqmask:		IRQ mask
- */
-void sde_set_irqmask(
-		struct sde_kms *sde_kms,
-		uint32_t reg_off,
-		uint32_t irqmask);
-
-/**
- * sde_irq_idx_lookup - IRQ helper function for lookup irq_idx from HW
- *                      interrupt mapping table.
- * @sde_kms:		SDE handle
- * @intr_type:		SDE HW interrupt type for lookup
- * @instance_idx:	SDE HW block instance defined in sde_hw_mdss.h
- * @return:		irq_idx or -EINVAL when fail to lookup
- */
-int sde_irq_idx_lookup(
-		struct sde_kms *sde_kms,
-		enum sde_intr_type intr_type,
-		uint32_t instance_idx);
-
-/**
- * sde_enable_irq - IRQ helper function for enabling one or more IRQs
- * @sde_kms:		SDE handle
- * @irq_idxs:		Array of irq index
- * @irq_count:		Number of irq_idx provided in the array
- * @return:		0 for success enabling IRQ, otherwise failure
- */
-int sde_enable_irq(
-		struct sde_kms *sde_kms,
-		int *irq_idxs,
-		uint32_t irq_count);
-
-/**
- * sde_disable_irq - IRQ helper function for diabling one of more IRQs
- * @sde_kms:		SDE handle
- * @irq_idxs:		Array of irq index
- * @irq_count:		Number of irq_idx provided in the array
- * @return:		0 for success disabling IRQ, otherwise failure
- */
-int sde_disable_irq(
-		struct sde_kms *sde_kms,
-		int *irq_idxs,
-		uint32_t irq_count);
-
-/**
- * sde_read_irq - IRQ helper function for reading IRQ status
- * @sde_kms:		SDE handle
- * @irq_idx:		irq index
- * @clear:		True to clear the irq after read
- * @return:		non-zero if irq detected; otherwise no irq detected
- */
-u32 sde_read_irq(
-		struct sde_kms *sde_kms,
-		int irq_idx,
-		bool clear);
-
-/**
- * sde_register_irq_callback - For registering callback function on IRQ
- *                             interrupt
- * @sde_kms:		SDE handle
- * @irq_idx:		irq index
- * @irq_cb:		IRQ callback structure, containing callback function
- *			and argument. Passing NULL for irq_cb will unregister
- *			the callback for the given irq_idx
- * @return:		0 for success registering callback, otherwise failure
- */
-int sde_register_irq_callback(
-		struct sde_kms *sde_kms,
-		int irq_idx,
-		struct sde_irq_callback *irq_cb);
-
-/**
- * sde_clear_all_irqs - Clearing all SDE IRQ interrupt status
- * @sde_kms:		SDE handle
- */
-void sde_clear_all_irqs(struct sde_kms *sde_kms);
-
-/**
- * sde_disable_all_irqs - Diabling all SDE IRQ interrupt
- * @sde_kms:		SDE handle
- */
-void sde_disable_all_irqs(struct sde_kms *sde_kms);
-
-/**
  * Vblank enable/disable functions
  */
 int sde_enable_vblank(struct msm_kms *kms, struct drm_crtc *crtc);