1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 #ifndef _LINUX_WKUP_M3_IPC_H
  18 #define _LINUX_WKUP_M3_IPC_H
  19 
  20 #define WKUP_M3_DEEPSLEEP       1
  21 #define WKUP_M3_STANDBY         2
  22 #define WKUP_M3_IDLE            3
  23 
  24 #include <linux/mailbox_client.h>
  25 
  26 struct wkup_m3_ipc_ops;
  27 
  28 struct wkup_m3_ipc {
  29         struct rproc *rproc;
  30 
  31         void __iomem *ipc_mem_base;
  32         struct device *dev;
  33 
  34         int mem_type;
  35         unsigned long resume_addr;
  36         int state;
  37 
  38         struct completion sync_complete;
  39         struct mbox_client mbox_client;
  40         struct mbox_chan *mbox;
  41 
  42         struct wkup_m3_ipc_ops *ops;
  43         int is_rtc_only;
  44 };
  45 
  46 struct wkup_m3_wakeup_src {
  47         int irq_nr;
  48         char src[10];
  49 };
  50 
  51 struct wkup_m3_ipc_ops {
  52         void (*set_mem_type)(struct wkup_m3_ipc *m3_ipc, int mem_type);
  53         void (*set_resume_address)(struct wkup_m3_ipc *m3_ipc, void *addr);
  54         int (*prepare_low_power)(struct wkup_m3_ipc *m3_ipc, int state);
  55         int (*finish_low_power)(struct wkup_m3_ipc *m3_ipc);
  56         int (*request_pm_status)(struct wkup_m3_ipc *m3_ipc);
  57         const char *(*request_wake_src)(struct wkup_m3_ipc *m3_ipc);
  58         void (*set_rtc_only)(struct wkup_m3_ipc *m3_ipc);
  59 };
  60 
  61 struct wkup_m3_ipc *wkup_m3_ipc_get(void);
  62 void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc);
  63 void wkup_m3_set_rtc_only_mode(void);
  64 #endif