Merge tag 'perf-tools-for-v6.4-3-2023-05-06' of git://git.kernel.org/pub/scm/linux...
[linux-block.git] / include / linux / wkup_m3_ipc.h
CommitLineData
2aec85b2 1/* SPDX-License-Identifier: GPL-2.0-only */
cdd5de50
DG
2/*
3 * TI Wakeup M3 for AMx3 SoCs Power Management Routines
4 *
7f317d34 5 * Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com/
cdd5de50 6 * Dave Gerlach <d-gerlach@ti.com>
cdd5de50
DG
7 */
8
9#ifndef _LINUX_WKUP_M3_IPC_H
10#define _LINUX_WKUP_M3_IPC_H
11
12#define WKUP_M3_DEEPSLEEP 1
13#define WKUP_M3_STANDBY 2
14#define WKUP_M3_IDLE 3
15
16#include <linux/mailbox_client.h>
17
18struct wkup_m3_ipc_ops;
19
20struct wkup_m3_ipc {
21 struct rproc *rproc;
22
23 void __iomem *ipc_mem_base;
24 struct device *dev;
25
26 int mem_type;
27 unsigned long resume_addr;
f2260414 28 int vtt_conf;
1dcbae86 29 int isolation_conf;
cdd5de50 30 int state;
2a21f9e6 31 u32 halt;
cdd5de50 32
ea082040
DG
33 unsigned long volt_scale_offsets;
34 const char *sd_fw_name;
35
cdd5de50
DG
36 struct completion sync_complete;
37 struct mbox_client mbox_client;
38 struct mbox_chan *mbox;
39
40 struct wkup_m3_ipc_ops *ops;
7a872b6f 41 int is_rtc_only;
2a21f9e6 42 struct dentry *dbg_path;
cdd5de50
DG
43};
44
ec93b62f
DG
45struct wkup_m3_wakeup_src {
46 int irq_nr;
47 char src[10];
48};
49
ea082040
DG
50struct wkup_m3_scale_data_header {
51 u16 magic;
52 u8 sleep_offset;
53 u8 wake_offset;
54} __packed;
55
cdd5de50
DG
56struct wkup_m3_ipc_ops {
57 void (*set_mem_type)(struct wkup_m3_ipc *m3_ipc, int mem_type);
58 void (*set_resume_address)(struct wkup_m3_ipc *m3_ipc, void *addr);
59 int (*prepare_low_power)(struct wkup_m3_ipc *m3_ipc, int state);
60 int (*finish_low_power)(struct wkup_m3_ipc *m3_ipc);
61 int (*request_pm_status)(struct wkup_m3_ipc *m3_ipc);
ec93b62f 62 const char *(*request_wake_src)(struct wkup_m3_ipc *m3_ipc);
7a872b6f 63 void (*set_rtc_only)(struct wkup_m3_ipc *m3_ipc);
cdd5de50
DG
64};
65
66struct wkup_m3_ipc *wkup_m3_ipc_get(void);
67void wkup_m3_ipc_put(struct wkup_m3_ipc *m3_ipc);
7a872b6f 68void wkup_m3_set_rtc_only_mode(void);
cdd5de50 69#endif /* _LINUX_WKUP_M3_IPC_H */