wkup_m3_ipc.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * TI Wakeup M3 for AMx3 SoCs Power Management Routines
  4. *
  5. * Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com/
  6. * Dave Gerlach <[email protected]>
  7. */
  8. #ifndef _LINUX_WKUP_M3_IPC_H
  9. #define _LINUX_WKUP_M3_IPC_H
  10. #define WKUP_M3_DEEPSLEEP 1
  11. #define WKUP_M3_STANDBY 2
  12. #define WKUP_M3_IDLE 3
  13. #include <linux/mailbox_client.h>
  14. struct wkup_m3_ipc_ops;
  15. struct wkup_m3_ipc {
  16. struct rproc *rproc;
  17. void __iomem *ipc_mem_base;
  18. struct device *dev;
  19. int mem_type;
  20. unsigned long resume_addr;
  21. int vtt_conf;
  22. int isolation_conf;
  23. int state;
  24. u32 halt;
  25. unsigned long volt_scale_offsets;
  26. const char *sd_fw_name;
  27. struct completion sync_complete;
  28. struct mbox_client mbox_client;
  29. struct mbox_chan *mbox;
  30. struct wkup_m3_ipc_ops *ops;
  31. int is_rtc_only;
  32. struct dentry *dbg_path;
  33. };
  34. struct wkup_m3_wakeup_src {
  35. int irq_nr;
  36. char src[10];
  37. };
  38. struct wkup_m3_scale_data_header {
  39. u16 magic;
  40. u8 sleep_offset;
  41. u8 wake_offset;
  42. } __packed;
  43. struct wkup_m3_ipc_ops {
  44. void (*set_mem_type)(struct wkup_m3_ipc *m3_ipc, int mem_type);
  45. void (*set_resume_address)(struct wkup_m3_ipc *m3_ipc, void *addr);
  46. int (*prepare_low_power)(struct wkup_m3_ipc *m3_ipc, int state);
  47. int (*finish_low_power)(struct wkup_m3_ipc *m3_ipc);
  48. int (*request_pm_status)(struct wkup_m3_ipc *m3_ipc);
  49. const char *(*request_wake_src)(struct wkup_m3_ipc *m3_ipc);
  50. void (*set_rtc_only)(struct wkup_m3_ipc *m3_ipc);
  51. };
  52. struct wkup_m3_ipc *wkup_m3_ipc_get(void);
  53. void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc);
  54. void wkup_m3_set_rtc_only_mode(void);
  55. #endif /* _LINUX_WKUP_M3_IPC_H */