0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef ASM_BL_SWITCHER_H
0010 #define ASM_BL_SWITCHER_H
0011
0012 #include <linux/compiler.h>
0013 #include <linux/types.h>
0014
0015 typedef void (*bL_switch_completion_handler)(void *cookie);
0016
0017 int bL_switch_request_cb(unsigned int cpu, unsigned int new_cluster_id,
0018 bL_switch_completion_handler completer,
0019 void *completer_cookie);
0020 static inline int bL_switch_request(unsigned int cpu, unsigned int new_cluster_id)
0021 {
0022 return bL_switch_request_cb(cpu, new_cluster_id, NULL, NULL);
0023 }
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #define BL_NOTIFY_PRE_ENABLE 0
0034 #define BL_NOTIFY_POST_ENABLE 1
0035 #define BL_NOTIFY_PRE_DISABLE 2
0036 #define BL_NOTIFY_POST_DISABLE 3
0037
0038 #ifdef CONFIG_BL_SWITCHER
0039
0040 int bL_switcher_register_notifier(struct notifier_block *nb);
0041 int bL_switcher_unregister_notifier(struct notifier_block *nb);
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 bool bL_switcher_get_enabled(void);
0052 void bL_switcher_put_enabled(void);
0053
0054 int bL_switcher_trace_trigger(void);
0055 int bL_switcher_get_logical_index(u32 mpidr);
0056
0057 #else
0058 static inline int bL_switcher_register_notifier(struct notifier_block *nb)
0059 {
0060 return 0;
0061 }
0062
0063 static inline int bL_switcher_unregister_notifier(struct notifier_block *nb)
0064 {
0065 return 0;
0066 }
0067
0068 static inline bool bL_switcher_get_enabled(void) { return false; }
0069 static inline void bL_switcher_put_enabled(void) { }
0070 static inline int bL_switcher_trace_trigger(void) { return 0; }
0071 static inline int bL_switcher_get_logical_index(u32 mpidr) { return -EUNATCH; }
0072 #endif
0073
0074 #endif