xref: /linux/drivers/remoteproc/qcom_q6v5.h (revision 164666fa66669d437bdcc8d5f1744a2aee73be41)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #ifndef __QCOM_Q6V5_H__
4 #define __QCOM_Q6V5_H__
5 
6 #include <linux/kernel.h>
7 #include <linux/completion.h>
8 #include <linux/soc/qcom/qcom_aoss.h>
9 
10 struct rproc;
11 struct qcom_smem_state;
12 struct qcom_sysmon;
13 
14 struct qcom_q6v5 {
15 	struct device *dev;
16 	struct rproc *rproc;
17 
18 	struct qcom_smem_state *state;
19 	struct qmp *qmp;
20 
21 	unsigned stop_bit;
22 
23 	int wdog_irq;
24 	int fatal_irq;
25 	int ready_irq;
26 	int handover_irq;
27 	int stop_irq;
28 
29 	bool handover_issued;
30 
31 	struct completion start_done;
32 	struct completion stop_done;
33 
34 	int crash_reason;
35 
36 	bool running;
37 
38 	const char *load_state;
39 	void (*handover)(struct qcom_q6v5 *q6v5);
40 };
41 
42 int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
43 		   struct rproc *rproc, int crash_reason, const char *load_state,
44 		   void (*handover)(struct qcom_q6v5 *q6v5));
45 void qcom_q6v5_deinit(struct qcom_q6v5 *q6v5);
46 
47 int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5);
48 int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5);
49 int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5, struct qcom_sysmon *sysmon);
50 int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout);
51 unsigned long qcom_q6v5_panic(struct qcom_q6v5 *q6v5);
52 
53 #endif
54