ARM: mali400: r5p2_rel0: replace CONFIG_PM_RUNTIME to CONFIG_PM 34/71034/1 accepted/tizen/mobile/20160602.021755 submit/tizen/20160530.004744
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 23 May 2016 08:23:22 +0000 (17:23 +0900)
committerJoonyoung Shim <jy0922.shim@samsung.com>
Tue, 24 May 2016 00:00:40 +0000 (09:00 +0900)
After commit 464ed18ebdb6 ("PM: Eliminate CONFIG_PM_RUNTIME") which
is applied kernel version 3.19, PM_RUNTIME is eliminated. So this
patch replaces CONFIG_PM_RUNTIME to CONFIG_PM for kernel version
larger than 3.19.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
[jy0922.shim: apply to mali400 r5p2_rel0 with some modification]
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Change-Id: Iab2e17c07b397fe164623e1ecec58c54296c83a7

drivers/gpu/arm/mali400/r5p2_rel0/common/mali_pm.c
drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c
drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_osk_pm.c
drivers/gpu/arm/mali400/r5p2_rel0/platform/arm/arm.c

index 85cdde0..9c6505c 100644 (file)
@@ -8,6 +8,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
+#include <linux/version.h>
+
 #include "mali_pm.h"
 #include "mali_kernel_common.h"
 #include "mali_osk.h"
@@ -70,7 +72,8 @@ static int mali_pm_domain_power_cost_result[MALI_MAX_NUMBER_OF_PHYSICAL_PP_GROUP
  * Keep track of runtime PM state, so that we know
  * how to resume during OS resume.
  */
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+       || defined(CONFIG_PM)
 static mali_bool mali_pm_runtime_active = MALI_FALSE;
 #else
 /* when kernel don't enable PM_RUNTIME, set the flag always true,
index 3035f08..5ec81ed 100644 (file)
@@ -179,7 +179,8 @@ static int mali_remove(struct platform_device *pdev);
 static int mali_driver_suspend_scheduler(struct device *dev);
 static int mali_driver_resume_scheduler(struct device *dev);
 
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+       || defined(CONFIG_PM)
 static int mali_driver_runtime_suspend(struct device *dev);
 static int mali_driver_runtime_resume(struct device *dev);
 static int mali_driver_runtime_idle(struct device *dev);
@@ -210,7 +211,8 @@ struct pm_ext_ops mali_dev_ext_pm_ops = {
 };
 #else
 static const struct dev_pm_ops mali_dev_pm_ops = {
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+       || defined(CONFIG_PM)
        .runtime_suspend = mali_driver_runtime_suspend,
        .runtime_resume = mali_driver_runtime_resume,
        .runtime_idle = mali_driver_runtime_idle,
@@ -627,7 +629,8 @@ static int mali_driver_resume_scheduler(struct device *dev)
        return 0;
 }
 
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+       || defined(CONFIG_PM)
 static int mali_driver_runtime_suspend(struct device *dev)
 {
        if (MALI_TRUE == mali_pm_runtime_suspend()) {
index 21180d3..9253e54 100644 (file)
@@ -15,9 +15,7 @@
 
 #include <linux/sched.h>
 
-#ifdef CONFIG_PM_RUNTIME
 #include <linux/pm_runtime.h>
-#endif /* CONFIG_PM_RUNTIME */
 #include <linux/platform_device.h>
 #include <linux/version.h>
 #include "mali_osk.h"
@@ -27,7 +25,8 @@
 /* Can NOT run in atomic context */
 _mali_osk_errcode_t _mali_osk_pm_dev_ref_get_sync(void)
 {
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+       || defined(CONFIG_PM)
        int err;
        MALI_DEBUG_ASSERT_POINTER(mali_platform_device);
        err = pm_runtime_get_sync(&(mali_platform_device->dev));
@@ -45,7 +44,8 @@ _mali_osk_errcode_t _mali_osk_pm_dev_ref_get_sync(void)
 /* Can run in atomic context */
 _mali_osk_errcode_t _mali_osk_pm_dev_ref_get_async(void)
 {
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+       || defined(CONFIG_PM)
        int err;
        MALI_DEBUG_ASSERT_POINTER(mali_platform_device);
        err = pm_runtime_get(&(mali_platform_device->dev));
@@ -64,7 +64,8 @@ _mali_osk_errcode_t _mali_osk_pm_dev_ref_get_async(void)
 /* Can run in atomic context */
 void _mali_osk_pm_dev_ref_put(void)
 {
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+       || defined(CONFIG_PM)
        MALI_DEBUG_ASSERT_POINTER(mali_platform_device);
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
        pm_runtime_mark_last_busy(&(mali_platform_device->dev));
@@ -77,7 +78,8 @@ void _mali_osk_pm_dev_ref_put(void)
 
 void _mali_osk_pm_dev_barrier(void)
 {
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+       || defined(CONFIG_PM)
        pm_runtime_barrier(&(mali_platform_device->dev));
 #endif
 }
index 9eaf07e..4853944 100644 (file)
@@ -17,9 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/version.h>
 #include <linux/pm.h>
-#ifdef CONFIG_PM_RUNTIME
 #include <linux/pm_runtime.h>
-#endif
 #include <asm/io.h>
 #include <linux/mali/mali_utgard.h>
 #include "mali_kernel_common.h"
@@ -192,7 +190,8 @@ int mali_platform_device_register(void)
        /* Register the platform device */
        err = platform_device_register(&mali_gpu_device);
        if (0 == err) {
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+       || defined(CONFIG_PM)
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
                pm_runtime_set_autosuspend_delay(&(mali_gpu_device.dev), 1000);
                pm_runtime_use_autosuspend(&(mali_gpu_device.dev));
@@ -280,7 +279,8 @@ int mali_platform_device_init(struct platform_device *device)
        err = platform_device_add_data(device, &mali_gpu_data, sizeof(mali_gpu_data));
 
        if (0 == err) {
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+       || defined(CONFIG_PM)
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
                pm_runtime_set_autosuspend_delay(&(device->dev), 1000);
                pm_runtime_use_autosuspend(&(device->dev));