summaryrefslogtreecommitdiff
path: root/drivers/remoteproc/qcom_q6v5.h
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2018-06-04 23:30:36 +0300
committerBjorn Andersson <bjorn.andersson@linaro.org>2018-06-19 01:55:57 +0300
commit3b415c8fb263173a60e12666213073c9653737d0 (patch)
tree41a35df39941028a705142f280e9b2dd768b2d67 /drivers/remoteproc/qcom_q6v5.h
parent0e622e80191e75c99b6ecc265c140a37d81e7a63 (diff)
downloadlinux-3b415c8fb263173a60e12666213073c9653737d0.tar.xz
remoteproc: q6v5: Extract common resource handling
Shared between all Hexagon V5 based remoteprocs is the handling of the 5 interrupts and the SMP2P stop request, so break this out into a separate function in order to allow these drivers to be cleaned up. Reviewed-by: Rohit kumar <rohitkr@codeaurora.org> Tested-by: Rohit kumar <rohitkr@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc/qcom_q6v5.h')
-rw-r--r--drivers/remoteproc/qcom_q6v5.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/remoteproc/qcom_q6v5.h b/drivers/remoteproc/qcom_q6v5.h
new file mode 100644
index 000000000000..7ac92c1e0f49
--- /dev/null
+++ b/drivers/remoteproc/qcom_q6v5.h
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __QCOM_Q6V5_H__
+#define __QCOM_Q6V5_H__
+
+#include <linux/kernel.h>
+#include <linux/completion.h>
+
+struct rproc;
+struct qcom_smem_state;
+
+struct qcom_q6v5 {
+ struct device *dev;
+ struct rproc *rproc;
+
+ struct qcom_smem_state *state;
+ unsigned stop_bit;
+
+ int wdog_irq;
+ int fatal_irq;
+ int ready_irq;
+ int handover_irq;
+ int stop_irq;
+
+ bool handover_issued;
+
+ struct completion start_done;
+ struct completion stop_done;
+
+ int crash_reason;
+
+ bool running;
+
+ void (*handover)(struct qcom_q6v5 *q6v5);
+};
+
+int qcom_q6v5_init(struct qcom_q6v5 *q6v5, struct platform_device *pdev,
+ struct rproc *rproc, int crash_reason,
+ void (*handover)(struct qcom_q6v5 *q6v5));
+
+int qcom_q6v5_prepare(struct qcom_q6v5 *q6v5);
+int qcom_q6v5_unprepare(struct qcom_q6v5 *q6v5);
+int qcom_q6v5_request_stop(struct qcom_q6v5 *q6v5);
+int qcom_q6v5_wait_for_start(struct qcom_q6v5 *q6v5, int timeout);
+
+#endif