]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00240988: gpu: use reset API on 3.10 kernel
authorShawn Guo <shawn.guo@freescale.com>
Mon, 29 Jul 2013 05:59:11 +0000 (13:59 +0800)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:54:00 +0000 (09:54 +0800)
Use reset API to reset GPU on 3.10 kernel.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c

index 6e71e00509dd26e9fe0a8c3eb6956b113a04af62..0347a81d76230321850fee5f46af7024c2e92d0f 100644 (file)
@@ -108,6 +108,7 @@ typedef struct _gckGALDEVICE
        struct device           *pmdev;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
        struct contiguous_mem_pool *pool;
+       struct reset_control *rstc[gcdMAX_GPU_COUNT];
 #endif
 }
 * gckGALDEVICE;
index e7cdb71bc68756bf22e7434c177cc770bfde8fdb..83118002db5aab61d8040b402d9ecf52f49338fb 100644 (file)
@@ -71,6 +71,8 @@ task_notify_func(struct notifier_block *self, unsigned long val, void *data)
 #include <linux/pm_runtime.h>
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
 #include <mach/busfreq.h>
+#else
+#include <linux/reset.h>
 #endif
 #endif
 /* Zone used for header/footer. */
@@ -1048,6 +1050,7 @@ static int __devinit gpu_probe(struct platform_device *pdev)
     struct resource* res;
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
        struct contiguous_mem_pool *pool;
+       struct reset_control *rstc;
 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
        struct device_node *dn =pdev->dev.of_node;
        const u32 *prop;
@@ -1126,6 +1129,16 @@ static int __devinit gpu_probe(struct platform_device *pdev)
 
     if (!ret)
     {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+       rstc = devm_reset_control_get(&pdev->dev, "gpu3d");
+       galDevice->rstc[gcvCORE_MAJOR] = IS_ERR(rstc) ? NULL : rstc;
+
+       rstc = devm_reset_control_get(&pdev->dev, "gpu2d");
+       galDevice->rstc[gcvCORE_2D] = IS_ERR(rstc) ? NULL : rstc;
+
+       rstc = devm_reset_control_get(&pdev->dev, "gpuvg");
+       galDevice->rstc[gcvCORE_VG] = IS_ERR(rstc) ? NULL : rstc;
+#endif
         platform_set_drvdata(pdev, galDevice);
 
 #if gcdENABLE_FSCALE_VAL_ADJUST
index f21651660395a88ee15bbcbb61a10632a93e8c84..5366c08ef47a0f55de172ebce5d106088c2f408a 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/math64.h>
 #endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+#include <linux/reset.h>
 static inline void imx_gpc_power_up_pu(bool flag) {}
 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
 #include <mach/common.h>
@@ -7059,6 +7060,10 @@ gckOS_ResetGPU(
     }
 
     gcmkFOOTER_NO();
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+       struct reset_control *rstc = Os->device->rstc[Core];
+       if (rstc)
+               reset_control_reset(rstc);
 #else
     imx_src_reset_gpu((int)Core);
 #endif