mali_hikey: Modify irq initialization in mali hikey platform logic

Due to the irq domain code landing upstream in 3.19, the logic
for requesting irqs in the hikey platform code no longer works.

This patch tries to sovle the issue by using platform_irq_get
to fetch irq details from the DT entry (which properly sets up
the irq through the GIC), and then re-writes the static tables
so irq code gets the right irq number.

This patch cheats a bit, since it only calls platform_irq_get()
once on the first interrupt value in the DT, but that's because
the mali device shares interrupts.

Signed-off-by: John Stultz <john.stultz@linaro.org>
diff --git a/drivers/gpu/arm/utgard/platform/hikey/mali_hikey.c b/drivers/gpu/arm/utgard/platform/hikey/mali_hikey.c
index b7a4338..186ff88 100644
--- a/drivers/gpu/arm/utgard/platform/hikey/mali_hikey.c
+++ b/drivers/gpu/arm/utgard/platform/hikey/mali_hikey.c
@@ -622,6 +622,7 @@
 int mali_platform_device_init(struct platform_device *pdev)
 {
 	int stat;
+	int irq, i;
 
 #if HISI6220_USE_ION
 	stat = mali_ion_mem_init();
@@ -647,6 +648,17 @@
 		return -EINVAL;
 	}
 
+	/*
+	 * We need to use DT to get the irq domain, so rewrite the static
+	 * table with the irq given from platform_get_irq().
+	 */
+	irq = platform_get_irq(pdev, 0);
+	for (i = 0; i < ARRAY_SIZE(mali_gpu_resources_m450_mp4); i++) {
+		if (IORESOURCE_IRQ & mali_gpu_resources_m450_mp4[i].flags) {
+			mali_gpu_resources_m450_mp4[i].start = irq;
+			mali_gpu_resources_m450_mp4[i].end = irq;
+		}
+	}
 	pdev->num_resources = ARRAY_SIZE(mali_gpu_resources_m450_mp4);
 	pdev->resource = mali_gpu_resources_m450_mp4;