Initial commit
[kernel/linux-3.0.git] / drivers / media / video / samsung / mali_r2p3 / common / pmm / mali_pmm_policy_alwayson.c
1 /*
2  * Copyright (C) 2010 ARM Limited. All rights reserved.
3  * 
4  * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5  * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6  * 
7  * A copy of the licence is included with the program, and can also be obtained from Free Software
8  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
9  */
10
11 /**
12  * @file mali_pmm_policy_alwayson.c
13  * Implementation of the power management module policy - always on
14  */
15
16 #if USING_MALI_PMM
17
18 #include "mali_ukk.h"
19 #include "mali_kernel_common.h"
20
21 #include "mali_pmm.h"
22 #include "mali_pmm_system.h"
23 #include "mali_pmm_state.h"
24 #include "mali_pmm_policy_alwayson.h"
25
26 _mali_osk_errcode_t pmm_policy_init_always_on(void)
27 {
28         /* Nothing to set up */
29         MALI_SUCCESS;
30 }
31
32 void pmm_policy_term_always_on(void)
33 {
34         /* Nothing to tear down */
35 }
36
37 _mali_osk_errcode_t pmm_policy_process_always_on( _mali_pmm_internal_state_t *pmm, mali_pmm_message_t *event )
38 {
39         MALI_DEBUG_ASSERT_POINTER(pmm);
40         MALI_DEBUG_ASSERT_POINTER(event);
41
42         switch( event->id )
43         {
44                 case MALI_PMM_EVENT_OS_POWER_DOWN:
45                         /* We aren't going to do anything, but signal so we don't block the OS
46                          * NOTE: This may adversely affect any jobs Mali is currently running
47                          */
48                         _mali_osk_pmm_power_down_done( event->data );
49                 break;
50
51                 case MALI_PMM_EVENT_INTERNAL_POWER_UP_ACK:
52                 case MALI_PMM_EVENT_INTERNAL_POWER_DOWN_ACK:
53                         /* Not expected in this policy */
54                         MALI_DEBUG_ASSERT( MALI_FALSE );
55                 break;
56
57                 case MALI_PMM_EVENT_OS_POWER_UP:
58                         /* Nothing to do */
59                         _mali_osk_pmm_power_up_done( event->data );
60                 break;
61                 
62                 case MALI_PMM_EVENT_JOB_SCHEDULED:
63                 case MALI_PMM_EVENT_JOB_QUEUED:
64                 case MALI_PMM_EVENT_JOB_FINISHED:
65                         /* Nothing to do - we are always on */
66                 break;
67         
68                 case MALI_PMM_EVENT_TIMEOUT:
69                         /* Not expected in this policy */
70                         MALI_DEBUG_ASSERT( MALI_FALSE );
71                 break;
72
73                 default:
74                 MALI_ERROR(_MALI_OSK_ERR_ITEM_NOT_FOUND);
75         }
76
77         MALI_SUCCESS;
78 }
79
80 #endif