• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 Huawei Technologies Co., Ltd.
3  * Decription: function declaration for secs power ctrl.
4  *
5  * This software is licensed under the terms of the GNU General Public
6  * License version 2, as published by the Free Software Foundation, and
7  * may be copied, distributed, and modified under those terms.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  */
14 #ifndef SECS_POWER_CTRL_H
15 #define SECS_POWER_CTRL_H
16 
17 #include <tc_ns_log.h>
18 
19 #ifdef CONFIG_HISI_SECS_CTRL
20 #include <platform_include/see/secs_power_ctrl.h>
21 
22 #define SECS_SUSPEND_STATUS 0xA5A5
23 unsigned long get_secs_suspend_status(void);
24 
power_on_cc(void)25 static int power_on_cc(void)
26 {
27 	return hisi_secs_power_on();
28 }
29 
power_down_cc(void)30 static int power_down_cc(void)
31 {
32 	return hisi_secs_power_down();
33 }
34 
secs_suspend_status(uint64_t target)35 static void secs_suspend_status(uint64_t target)
36 {
37 	if (get_secs_suspend_status() == SECS_SUSPEND_STATUS)
38 		tloge("WARNING irq during suspend! No = %lld\n", target);
39 }
40 #else
41 
power_on_cc(void)42 static int power_on_cc(void)
43 {
44 	return 0;
45 }
46 
power_down_cc(void)47 static int power_down_cc(void)
48 {
49 	return 0;
50 }
51 
secs_suspend_status(uint64_t target)52 static void secs_suspend_status(uint64_t target)
53 {
54 	(void)target;
55 	return;
56 }
57 #endif
58 
59 #endif
60