0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _SC_IPC_H
0009 #define _SC_IPC_H
0010
0011 #include <linux/device.h>
0012 #include <linux/types.h>
0013
0014 #define IMX_SC_RPC_VERSION 1
0015 #define IMX_SC_RPC_MAX_MSG 8
0016
0017 struct imx_sc_ipc;
0018
0019 enum imx_sc_rpc_svc {
0020 IMX_SC_RPC_SVC_UNKNOWN = 0,
0021 IMX_SC_RPC_SVC_RETURN = 1,
0022 IMX_SC_RPC_SVC_PM = 2,
0023 IMX_SC_RPC_SVC_RM = 3,
0024 IMX_SC_RPC_SVC_TIMER = 5,
0025 IMX_SC_RPC_SVC_PAD = 6,
0026 IMX_SC_RPC_SVC_MISC = 7,
0027 IMX_SC_RPC_SVC_IRQ = 8,
0028 };
0029
0030 struct imx_sc_rpc_msg {
0031 uint8_t ver;
0032 uint8_t size;
0033 uint8_t svc;
0034 uint8_t func;
0035 };
0036
0037 #ifdef CONFIG_IMX_SCU
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg, bool have_resp);
0050
0051
0052
0053
0054
0055
0056
0057
0058 int imx_scu_get_handle(struct imx_sc_ipc **ipc);
0059 #else
0060 static inline int imx_scu_call_rpc(struct imx_sc_ipc *ipc, void *msg,
0061 bool have_resp)
0062 {
0063 return -ENOTSUPP;
0064 }
0065
0066 static inline int imx_scu_get_handle(struct imx_sc_ipc **ipc)
0067 {
0068 return -ENOTSUPP;
0069 }
0070 #endif
0071 #endif