blob: d6ba7d39a62fecb497e87cbeca5a1f335675754b [file] [log] [blame]
Dave Gerlachcdd5de52015-09-22 19:14:54 -05001/*
2 * TI Wakeup M3 for AMx3 SoCs Power Management Routines
3 *
4 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
5 * Dave Gerlach <d-gerlach@ti.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
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
26struct wkup_m3_ipc_ops;
27
28struct 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};
44
45struct wkup_m3_ipc_ops {
46 void (*set_mem_type)(struct wkup_m3_ipc *m3_ipc, int mem_type);
47 void (*set_resume_address)(struct wkup_m3_ipc *m3_ipc, void *addr);
48 int (*prepare_low_power)(struct wkup_m3_ipc *m3_ipc, int state);
49 int (*finish_low_power)(struct wkup_m3_ipc *m3_ipc);
50 int (*request_pm_status)(struct wkup_m3_ipc *m3_ipc);
51};
52
53struct wkup_m3_ipc *wkup_m3_ipc_get(void);
54void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc);
55#endif /* _LINUX_WKUP_M3_IPC_H */