From 3e64e276ca6f653f066aed31dfc13b0c520a592a Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Mon, 23 May 2016 17:23:22 +0900 Subject: [PATCH] ARM: mali400: r5p2_rel0: replace CONFIG_PM_RUNTIME to CONFIG_PM 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 [jy0922.shim: apply to mali400 r5p2_rel0 with some modification] Signed-off-by: Joonyoung Shim Change-Id: Iab2e17c07b397fe164623e1ecec58c54296c83a7 --- drivers/gpu/arm/mali400/r5p2_rel0/common/mali_pm.c | 5 ++++- .../gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c | 9 ++++++--- drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_osk_pm.c | 14 ++++++++------ drivers/gpu/arm/mali400/r5p2_rel0/platform/arm/arm.c | 8 ++++---- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/arm/mali400/r5p2_rel0/common/mali_pm.c b/drivers/gpu/arm/mali400/r5p2_rel0/common/mali_pm.c index 85cdde0..9c6505c 100644 --- a/drivers/gpu/arm/mali400/r5p2_rel0/common/mali_pm.c +++ b/drivers/gpu/arm/mali400/r5p2_rel0/common/mali_pm.c @@ -8,6 +8,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #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, diff --git a/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c b/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c index 3035f08..5ec81ed 100644 --- a/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c +++ b/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c @@ -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()) { diff --git a/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_osk_pm.c b/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_osk_pm.c index 21180d3..9253e54 100644 --- a/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_osk_pm.c +++ b/drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_osk_pm.c @@ -15,9 +15,7 @@ #include -#ifdef CONFIG_PM_RUNTIME #include -#endif /* CONFIG_PM_RUNTIME */ #include #include #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 } diff --git a/drivers/gpu/arm/mali400/r5p2_rel0/platform/arm/arm.c b/drivers/gpu/arm/mali400/r5p2_rel0/platform/arm/arm.c index 9eaf07e..4853944 100644 --- a/drivers/gpu/arm/mali400/r5p2_rel0/platform/arm/arm.c +++ b/drivers/gpu/arm/mali400/r5p2_rel0/platform/arm/arm.c @@ -17,9 +17,7 @@ #include #include #include -#ifdef CONFIG_PM_RUNTIME #include -#endif #include #include #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)); -- 2.7.4