summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2016-05-23 17:23:22 +0900
committerJoonyoung Shim <jy0922.shim@samsung.com>2016-07-07 15:40:02 +0900
commit502eded51a6da24e81f884957417c919cc59a58d (patch)
treee9cf44c7d784c2b44f91e1e7e7cc01ea0bbb8732 /drivers
parent6f323642abc53db3676649b8f826d64d6a88843e (diff)
downloadlinux-exynos-502eded51a6da24e81f884957417c919cc59a58d.tar.gz
linux-exynos-502eded51a6da24e81f884957417c919cc59a58d.tar.bz2
linux-exynos-502eded51a6da24e81f884957417c919cc59a58d.zip
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 <sw0312.kim@samsung.com> [jy0922.shim: apply to mali400 r5p2_rel0 with some modification] Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/arm/mali400/r5p2_rel0/common/mali_pm.c5
-rw-r--r--drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c9
-rw-r--r--drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_osk_pm.c14
-rw-r--r--drivers/gpu/arm/mali400/r5p2_rel0/platform/arm/arm.c8
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 85cdde01572b..9c6505c037f6 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 <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,
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 9b33bdc550fa..82d8302e6dc8 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);
@@ -211,7 +212,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,
@@ -628,7 +630,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 21180d33fe75..9253e5462b00 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 <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
}
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 9eaf07e7d5e9..48539444ab6e 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 <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));