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);
#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,
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)
{
mali_pm_runtime_suspend();
*/
#include <linux/sched.h>
+#include <linux/version.h>
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+ || defined(CONFIG_PM)
#include <linux/pm_runtime.h>
-#endif /* CONFIG_PM_RUNTIME */
+#endif
#include <linux/platform_device.h>
#include <linux/version.h>
#include "mali_osk.h"
/* Can NOT run in atomic context */
_mali_osk_errcode_t _mali_osk_pm_dev_ref_add(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));
/* Can run in atomic context */
void _mali_osk_pm_dev_ref_dec(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);
_mali_osk_atomic_dec(&mali_pm_ref_count);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
/* Can run in atomic context */
mali_bool _mali_osk_pm_dev_ref_add_no_power_on(void)
{
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+ || defined(CONFIG_PM)
u32 ref;
MALI_DEBUG_ASSERT_POINTER(mali_platform_device);
pm_runtime_get_noresume(&(mali_platform_device->dev));
/* Can run in atomic context */
void _mali_osk_pm_dev_ref_dec_no_power_on(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_put_autosuspend(&(mali_platform_device->dev));
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);
};
#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,
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)
{
mali_pm_runtime_suspend();
*/
#include <linux/sched.h>
-
-#ifdef CONFIG_PM_RUNTIME
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+ || defined(CONFIG_PM)
#include <linux/pm_runtime.h>
-#endif /* CONFIG_PM_RUNTIME */
+#endif
#include <linux/platform_device.h>
-#include <linux/version.h>
#include "mali_osk.h"
#include "mali_kernel_common.h"
#include "mali_kernel_linux.h"
/* Can NOT run in atomic context */
_mali_osk_errcode_t _mali_osk_pm_dev_ref_add(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));
/* Can run in atomic context */
void _mali_osk_pm_dev_ref_dec(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);
_mali_osk_atomic_dec(&mali_pm_ref_count);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
/* Can run in atomic context */
mali_bool _mali_osk_pm_dev_ref_add_no_power_on(void)
{
-#ifdef CONFIG_PM_RUNTIME
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) && defined(CONFIG_PM_RUNTIME))\
+ || defined(CONFIG_PM)
u32 ref;
MALI_DEBUG_ASSERT_POINTER(mali_platform_device);
pm_runtime_get_noresume(&(mali_platform_device->dev));
/* Can run in atomic context */
void _mali_osk_pm_dev_ref_dec_no_power_on(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_put_autosuspend(&(mali_platform_device->dev));
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
}