summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishal Mahaveer2014-11-12 14:23:25 -0600
committerVishal Mahaveer2014-11-12 14:23:25 -0600
commit7520f72590a1a6570728a6b0d6b6942100f4acc2 (patch)
treeb6a90ecf5b403f3b5f568edc0400e0d164a9ea0b
parent55b4f04cb469002e01861357413e820046a07392 (diff)
downloaddevice-ti-proprietary-open-7520f72590a1a6570728a6b0d6b6942100f4acc2.tar.gz
device-ti-proprietary-open-7520f72590a1a6570728a6b0d6b6942100f4acc2.tar.xz
device-ti-proprietary-open-7520f72590a1a6570728a6b0d6b6942100f4acc2.zip
jacinto6: sgx-bin: update sgx binaries and source for kernel 3.14
Update SGX binaries and kernel module source for Kernel 3.14 Change-Id: I9b88401f77ba2f43a16ac0959913c518024da2de Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
-rw-r--r--jacinto6/README.SGX6
-rw-r--r--jacinto6/sgx.tgzbin4109564 -> 2766106 bytes
-rw-r--r--jacinto6/sgx/Android.mk3
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk3
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk2
-rw-r--r--jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_android/Makefile6
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c23
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.h8
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c2
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq.c66
10 files changed, 100 insertions, 19 deletions
diff --git a/jacinto6/README.SGX b/jacinto6/README.SGX
index 7927d36..6f01818 100644
--- a/jacinto6/README.SGX
+++ b/jacinto6/README.SGX
@@ -16,11 +16,11 @@ sgx.tgz a set of binaries built for SGX544.
16[DDK Version] 16[DDK Version]
17 1.12/2917986 17 1.12/2917986
18[DDK commit ID] 18[DDK commit ID]
19 a9240e6 SGX-UM: Adding logcat entries for pvrsrvinit. 19 a0d3db4 tmp: Changes for Android L
20[Branch] 20[Branch]
21 android/1.12/2917986 21 android/1.12/2917986_k3.14_L
22[Kernel modules built against] 22[Kernel modules built against]
23 Kernel Version: 3.8.y with CONFIG_MODVERSIONS=y 23 Kernel Version: 3.14.y with CONFIG_MODVERSIONS=y
24 24
25#=========================================================================== 25#===========================================================================
26# Building SGX Kernel Modules 26# Building SGX Kernel Modules
diff --git a/jacinto6/sgx.tgz b/jacinto6/sgx.tgz
index 4342b4b..da4b376 100644
--- a/jacinto6/sgx.tgz
+++ b/jacinto6/sgx.tgz
Binary files differ
diff --git a/jacinto6/sgx/Android.mk b/jacinto6/sgx/Android.mk
index 1740ffd..862dffb 100644
--- a/jacinto6/sgx/Android.mk
+++ b/jacinto6/sgx/Android.mk
@@ -116,8 +116,7 @@ prebuilt_sgx_vendor_bins := \
116# etc/powervr.ini 116# etc/powervr.ini
117 117
118prebuilt_sgx_vendor_km := \ 118prebuilt_sgx_vendor_km := \
119 modules/pvrsrvkm.ko \ 119 modules/pvrsrvkm.ko
120 modules/omaplfb.ko
121 120
122prebuilt_sgx_modules := \ 121prebuilt_sgx_modules := \
123 $(foreach _file,$(prebuilt_sgx_vendor_libs) $(prebuilt_sgx_vendor_bins) $(prebuilt_sgx_vendor_etc) $(prebuilt_sgx_vendor_km),\ 122 $(foreach _file,$(prebuilt_sgx_vendor_libs) $(prebuilt_sgx_vendor_bins) $(prebuilt_sgx_vendor_etc) $(prebuilt_sgx_vendor_km),\
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
index 088d47f..0b40526 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk
@@ -186,9 +186,8 @@ endif
186# We also need to support IMPLEMENTATION_DEFINED so gralloc allocates 186# We also need to support IMPLEMENTATION_DEFINED so gralloc allocates
187# framebuffers and GPU buffers in a 'preferred' format. 187# framebuffers and GPU buffers in a 'preferred' format.
188# 188#
189# FB HAL is still being used in TI post JB MR1 releases.
190SUPPORT_ANDROID_FRAMEBUFFER_HAL := 1
191ifeq ($(is_at_least_jellybean_mr1),0) 189ifeq ($(is_at_least_jellybean_mr1),0)
190SUPPORT_ANDROID_FRAMEBUFFER_HAL := 1
192else 191else
193PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED := 1 192PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED := 1
194endif 193endif
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk
index 3f761cf..052c35e 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk
@@ -512,7 +512,7 @@ ifneq ($(PVR_LINUX_MEM_AREA_POOL_MAX_PAGES),0)
512PVR_LINUX_MEM_AREA_USE_VMAP ?= 1 512PVR_LINUX_MEM_AREA_USE_VMAP ?= 1
513include ../kernel_version.mk 513include ../kernel_version.mk
514ifeq ($(call kernel-version-at-least,3,0),true) 514ifeq ($(call kernel-version-at-least,3,0),true)
515PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK ?= 1 515PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK ?= 0
516endif 516endif
517endif 517endif
518$(eval $(call KernelConfigC,PVR_LINUX_MEM_AREA_POOL_MAX_PAGES,$(PVR_LINUX_MEM_AREA_POOL_MAX_PAGES))) 518$(eval $(call KernelConfigC,PVR_LINUX_MEM_AREA_POOL_MAX_PAGES,$(PVR_LINUX_MEM_AREA_POOL_MAX_PAGES)))
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_android/Makefile b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_android/Makefile
index 7a2d7c7..1915447 100644
--- a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_android/Makefile
+++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap_android/Makefile
@@ -95,7 +95,7 @@ SUPPORT_LINUX_USING_WORKQUEUES := 1
95SUPPORT_PVRSRV_ANDROID_SYSTRACE := 0 95SUPPORT_PVRSRV_ANDROID_SYSTRACE := 0
96 96
97ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),0) 97ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),0)
98DISPLAY_CONTROLLER := omaplfb 98#DISPLAY_CONTROLLER := omaplfb
99endif 99endif
100 100
101PVR_SYSTEM := omap 101PVR_SYSTEM := omap
@@ -144,7 +144,7 @@ OMAP_NON_FLIP_DISPLAY := 1
144endif 144endif
145else # LDM_PLATFORM != 1 145else # LDM_PLATFORM != 1
146ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),0) 146ifneq ($(SUPPORT_PVRSRV_DEVICE_CLASS),0)
147DISPLAY_CONTROLLER_COMPONENT := dc_omapfb3_linux 147#DISPLAY_CONTROLLER_COMPONENT := dc_omapfb3_linux
148endif 148endif
149endif # LDM_PLATFORM != 1 149endif # LDM_PLATFORM != 1
150 150
@@ -176,7 +176,7 @@ SUPPORT_ANDROID_OMAP_NV12 := 1
176 176
177PVR_ANDROID_USE_WINDOW_TRANSFORM_HINT := 1 177PVR_ANDROID_USE_WINDOW_TRANSFORM_HINT := 1
178 178
179PVR_ANDROID_PLATFORM_HAS_LINUX_FBDEV := 1 179PVR_ANDROID_PLATFORM_HAS_LINUX_FBDEV := 0
180 180
181# Handle Google's OMAP-based products 181# Handle Google's OMAP-based products
182# 182#
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c
index 3bd6659..2f08f27 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c
@@ -140,6 +140,28 @@ IMG_VOID IonDeinit(IMG_VOID)
140 140
141#else /* defined(CONFIG_ION_INCDHAD1) */ 141#else /* defined(CONFIG_ION_INCDHAD1) */
142 142
143#if defined(CONFIG_ION_DUMMY)
144
145/* Real ion with sharing (dummy) */
146
147extern struct ion_device *idev;
148struct ion_device *gpsIonDev;
149
150PVRSRV_ERROR IonInit(IMG_VOID)
151{
152 gpsIonDev = idev;
153 return PVRSRV_OK;
154}
155
156
157IMG_VOID IonDeinit(IMG_VOID)
158{
159 gpsIonDev = IMG_NULL;
160}
161
162#else /* defined(CONFIG_ION_DUMMY) */
163
164
143/* "Reference" ion implementation */ 165/* "Reference" ion implementation */
144 166
145#include SUPPORT_ION_PRIV_HEADER 167#include SUPPORT_ION_PRIV_HEADER
@@ -240,6 +262,7 @@ IMG_VOID IonDeinit(IMG_VOID)
240 kfree(gapsIonHeaps); 262 kfree(gapsIonHeaps);
241 ion_device_destroy(gpsIonDev); 263 ion_device_destroy(gpsIonDev);
242} 264}
265#endif /* defined(CONFIG_ION_DUMMY) */
243 266
244#endif /* defined(CONFIG_ION_INCDHAD1) */ 267#endif /* defined(CONFIG_ION_INCDHAD1) */
245 268
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.h b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.h
index a66e927..1fe1eb1 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.h
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.h
@@ -79,8 +79,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
79#if defined(__i386__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) 79#if defined(__i386__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
80 #define IOREMAP(pa, bytes) ioremap_cache(pa, bytes) 80 #define IOREMAP(pa, bytes) ioremap_cache(pa, bytes)
81#else 81#else
82 #if defined(__arm__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) 82 #if defined(__arm__)
83 #define IOREMAP(pa, bytes) ioremap_cached(pa, bytes) 83 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
84 #define IOREMAP(pa, bytes) ioremap_cache(pa, bytes)
85 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
86 #define IOREMAP(pa, bytes) ioremap_cached(pa, bytes)
87 #endif
84 #else 88 #else
85 #define IOREMAP(pa, bytes) ioremap(pa, bytes) 89 #define IOREMAP(pa, bytes) ioremap(pa, bytes)
86 #endif 90 #endif
diff --git a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c
index c9b577e..7ffb30c 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c
@@ -105,7 +105,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
105#define ON_EACH_CPU(func, info, wait) on_each_cpu(func, info, 0, wait) 105#define ON_EACH_CPU(func, info, wait) on_each_cpu(func, info, 0, wait)
106#endif 106#endif
107 107
108#if defined(PVR_LINUX_USING_WORKQUEUES) && !defined(CONFIG_PREEMPT) 108#if defined(PVR_LINUX_USING_WORKQUEUES) && !defined(CONFIG_PREEMPT) && !defined(CONFIG_PREEMPT_VOLUNTARY)
109/* 109/*
110 * Services spins at certain points waiting for events (e.g. swap 110 * Services spins at certain points waiting for events (e.g. swap
111 * chain destrucion). If those events rely on workqueues running, 111 * chain destrucion). If those events rely on workqueues running,
diff --git a/jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq.c b/jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq.c
index 1febc75..518aa8a 100644
--- a/jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq.c
+++ b/jacinto6/sgx_src/eurasia_km/services4/system/omap/sgxfreq.c
@@ -14,11 +14,19 @@
14 * this program. If not, see <http://www.gnu.org/licenses/>. 14 * this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
18#include <linux/pm_opp.h>
19#include <linux/of.h>
20#else
17#include <linux/opp.h> 21#include <linux/opp.h>
22#endif
18#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) 23#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
19#include <plat/gpu.h> 24#include <plat/gpu.h>
20#endif 25#endif
21#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) 26
27#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
28#include <linux/pm_voltage_domain.h>
29#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
22#include <linux/regulator/consumer.h> 30#include <linux/regulator/consumer.h>
23#endif 31#endif
24 32
@@ -46,8 +54,13 @@ static struct sgxfreq_data {
46 struct clk *per_clk; 54 struct clk *per_clk;
47 struct clk *gpu_core_clk; 55 struct clk *gpu_core_clk;
48 struct clk *gpu_hyd_clk; 56 struct clk *gpu_hyd_clk;
57#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
49 struct regulator *gpu_reg; 58 struct regulator *gpu_reg;
50#endif 59#endif
60#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
61 struct notifier_block *clk_nb;
62#endif
63#endif
51} sfd; 64} sfd;
52 65
53/* Governor init/deinit functions */ 66/* Governor init/deinit functions */
@@ -202,7 +215,7 @@ static const struct attribute *sgxfreq_attributes[] = {
202}; 215};
203 216
204/************************ end sysfs interface ************************/ 217/************************ end sysfs interface ************************/
205#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) 218#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
206static int set_volt_for_freq(unsigned long freq) 219static int set_volt_for_freq(unsigned long freq)
207{ 220{
208 struct opp *opp; 221 struct opp *opp;
@@ -248,6 +261,7 @@ static int __set_freq(void)
248 freq = min(sfd.freq_request, sfd.freq_limit); 261 freq = min(sfd.freq_request, sfd.freq_limit);
249 if (freq != sfd.freq) { 262 if (freq != sfd.freq) {
250#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) 263#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
264#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
251 if (freq > sfd.freq) { 265 if (freq > sfd.freq) {
252 /* Going up - must scale voltage before clocks */ 266 /* Going up - must scale voltage before clocks */
253 if (set_volt_for_freq(freq) != 0) { 267 if (set_volt_for_freq(freq) != 0) {
@@ -256,6 +270,7 @@ static int __set_freq(void)
256 goto err1; 270 goto err1;
257 } 271 }
258 } 272 }
273#endif
259 274
260 ret = clk_set_rate(sfd.gpu_core_clk, freq); 275 ret = clk_set_rate(sfd.gpu_core_clk, freq);
261 if (ret) { 276 if (ret) {
@@ -271,6 +286,7 @@ static int __set_freq(void)
271 goto err3; 286 goto err3;
272 } 287 }
273 288
289#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
274 if (freq < sfd.freq) { 290 if (freq < sfd.freq) {
275 /* Going down - must scale voltage after clocks */ 291 /* Going down - must scale voltage after clocks */
276 if(set_volt_for_freq(freq) != 0) { 292 if(set_volt_for_freq(freq) != 0) {
@@ -279,7 +295,7 @@ static int __set_freq(void)
279 goto err4; 295 goto err4;
280 } 296 }
281 } 297 }
282 298#endif
283#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) 299#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
284 sfd.pdata->device_scale(sfd.dev, sfd.dev, freq); 300 sfd.pdata->device_scale(sfd.dev, sfd.dev, freq);
285#else 301#else
@@ -290,16 +306,20 @@ static int __set_freq(void)
290 goto noerr; 306 goto noerr;
291 307
292#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) 308#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
309#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
293err4: 310err4:
311#endif
294 ret |= clk_set_rate(sfd.gpu_hyd_clk, sfd.freq); 312 ret |= clk_set_rate(sfd.gpu_hyd_clk, sfd.freq);
295 313
296err3: 314err3:
297 ret |= clk_set_rate(sfd.gpu_core_clk, sfd.freq); 315 ret |= clk_set_rate(sfd.gpu_core_clk, sfd.freq);
298err2: 316err2:
317#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
299 if(freq > sfd.freq) 318 if(freq > sfd.freq)
300 ret |= set_volt_for_freq(sfd.freq); 319 ret |= set_volt_for_freq(sfd.freq);
301err1: 320err1:
302#endif 321#endif
322#endif
303noerr: 323noerr:
304 return ret; 324 return ret;
305 } 325 }
@@ -374,7 +394,13 @@ int sgxfreq_init(struct device *dev)
374{ 394{
375 int i, ret; 395 int i, ret;
376 unsigned long freq; 396 unsigned long freq;
397#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
398 struct dev_pm_opp *opp;
399 struct device_node *np;
400 unsigned int voltage_latency;
401#else
377 struct opp *opp; 402 struct opp *opp;
403#endif
378 struct timeval tv; 404 struct timeval tv;
379 405
380 sfd.dev = dev; 406 sfd.dev = dev;
@@ -399,14 +425,38 @@ int sgxfreq_init(struct device *dev)
399 pr_err("sgxfreq: failed to init OPP table: %d\n", ret); 425 pr_err("sgxfreq: failed to init OPP table: %d\n", ret);
400 return -EINVAL; 426 return -EINVAL;
401 } 427 }
402 428#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
403 sfd.freq_cnt = opp_get_opp_count(dev); 429 sfd.freq_cnt = opp_get_opp_count(dev);
430#else
431 sfd.freq_cnt = dev_pm_opp_get_opp_count(dev);
432#endif
404#endif 433#endif
405 if (sfd.freq_cnt < 1) { 434 if (sfd.freq_cnt < 1) {
435 pr_err("sgxfreq: failed to get operating frequencies\n");
406 rcu_read_unlock(); 436 rcu_read_unlock();
407 return -ENODEV; 437 return -ENODEV;
408 } 438 }
409 439
440#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
441 np = of_node_get(dev->of_node);
442 sfd.clk_nb = of_pm_voltdm_notifier_register(dev, np, sfd.gpu_core_clk, "gpu",
443 &voltage_latency);
444
445 if (IS_ERR(sfd.clk_nb)) {
446 ret = PTR_ERR(sfd.clk_nb);
447 /* defer probe if regulator is not yet registered */
448 if (ret == -EPROBE_DEFER) {
449 dev_err(dev,
450 "gpu clock notifier not ready, retry\n");
451 } else {
452 dev_err(dev,
453 "Failed to register gpu clock notifier: %d\n",
454 ret);
455 }
456 return ret;
457 }
458
459#endif
410 sfd.freq_list = kmalloc(sfd.freq_cnt * sizeof(unsigned long), GFP_ATOMIC); 460 sfd.freq_list = kmalloc(sfd.freq_cnt * sizeof(unsigned long), GFP_ATOMIC);
411 if (!sfd.freq_list) { 461 if (!sfd.freq_list) {
412 rcu_read_unlock(); 462 rcu_read_unlock();
@@ -417,8 +467,11 @@ int sgxfreq_init(struct device *dev)
417 for (i = 0; i < sfd.freq_cnt; i++) { 467 for (i = 0; i < sfd.freq_cnt; i++) {
418#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)) 468#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
419 opp = sfd.pdata->opp_find_freq_ceil(dev, &freq); 469 opp = sfd.pdata->opp_find_freq_ceil(dev, &freq);
420#else 470#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
421 opp = opp_find_freq_ceil(dev, &freq); 471 opp = opp_find_freq_ceil(dev, &freq);
472#else
473 /* 3.14 and later kernels */
474 opp = dev_pm_opp_find_freq_ceil(dev, &freq);
422#endif 475#endif
423 if (IS_ERR_OR_NULL(opp)) { 476 if (IS_ERR_OR_NULL(opp)) {
424 rcu_read_unlock(); 477 rcu_read_unlock();
@@ -466,6 +519,8 @@ int sgxfreq_init(struct device *dev)
466 return ret; 519 return ret;
467 } 520 }
468 521
522
523#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
469 sfd.gpu_reg = devm_regulator_get(dev, "gpu"); 524 sfd.gpu_reg = devm_regulator_get(dev, "gpu");
470 if (IS_ERR(sfd.gpu_reg)) { 525 if (IS_ERR(sfd.gpu_reg)) {
471 if (PTR_ERR(sfd.gpu_reg) == -EPROBE_DEFER) { 526 if (PTR_ERR(sfd.gpu_reg) == -EPROBE_DEFER) {
@@ -475,6 +530,7 @@ int sgxfreq_init(struct device *dev)
475 pr_err("sgxfreq: failed to get gpu regulator: %ld\n", PTR_ERR(sfd.gpu_reg)); 530 pr_err("sgxfreq: failed to get gpu regulator: %ld\n", PTR_ERR(sfd.gpu_reg));
476 sfd.gpu_reg = NULL; 531 sfd.gpu_reg = NULL;
477 } 532 }
533#endif
478 534
479 ret = clk_set_parent(sfd.gpu_hyd_clk, sfd.core_clk); 535 ret = clk_set_parent(sfd.gpu_hyd_clk, sfd.core_clk);
480 if (ret != 0) { 536 if (ret != 0) {