Bjorn Andersson | 3b415c8 | 2018-06-04 13:30:36 -0700 | [diff] [blame] | 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 | |
| 9 | struct rproc; |
| 10 | struct qcom_smem_state; |
Bjorn Andersson | ed5da80 | 2020-11-21 21:41:34 -0800 | [diff] [blame] | 11 | struct qcom_sysmon; |
Bjorn Andersson | 3b415c8 | 2018-06-04 13:30:36 -0700 | [diff] [blame] | 12 | |
| 13 | struct qcom_q6v5 { |
| 14 | struct device *dev; |
| 15 | struct rproc *rproc; |
| 16 | |
| 17 | struct qcom_smem_state *state; |
| 18 | unsigned stop_bit; |
| 19 | |
| 20 | int wdog_irq; |
| 21 | int fatal_irq; |
| 22 | int ready_irq; |
| 23 | int handover_irq; |
| 24 | int stop_irq; |
| 25 | |
| 26 | bool handover_issued; |
| 27 | |
| 28 | struct completion start_done; |
| 29 | struct completion stop_done; |
| 30 | |
| 31 | int crash_reason; |
| 32 | |
| 33 | bool running; |
| 34 | |
| 35 | void (*handover)(struct qcom_q6v5 *q6v5); |
| 36 | }; |
| 37 | |
| 38 | int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev, |
| 39 | struct rproc *rproc, int crash_reason, |
| 40 | void (*handover)(struct qcom_q6v5 *q6v5)); |
| 41 | |
| 42 | int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5); |
| 43 | int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5); |
Bjorn Andersson | ed5da80 | 2020-11-21 21:41:34 -0800 | [diff] [blame] | 44 | int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5, struct qcom_sysmon *sysmon); |
Bjorn Andersson | 3b415c8 | 2018-06-04 13:30:36 -0700 | [diff] [blame] | 45 | int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout); |
Bjorn Andersson | e9142f5 | 2020-03-23 22:29:03 -0700 | [diff] [blame] | 46 | unsigned long qcom_q6v5_panic(struct qcom_q6v5 *q6v5); |
Bjorn Andersson | 3b415c8 | 2018-06-04 13:30:36 -0700 | [diff] [blame] | 47 | |
| 48 | #endif |