Esempio n. 1
0
void _mali_pm_callback(void *arg)
{
#if MALI_LICENSE_IS_GPL
    if (mali_pm_wq)
    {
        queue_work(mali_pm_wq, &mali_pm_wq_work_handle);
    }
    else
    {
        MALI_PRINTF(("mali_pm_wq is NULL !!!\n"));
        mali_bottom_half_pm(NULL);
    }
#else
    schedule_work(&mali_pm_wq_work_handle);
#endif
}
/* Can run in atomic context */
void _mali_osk_pm_dev_ref_dec(void)
{
#ifdef CONFIG_PM_RUNTIME
	MALI_DEBUG_ASSERT_POINTER(mali_platform_device);
	_mali_osk_atomic_dec(&mali_pm_ref_count);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
	pm_runtime_mark_last_busy(&(mali_platform_device->dev));
	pm_runtime_put_autosuspend(&(mali_platform_device->dev));
#else
	pm_runtime_put(&(mali_platform_device->dev));
#endif
	MALI_DEBUG_PRINT(4, ("Mali OSK PM: Power ref released (%u)\n", _mali_osk_atomic_read(&mali_pm_ref_count)));

#else /// CONFIG_PM_RUNTIME
      	
	if(_mali_osk_atomic_dec_return(&mali_pm_ref_count) == 0)
	{
	    if (NULL != pm_timer)
	    {
		    _mali_osk_timer_mod(pm_timer, _mali_osk_time_mstoticks(mali_pm_wq ? 15 : 3000));
		}
		else
		{
#if MALI_LICENSE_IS_GPL
            if (mali_pm_wq)
            {
                queue_work(mali_pm_wq, &mali_pm_wq_work_handle);
            }
            else
            {
                MALI_PRINTF(("mali_pm_wq is NULL !!!\n"));
                mali_bottom_half_pm(NULL);
            }
#else
            schedule_work(&mali_pm_wq_work_handle);
#endif
	    }
	}

	MALI_DEBUG_PRINT(4, ("Mali OSK PM: Power ref released (%u)\n", _mali_osk_atomic_read(&mali_pm_ref_count)));
#endif
}