logrotate: enable selinux support
[buildroot-gz.git] / package / ti-gfx / 0001-newclkapi.patch
blob69574c15f4367c9db9262db5fb8389e391f26de5
1 This patch adjusts the omap3630 portion of the powervr driver to use the new
2 clk kernel api.
4 Signed-off-by: Spenser Gilliland <spenser@gillilanding.com>
5 [yann.morin.1998@free.fr: rebased ontop of 5.01.00.01]
6 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
7 diff -durN ti-gfx-5_01_00_01.orig/GFX_Linux_KM/services4/system/omap3630/sysutils_linux.c ti-gfx-5_01_00_01/GFX_Linux_KM/services4/system/omap3630/sysutils_linux.c
8 --- ti-gfx-5_01_00_01.orig/GFX_Linux_KM/services4/system/omap3630/sysutils_linux.c 2013-12-23 15:44:20.000000000 +0100
9 +++ ti-gfx-5_01_00_01/GFX_Linux_KM/services4/system/omap3630/sysutils_linux.c 2014-02-26 19:17:39.829571846 +0100
10 @@ -182,6 +182,49 @@
11 @Return PVRSRV_ERROR
13 ******************************************************************************/
14 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
15 +int clk_disable_unprepare(struct clk *clk)
17 + return clk_disable(clk);
19 +#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
20 +int clk_disable_unprepare(struct clk *clk)
22 + res = clk_disable(clk);
23 + if (res < 0)
24 + return res;
26 + res = clk_unprepare(clk);
27 + if (ret < 0)
28 + return res;
30 + return 0;
32 +#endif
35 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
36 +int clk_prepare_enable(struct clk *clk)
38 + return clk_enable(clk);
40 +#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
41 +int clk_prepare_enable(struct clk *clk)
43 + res = clk_prepare(clk);
44 + if (ret < 0)
45 + return res;
47 + res = clk_enable(clk);
48 + if (res < 0) {
49 + clk_unprepare(clk);
50 + return res;
51 + }
53 + return 0;
55 +#endif
57 PVRSRV_ERROR EnableSGXClocks(SYS_DATA *psSysData)
59 #if !defined(NO_HARDWARE)
60 @@ -198,7 +241,7 @@
62 #if !defined(PM_RUNTIME_SUPPORT)
63 PVR_DPF((PVR_DBG_MESSAGE, "EnableSGXClocks: Enabling SGX Clocks"));
64 - res=clk_enable(psSysSpecData->psSGX_FCK);
65 + res=clk_prepare_enable(psSysSpecData->psSGX_FCK);
66 if (res < 0)
68 PVR_DPF((PVR_DBG_ERROR, "EnableSGXClocks: Couldn't enable SGX functional clock (%d)", res));
69 @@ -324,7 +367,7 @@
71 PVR_DPF((PVR_DBG_MESSAGE, "DisableSGXClocks: Disabling SGX Clocks"));
72 #if !defined(PM_RUNTIME_SUPPORT)
73 - clk_disable(psSysSpecData->psSGX_FCK);
74 + clk_disable_unprepare(psSysSpecData->psSGX_FCK);
75 #endif
76 SysDisableSGXInterrupts(psSysData);
78 @@ -540,14 +583,14 @@
79 rate = clk_get_rate(psSysSpecData->psGPT11_FCK);
80 PVR_TRACE(("GPTIMER11 clock is %dMHz", HZ_TO_MHZ(rate)));
82 - res = clk_enable(psSysSpecData->psGPT11_FCK);
83 + res = clk_prepare_enable(psSysSpecData->psGPT11_FCK);
84 if (res < 0)
86 PVR_DPF((PVR_DBG_ERROR, "EnableSystemClocks: Couldn't enable GPTIMER11 functional clock (%d)", res));
87 goto ExitError;
90 - res = clk_enable(psSysSpecData->psGPT11_ICK);
91 + res = clk_prepare_enable(psSysSpecData->psGPT11_ICK);
92 if (res < 0)
94 PVR_DPF((PVR_DBG_ERROR, "EnableSystemClocks: Couldn't enable GPTIMER11 interface clock (%d)", res));
95 @@ -610,9 +653,9 @@
97 ExitDisableGPT11ICK:
98 #if defined(PVR_OMAP4_TIMING_PRCM)
99 - clk_disable(psSysSpecData->psGPT11_ICK);
100 + clk_disable_unprepare(psSysSpecData->psGPT11_ICK);
101 ExitDisableGPT11FCK:
102 - clk_disable(psSysSpecData->psGPT11_FCK);
103 + clk_disable_unprepare(psSysSpecData->psGPT11_FCK);
104 ExitError:
105 #endif /* defined(PVR_OMAP4_TIMING_PRCM) */
106 eError = PVRSRV_ERROR_CLOCK_REQUEST_FAILED;
107 @@ -664,9 +707,9 @@
108 psSysSpecData->sTimerRegPhysBase.uiAddr = 0;
109 #endif
110 #if defined(PVR_OMAP4_TIMING_PRCM)
111 - clk_disable(psSysSpecData->psGPT11_ICK);
112 + clk_disable_unprepare(psSysSpecData->psGPT11_ICK);
114 - clk_disable(psSysSpecData->psGPT11_FCK);
115 + clk_disable_unprepare(psSysSpecData->psGPT11_FCK);
116 #endif /* defined(PVR_OMAP4_TIMING_PRCM) */
118 #endif /* PVR_OMAP_USE_DM_TIMER_API */